History

rtc: bd70528: add BD71828 support

ROHM BD71828 PMIC RTC block is from many parts similar to one on BD70528. Support BD71828 RTC using BD70528 RTC driver and avoid re-inventing the wheel.

Matti Vaittinen committed 6 years ago

Commit fe5a5911 parent 6c883475 files · +206 −55Browse files

Showing the changes to include/linux (3 of 5 files). Show all

Unified · Split

3 files
  1. include/linux/mfd/rohm-bd70528.h +1 −12
  2. include/linux/mfd/rohm-bd71828.h +3 −1
  3. include/linux/mfd/rohm-shared.h +21 −0
include/linux/mfd/rohm-bd70528.h+1−12
@@ -7,6 +7,7 @@ · 6 unmodified lines
77 #include <linux/bits.h>
88 #include <linux/device.h>
99 #include <linux/mfd/rohm-generic.h>
10+#include <linux/mfd/rohm-shared.h>
1011 #include <linux/regmap.h>
1112
1213 enum {
@@ -307,17 +308,6 @@ enum { · 294 unmodified lines
307308
308309 /* RTC masks to mask out reserved bits */
309310
310−#define BD70528_MASK_RTC_SEC 0x7f
311−#define BD70528_MASK_RTC_MINUTE 0x7f
312−#define BD70528_MASK_RTC_HOUR_24H 0x80
313−#define BD70528_MASK_RTC_HOUR_PM 0x20
314−#define BD70528_MASK_RTC_HOUR 0x3f
315−#define BD70528_MASK_RTC_DAY 0x3f
316−#define BD70528_MASK_RTC_WEEK 0x07
317−#define BD70528_MASK_RTC_MONTH 0x1f
318−#define BD70528_MASK_RTC_YEAR 0xff
319−#define BD70528_MASK_RTC_COUNT_L 0x7f
320−
321311 #define BD70528_MASK_ELAPSED_TIMER_EN 0x1
322312 /* Mask second, min and hour fields
323313 * HW would support ALM irq for over 24h
@@ -326,7 +316,6 @@ enum { · 2 unmodified lines
326316 * wake-up we limit ALM to 24H and only
327317 * unmask sec, min and hour
328318 */
329−#define BD70528_MASK_ALM_EN 0x7
330319 #define BD70528_MASK_WAKE_EN 0x1
331320
332321 /* WDT masks */
include/linux/mfd/rohm-bd71828.h+3−1
@@ -5,6 +5,7 @@ · 4 unmodified lines
55 #define __LINUX_MFD_BD71828_H__
66
77 #include <linux/mfd/rohm-generic.h>
8+#include <linux/mfd/rohm-shared.h>
89
910 /* Regulator IDs */
1011 enum {
@@ -160,6 +161,7 @@ enum { · 149 unmodified lines
160161 #define BD71828_REG_RTC_YEAR 0x52
161162
162163 #define BD71828_REG_RTC_ALM0_SEC 0x53
164+#define BD71828_REG_RTC_ALM_START BD71828_REG_RTC_ALM0_SEC
163165 #define BD71828_REG_RTC_ALM0_MINUTE 0x54
164166 #define BD71828_REG_RTC_ALM0_HOUR 0x55
165167 #define BD71828_REG_RTC_ALM0_WEEK 0x56
@@ -178,6 +180,7 @@ enum { · 12 unmodified lines
178180 #define BD71828_REG_RTC_ALM1_MASK 0x62
179181
180182 #define BD71828_REG_RTC_ALM2 0x63
183+#define BD71828_REG_RTC_START BD71828_REG_RTC_SEC
181184
182185 /* Charger/Battey */
183186 #define BD71828_REG_CHG_STATE 0x65
@@ -204,7 +207,6 @@ enum { · 20 unmodified lines
204207 #define BD71828_REG_INT_MASK_TEMP 0xdd
205208 #define BD71828_REG_INT_MASK_RTC 0xde
206209
207−
208210 #define BD71828_REG_INT_MAIN 0xdf
209211 #define BD71828_REG_INT_BUCK 0xe0
210212 #define BD71828_REG_INT_DCIN1 0xe1
include/linux/mfd/rohm-shared.h+21−0
@@ -0,0 +1,21 @@
1+/* SPDX-License-Identifier: GPL-2.0-or-later */
2+/* Copyright (C) 2020 ROHM Semiconductors */
3+
4+
5+#ifndef __LINUX_MFD_ROHM_SHARED_H__
6+#define __LINUX_MFD_ROHM_SHARED_H__
7+
8+/* RTC definitions shared between BD70528 and BD71828 */
9+
10+#define BD70528_MASK_RTC_SEC 0x7f
11+#define BD70528_MASK_RTC_MINUTE 0x7f
12+#define BD70528_MASK_RTC_HOUR_24H 0x80
13+#define BD70528_MASK_RTC_HOUR_PM 0x20
14+#define BD70528_MASK_RTC_HOUR 0x3f
15+#define BD70528_MASK_RTC_DAY 0x3f
16+#define BD70528_MASK_RTC_WEEK 0x07
17+#define BD70528_MASK_RTC_MONTH 0x1f
18+#define BD70528_MASK_RTC_YEAR 0xff
19+#define BD70528_MASK_ALM_EN 0x7
20+
21+#endif /* __LINUX_MFD_ROHM_SHARED_H__ */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t