[PATCH v2 12/15] rtc: bd70528: Support BD72720 rtc

Matti Vaittinen posted 15 patches 3 months, 2 weeks ago
There is a newer version of this series
[PATCH v2 12/15] rtc: bd70528: Support BD72720 rtc
Posted by Matti Vaittinen 3 months, 2 weeks ago
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>

---
Revision history:
 RFCv1 =>:
 - No changes
---
 drivers/rtc/Kconfig       |  3 ++-
 drivers/rtc/rtc-bd70528.c | 21 ++++++++++++++-------
 2 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index 2933c41c77c8..418f6c28847a 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -561,7 +561,8 @@ config RTC_DRV_BD70528
 	depends on MFD_ROHM_BD71828
 	help
 	  If you say Y here you will get support for the RTC
-	  block on ROHM BD71815 and BD71828 Power Management IC.
+	  block on ROHM BD71815, BD71828 and BD72720 Power
+	  Management ICs.
 
 	  This driver can also be built as a module. If so, the module
 	  will be called rtc-bd70528.
diff --git a/drivers/rtc/rtc-bd70528.c b/drivers/rtc/rtc-bd70528.c
index 954ac4ef53e8..4c8599761b2e 100644
--- a/drivers/rtc/rtc-bd70528.c
+++ b/drivers/rtc/rtc-bd70528.c
@@ -7,6 +7,7 @@
 #include <linux/bcd.h>
 #include <linux/mfd/rohm-bd71815.h>
 #include <linux/mfd/rohm-bd71828.h>
+#include <linux/mfd/rohm-bd72720.h>
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>
@@ -262,13 +263,13 @@ static int bd70528_probe(struct platform_device *pdev)
 
 		/*
 		 * See also BD718XX_ALM_EN_OFFSET:
-		 * This works for BD71828 and BD71815 as they have same offset
-		 * between ALM0 start and ALM0_MASK. If new ICs are to be
-		 * added this requires proper check as ALM0_MASK is not located
-		 * at the end of ALM0 block - but after all ALM blocks so if
-		 * amount of ALMs differ the offset to enable/disable is likely
-		 * to be incorrect and enable/disable must be given as own
-		 * reg address here.
+		 * This works for BD71828, BD71815, and BD72720 as they all
+		 * have same offset between the ALM0 start and the ALM0_MASK.
+		 * If new ICs are to be added this requires proper check as
+		 * the  ALM0_MASK is not located at the end of ALM0 block -
+		 * but after all ALM blocks. If amount of ALMs differ, the
+		 * offset to enable/disable is likely to be incorrect and
+		 * enable/disable must be given as own reg address here.
 		 */
 		bd_rtc->bd718xx_alm_block_start = BD71815_REG_RTC_ALM_START;
 		hour_reg = BD71815_REG_HOUR;
@@ -278,6 +279,11 @@ static int bd70528_probe(struct platform_device *pdev)
 		bd_rtc->bd718xx_alm_block_start = BD71828_REG_RTC_ALM_START;
 		hour_reg = BD71828_REG_RTC_HOUR;
 		break;
+	case ROHM_CHIP_TYPE_BD72720:
+		bd_rtc->reg_time_start = BD72720_REG_RTC_START;
+		bd_rtc->bd718xx_alm_block_start = BD72720_REG_RTC_ALM_START;
+		hour_reg = BD72720_REG_RTC_HOUR;
+		break;
 	default:
 		dev_err(&pdev->dev, "Unknown chip\n");
 		return -ENOENT;
@@ -337,6 +343,7 @@ static int bd70528_probe(struct platform_device *pdev)
 static const struct platform_device_id bd718x7_rtc_id[] = {
 	{ "bd71828-rtc", ROHM_CHIP_TYPE_BD71828 },
 	{ "bd71815-rtc", ROHM_CHIP_TYPE_BD71815 },
+	{ "bd72720-rtc", ROHM_CHIP_TYPE_BD72720 },
 	{ },
 };
 MODULE_DEVICE_TABLE(platform, bd718x7_rtc_id);
-- 
2.51.0

Re: [PATCH v2 12/15] rtc: bd70528: Support BD72720 rtc
Posted by Alexandre Belloni 3 months, 2 weeks ago
On 27/10/2025 13:47:51+0200, Matti Vaittinen wrote:
> 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>

Note that we didn't get 07/15 that adds linux/mfd/rohm-bd72720.h which
this patch depends on.

> ---
> Revision history:
>  RFCv1 =>:
>  - No changes
> ---
>  drivers/rtc/Kconfig       |  3 ++-
>  drivers/rtc/rtc-bd70528.c | 21 ++++++++++++++-------
>  2 files changed, 16 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
> index 2933c41c77c8..418f6c28847a 100644
> --- a/drivers/rtc/Kconfig
> +++ b/drivers/rtc/Kconfig
> @@ -561,7 +561,8 @@ config RTC_DRV_BD70528
>  	depends on MFD_ROHM_BD71828
>  	help
>  	  If you say Y here you will get support for the RTC
> -	  block on ROHM BD71815 and BD71828 Power Management IC.
> +	  block on ROHM BD71815, BD71828 and BD72720 Power
> +	  Management ICs.
>  
>  	  This driver can also be built as a module. If so, the module
>  	  will be called rtc-bd70528.
> diff --git a/drivers/rtc/rtc-bd70528.c b/drivers/rtc/rtc-bd70528.c
> index 954ac4ef53e8..4c8599761b2e 100644
> --- a/drivers/rtc/rtc-bd70528.c
> +++ b/drivers/rtc/rtc-bd70528.c
> @@ -7,6 +7,7 @@
>  #include <linux/bcd.h>
>  #include <linux/mfd/rohm-bd71815.h>
>  #include <linux/mfd/rohm-bd71828.h>
> +#include <linux/mfd/rohm-bd72720.h>
>  #include <linux/module.h>
>  #include <linux/of.h>
>  #include <linux/platform_device.h>
> @@ -262,13 +263,13 @@ static int bd70528_probe(struct platform_device *pdev)
>  
>  		/*
>  		 * See also BD718XX_ALM_EN_OFFSET:
> -		 * This works for BD71828 and BD71815 as they have same offset
> -		 * between ALM0 start and ALM0_MASK. If new ICs are to be
> -		 * added this requires proper check as ALM0_MASK is not located
> -		 * at the end of ALM0 block - but after all ALM blocks so if
> -		 * amount of ALMs differ the offset to enable/disable is likely
> -		 * to be incorrect and enable/disable must be given as own
> -		 * reg address here.
> +		 * This works for BD71828, BD71815, and BD72720 as they all
> +		 * have same offset between the ALM0 start and the ALM0_MASK.
> +		 * If new ICs are to be added this requires proper check as
> +		 * the  ALM0_MASK is not located at the end of ALM0 block -
> +		 * but after all ALM blocks. If amount of ALMs differ, the
> +		 * offset to enable/disable is likely to be incorrect and
> +		 * enable/disable must be given as own reg address here.
>  		 */
>  		bd_rtc->bd718xx_alm_block_start = BD71815_REG_RTC_ALM_START;
>  		hour_reg = BD71815_REG_HOUR;
> @@ -278,6 +279,11 @@ static int bd70528_probe(struct platform_device *pdev)
>  		bd_rtc->bd718xx_alm_block_start = BD71828_REG_RTC_ALM_START;
>  		hour_reg = BD71828_REG_RTC_HOUR;
>  		break;
> +	case ROHM_CHIP_TYPE_BD72720:
> +		bd_rtc->reg_time_start = BD72720_REG_RTC_START;
> +		bd_rtc->bd718xx_alm_block_start = BD72720_REG_RTC_ALM_START;
> +		hour_reg = BD72720_REG_RTC_HOUR;
> +		break;
>  	default:
>  		dev_err(&pdev->dev, "Unknown chip\n");
>  		return -ENOENT;
> @@ -337,6 +343,7 @@ static int bd70528_probe(struct platform_device *pdev)
>  static const struct platform_device_id bd718x7_rtc_id[] = {
>  	{ "bd71828-rtc", ROHM_CHIP_TYPE_BD71828 },
>  	{ "bd71815-rtc", ROHM_CHIP_TYPE_BD71815 },
> +	{ "bd72720-rtc", ROHM_CHIP_TYPE_BD72720 },
>  	{ },
>  };
>  MODULE_DEVICE_TABLE(platform, bd718x7_rtc_id);
> -- 
> 2.51.0
> 



-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Re: [PATCH v2 12/15] rtc: bd70528: Support BD72720 rtc
Posted by Matti Vaittinen 3 months, 2 weeks ago
On 27/10/2025 14:38, Alexandre Belloni wrote:
> On 27/10/2025 13:47:51+0200, Matti Vaittinen wrote:
>> 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>
> 
> Note that we didn't get 07/15 that adds linux/mfd/rohm-bd72720.h which
> this patch depends on.

Thanks for the heads-up Alexandre!

For some reason the SMTP server seems to be blocking the 7/15 :/ I will 
try to figure out a way to send it :(

Yours,
	-- Matti