Skip to content

Commit 0234e00

Browse files
M-Vaittinenlag-linaro
authored andcommitted
rtc: bd70528: Support BD72720 rtc
The BD72720 has similar RTC block as a few other ROHM PMICs. Add support for BD72720 RTC. Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com> Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://patch.msgid.link/3241773f0f8e8d8e591a8e948495686cfdee4875.1765804226.git.mazziesaccount@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>
1 parent da4950b commit 0234e00

2 files changed

Lines changed: 16 additions & 8 deletions

File tree

drivers/rtc/Kconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,8 @@ config RTC_DRV_BD70528
570570
depends on MFD_ROHM_BD71828
571571
help
572572
If you say Y here you will get support for the RTC
573-
block on ROHM BD71815 and BD71828 Power Management IC.
573+
block on ROHM BD71815, BD71828 and BD72720 Power
574+
Management ICs.
574575

575576
This driver can also be built as a module. If so, the module
576577
will be called rtc-bd70528.

drivers/rtc/rtc-bd70528.c

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <linux/bcd.h>
88
#include <linux/mfd/rohm-bd71815.h>
99
#include <linux/mfd/rohm-bd71828.h>
10+
#include <linux/mfd/rohm-bd72720.h>
1011
#include <linux/module.h>
1112
#include <linux/of.h>
1213
#include <linux/platform_device.h>
@@ -262,13 +263,13 @@ static int bd70528_probe(struct platform_device *pdev)
262263

263264
/*
264265
* See also BD718XX_ALM_EN_OFFSET:
265-
* This works for BD71828 and BD71815 as they have same offset
266-
* between ALM0 start and ALM0_MASK. If new ICs are to be
267-
* added this requires proper check as ALM0_MASK is not located
268-
* at the end of ALM0 block - but after all ALM blocks so if
269-
* amount of ALMs differ the offset to enable/disable is likely
270-
* to be incorrect and enable/disable must be given as own
271-
* reg address here.
266+
* This works for BD71828, BD71815, and BD72720 as they all
267+
* have same offset between the ALM0 start and the ALM0_MASK.
268+
* If new ICs are to be added this requires proper check as
269+
* the ALM0_MASK is not located at the end of ALM0 block -
270+
* but after all ALM blocks. If amount of ALMs differ, the
271+
* offset to enable/disable is likely to be incorrect and
272+
* enable/disable must be given as own reg address here.
272273
*/
273274
bd_rtc->bd718xx_alm_block_start = BD71815_REG_RTC_ALM_START;
274275
hour_reg = BD71815_REG_HOUR;
@@ -278,6 +279,11 @@ static int bd70528_probe(struct platform_device *pdev)
278279
bd_rtc->bd718xx_alm_block_start = BD71828_REG_RTC_ALM_START;
279280
hour_reg = BD71828_REG_RTC_HOUR;
280281
break;
282+
case ROHM_CHIP_TYPE_BD72720:
283+
bd_rtc->reg_time_start = BD72720_REG_RTC_START;
284+
bd_rtc->bd718xx_alm_block_start = BD72720_REG_RTC_ALM_START;
285+
hour_reg = BD72720_REG_RTC_HOUR;
286+
break;
281287
default:
282288
dev_err(&pdev->dev, "Unknown chip\n");
283289
return -ENOENT;
@@ -337,6 +343,7 @@ static int bd70528_probe(struct platform_device *pdev)
337343
static const struct platform_device_id bd718x7_rtc_id[] = {
338344
{ "bd71828-rtc", ROHM_CHIP_TYPE_BD71828 },
339345
{ "bd71815-rtc", ROHM_CHIP_TYPE_BD71815 },
346+
{ "bd72720-rtc", ROHM_CHIP_TYPE_BD72720 },
340347
{ },
341348
};
342349
MODULE_DEVICE_TABLE(platform, bd718x7_rtc_id);

0 commit comments

Comments
 (0)