Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Matti Vaittinen and committed by
Lee Jones
0234e003 da4950b5

+16 -8
+2 -1
drivers/rtc/Kconfig
··· 570 570 depends on MFD_ROHM_BD71828 571 571 help 572 572 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. 574 575 575 576 This driver can also be built as a module. If so, the module 576 577 will be called rtc-bd70528.
+14 -7
drivers/rtc/rtc-bd70528.c
··· 7 7 #include <linux/bcd.h> 8 8 #include <linux/mfd/rohm-bd71815.h> 9 9 #include <linux/mfd/rohm-bd71828.h> 10 + #include <linux/mfd/rohm-bd72720.h> 10 11 #include <linux/module.h> 11 12 #include <linux/of.h> 12 13 #include <linux/platform_device.h> ··· 263 262 264 263 /* 265 264 * See also BD718XX_ALM_EN_OFFSET: 266 - * This works for BD71828 and BD71815 as they have same offset 267 - * between ALM0 start and ALM0_MASK. If new ICs are to be 268 - * added this requires proper check as ALM0_MASK is not located 269 - * at the end of ALM0 block - but after all ALM blocks so if 270 - * amount of ALMs differ the offset to enable/disable is likely 271 - * to be incorrect and enable/disable must be given as own 272 - * reg address here. 265 + * This works for BD71828, BD71815, and BD72720 as they all 266 + * have same offset between the ALM0 start and the ALM0_MASK. 267 + * If new ICs are to be added this requires proper check as 268 + * the ALM0_MASK is not located at the end of ALM0 block - 269 + * but after all ALM blocks. If amount of ALMs differ, the 270 + * offset to enable/disable is likely to be incorrect and 271 + * enable/disable must be given as own reg address here. 273 272 */ 274 273 bd_rtc->bd718xx_alm_block_start = BD71815_REG_RTC_ALM_START; 275 274 hour_reg = BD71815_REG_HOUR; ··· 278 277 bd_rtc->reg_time_start = BD71828_REG_RTC_START; 279 278 bd_rtc->bd718xx_alm_block_start = BD71828_REG_RTC_ALM_START; 280 279 hour_reg = BD71828_REG_RTC_HOUR; 280 + break; 281 + case ROHM_CHIP_TYPE_BD72720: 282 + bd_rtc->reg_time_start = BD72720_REG_RTC_START; 283 + bd_rtc->bd718xx_alm_block_start = BD72720_REG_RTC_ALM_START; 284 + hour_reg = BD72720_REG_RTC_HOUR; 281 285 break; 282 286 default: 283 287 dev_err(&pdev->dev, "Unknown chip\n"); ··· 343 337 static const struct platform_device_id bd718x7_rtc_id[] = { 344 338 { "bd71828-rtc", ROHM_CHIP_TYPE_BD71828 }, 345 339 { "bd71815-rtc", ROHM_CHIP_TYPE_BD71815 }, 340 + { "bd72720-rtc", ROHM_CHIP_TYPE_BD72720 }, 346 341 { }, 347 342 }; 348 343 MODULE_DEVICE_TABLE(platform, bd718x7_rtc_id);