Linux LED subsystem development
 help / color / mirror / Atom feed
From: Matti Vaittinen <mazziesaccount@gmail.com>
To: Matti Vaittinen <mazziesaccount@gmail.com>,
	Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Cc: Lee Jones <lee@kernel.org>, Pavel Machek <pavel@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Sebastian Reichel <sre@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <brgl@bgdev.pl>,
	Matti Vaittinen <mazziesaccount@gmail.com>,
	Andreas Kemnade <andreas@kemnade.info>,
	linux-leds@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
	linux-gpio@vger.kernel.org
Subject: [RFC PATCH 11/13] rtc: bd70528: Support BD72720 rtc
Date: Tue, 7 Oct 2025 11:34:53 +0300	[thread overview]
Message-ID: <bdafe71d478386aded6a72e1de8b70b31e00f366.1759824376.git.mazziesaccount@gmail.com> (raw)
In-Reply-To: <cover.1759824376.git.mazziesaccount@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3163 bytes --]

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>
---
 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 64f6e9756aff..bf7d78a65ac3 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -541,7 +541,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


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  parent reply	other threads:[~2025-10-07  8:35 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-07  8:32 [RFC PATCH 00/13] Support ROHM BD72720 PMIC Matti Vaittinen
2025-10-07  8:32 ` [RFC PATCH 01/13] dt-bindings: regulator: ROHM BD72720 Matti Vaittinen
2025-10-07  8:33 ` [RFC PATCH 02/13] dt-bindings: Add trickle-charge upper limit Matti Vaittinen
2025-10-13 12:31   ` Linus Walleij
2025-10-07  8:33 ` [RFC PATCH 03/13] dt-bindings: power: supply: BD72720 managed battery Matti Vaittinen
2025-10-13 12:45   ` Linus Walleij
2025-10-13 13:00     ` Matti Vaittinen
2025-10-14 10:29       ` Linus Walleij
2025-10-07  8:33 ` [RFC PATCH 04/13] dt-bindings: mfd: ROHM BD72720 Matti Vaittinen
2025-10-13 12:58   ` Linus Walleij
2025-10-14 12:11     ` Matti Vaittinen
2025-10-14 12:58       ` Linus Walleij
2025-10-07  8:33 ` [RFC PATCH 05/13] dt-bindings: leds: bd72720: Add BD72720 Matti Vaittinen
2025-10-07  8:33 ` [RFC PATCH 06/13] mfd: bd71828: Support ROHM BD72720 Matti Vaittinen
2025-10-09 16:18   ` Lee Jones
2025-10-10 12:09     ` Matti Vaittinen
2025-10-10 13:03       ` Andreas Kemnade
2025-10-13  9:27         ` Matti Vaittinen
2025-10-13 13:19           ` Andreas Kemnade
2025-10-14  5:41             ` Matti Vaittinen
2025-10-15  7:46               ` Matti Vaittinen
2025-10-10 14:45       ` Lee Jones
2025-10-13 12:28         ` Matti Vaittinen
2025-10-16 15:27           ` Lee Jones
2025-10-07  8:34 ` [RFC PATCH 07/13] regulator: bd71828: rename IC specific entities Matti Vaittinen
2025-10-07  8:34 ` [RFC PATCH 08/13] regulator: bd71828: Support ROHM BD72720 Matti Vaittinen
2025-10-07  8:34 ` [RFC PATCH 09/13] gpio: Support ROHM BD72720 gpios Matti Vaittinen
2025-10-13 12:54   ` Linus Walleij
2025-10-16 11:04   ` Bartosz Golaszewski
2025-10-07  8:34 ` [RFC PATCH 10/13] clk: clk-bd718x7: Support BD72720 clk gate Matti Vaittinen
2025-10-07  8:34 ` Matti Vaittinen [this message]
2025-10-07  8:35 ` [RFC PATCH 12/13] power: supply: bd71828-power: Support ROHM BD72720 Matti Vaittinen
2025-10-07  8:35 ` [RFC PATCH 13/13] MAINTAINERS: Add ROHM BD72720 PMIC Matti Vaittinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bdafe71d478386aded6a72e1de8b70b31e00f366.1759824376.git.mazziesaccount@gmail.com \
    --to=mazziesaccount@gmail.com \
    --cc=andreas@kemnade.info \
    --cc=brgl@bgdev.pl \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lee@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=matti.vaittinen@fi.rohmeurope.com \
    --cc=pavel@kernel.org \
    --cc=robh@kernel.org \
    --cc=sre@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox