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
7#include <linux/bits.h>7#include <linux/bits.h>
8#include <linux/device.h>8#include <linux/device.h>
9#include <linux/mfd/rohm-generic.h>9#include <linux/mfd/rohm-generic.h>
10#include <linux/mfd/rohm-shared.h>
10#include <linux/regmap.h>11#include <linux/regmap.h>
11 12
12enum {13enum {
@@ -307,17 +308,6 @@ enum { · 294 unmodified lines
307 308
308/* RTC masks to mask out reserved bits */309/* RTC masks to mask out reserved bits */
309 310
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
321#define BD70528_MASK_ELAPSED_TIMER_EN 0x1311#define BD70528_MASK_ELAPSED_TIMER_EN 0x1
322/* Mask second, min and hour fields312/* Mask second, min and hour fields
323 * HW would support ALM irq for over 24h313 * HW would support ALM irq for over 24h
@@ -326,7 +316,6 @@ enum { · 2 unmodified lines
326 * wake-up we limit ALM to 24H and only316 * wake-up we limit ALM to 24H and only
327 * unmask sec, min and hour317 * unmask sec, min and hour
328 */318 */
329#define BD70528_MASK_ALM_EN 0x7
330#define BD70528_MASK_WAKE_EN 0x1319#define BD70528_MASK_WAKE_EN 0x1
331 320
332/* WDT masks */321/* WDT masks */
include/linux/mfd/rohm-bd71828.h+3−1
@@ -5,6 +5,7 @@ · 4 unmodified lines
5#define __LINUX_MFD_BD71828_H__5#define __LINUX_MFD_BD71828_H__
6 6
7#include <linux/mfd/rohm-generic.h>7#include <linux/mfd/rohm-generic.h>
8#include <linux/mfd/rohm-shared.h>
8 9
9/* Regulator IDs */10/* Regulator IDs */
10enum {11enum {
@@ -160,6 +161,7 @@ enum { · 149 unmodified lines
160#define BD71828_REG_RTC_YEAR 0x52161#define BD71828_REG_RTC_YEAR 0x52
161 162
162#define BD71828_REG_RTC_ALM0_SEC 0x53163#define BD71828_REG_RTC_ALM0_SEC 0x53
164#define BD71828_REG_RTC_ALM_START BD71828_REG_RTC_ALM0_SEC
163#define BD71828_REG_RTC_ALM0_MINUTE 0x54165#define BD71828_REG_RTC_ALM0_MINUTE 0x54
164#define BD71828_REG_RTC_ALM0_HOUR 0x55166#define BD71828_REG_RTC_ALM0_HOUR 0x55
165#define BD71828_REG_RTC_ALM0_WEEK 0x56167#define BD71828_REG_RTC_ALM0_WEEK 0x56
@@ -178,6 +180,7 @@ enum { · 12 unmodified lines
178#define BD71828_REG_RTC_ALM1_MASK 0x62180#define BD71828_REG_RTC_ALM1_MASK 0x62
179 181
180#define BD71828_REG_RTC_ALM2 0x63182#define BD71828_REG_RTC_ALM2 0x63
183#define BD71828_REG_RTC_START BD71828_REG_RTC_SEC
181 184
182/* Charger/Battey */185/* Charger/Battey */
183#define BD71828_REG_CHG_STATE 0x65186#define BD71828_REG_CHG_STATE 0x65
@@ -204,7 +207,6 @@ enum { · 20 unmodified lines
204#define BD71828_REG_INT_MASK_TEMP 0xdd207#define BD71828_REG_INT_MASK_TEMP 0xdd
205#define BD71828_REG_INT_MASK_RTC 0xde208#define BD71828_REG_INT_MASK_RTC 0xde
206 209
207
208#define BD71828_REG_INT_MAIN 0xdf210#define BD71828_REG_INT_MAIN 0xdf
209#define BD71828_REG_INT_BUCK 0xe0211#define BD71828_REG_INT_BUCK 0xe0
210#define BD71828_REG_INT_DCIN1 0xe1212#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