mirror of https://lore.kernel.org/lkml/
 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>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Matti Vaittinen <mazziesaccount@gmail.com>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v3 10/14] mfd: bd96801: Support ROHM BD96805
Date: Tue, 8 Apr 2025 11:46:36 +0300	[thread overview]
Message-ID: <8680097dc083f191bea56d3ac7c6fe5c005644ec.1744090658.git.mazziesaccount@gmail.com> (raw)
In-Reply-To: <cover.1744090658.git.mazziesaccount@gmail.com>

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

The ROHM BD96805 is from the software perspective almost identical to
the ROHM BD96801. The main difference is different voltage tuning
ranges. Add support differentiating these PMICs based on the compatible,
and invoking the regulator driver with correct IC type.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Acked-by: Lee Jones <lee@kernel.org>

---
Revision history:
v2 => :
  - No changes
v1 => v2:
 - Use chip_type enum
---
 drivers/mfd/rohm-bd96801.c       | 22 ++++++++++++++++++++++
 include/linux/mfd/rohm-generic.h |  1 +
 2 files changed, 23 insertions(+)

diff --git a/drivers/mfd/rohm-bd96801.c b/drivers/mfd/rohm-bd96801.c
index e5ee5f556a55..dd0be7d675b8 100644
--- a/drivers/mfd/rohm-bd96801.c
+++ b/drivers/mfd/rohm-bd96801.c
@@ -220,6 +220,10 @@ static struct mfd_cell bd96802_cells[] = {
 	[WDG_CELL] = { .name = "bd96801-wdt", },
 	[REGULATOR_CELL] = { .name = "bd96802-regulator", },
 };
+static struct mfd_cell bd96805_cells[] = {
+	[WDG_CELL] = { .name = "bd96801-wdt", },
+	[REGULATOR_CELL] = { .name = "bd96805-regulator", },
+};
 
 static const struct regmap_range bd96801_volatile_ranges[] = {
 	/* Status registers */
@@ -599,6 +603,20 @@ static const struct bd968xx bd96802_data = {
 	.unlock_val = BD96801_UNLOCK,
 };
 
+static const struct bd968xx bd96805_data = {
+	.errb_irqs = bd96801_reg_errb_irqs,
+	.intb_irqs = bd96801_reg_intb_irqs,
+	.num_errb_irqs = ARRAY_SIZE(bd96801_reg_errb_irqs),
+	.num_intb_irqs = ARRAY_SIZE(bd96801_reg_intb_irqs),
+	.errb_irq_chip = &bd96801_irq_chip_errb,
+	.intb_irq_chip = &bd96801_irq_chip_intb,
+	.regmap_config = &bd96801_regmap_config,
+	.cells = bd96805_cells,
+	.num_cells = ARRAY_SIZE(bd96805_cells),
+	.unlock_reg = BD96801_LOCK_REG,
+	.unlock_val = BD96801_UNLOCK,
+};
+
 static int bd96801_i2c_probe(struct i2c_client *i2c)
 {
 	struct regmap_irq_chip_data *intb_irq_data, *errb_irq_data;
@@ -621,6 +639,9 @@ static int bd96801_i2c_probe(struct i2c_client *i2c)
 	case ROHM_CHIP_TYPE_BD96802:
 		ddata = &bd96802_data;
 		break;
+	case ROHM_CHIP_TYPE_BD96805:
+		ddata = &bd96805_data;
+		break;
 	default:
 		dev_err(&i2c->dev, "Unknown IC\n");
 		return -EINVAL;
@@ -717,6 +738,7 @@ static int bd96801_i2c_probe(struct i2c_client *i2c)
 static const struct of_device_id bd96801_of_match[] = {
 	{ .compatible = "rohm,bd96801", .data = (void *)ROHM_CHIP_TYPE_BD96801 },
 	{ .compatible = "rohm,bd96802", .data = (void *)ROHM_CHIP_TYPE_BD96802 },
+	{ .compatible = "rohm,bd96805", .data = (void *)ROHM_CHIP_TYPE_BD96805 },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, bd96801_of_match);
diff --git a/include/linux/mfd/rohm-generic.h b/include/linux/mfd/rohm-generic.h
index 11b86f9129e3..867acf5baefc 100644
--- a/include/linux/mfd/rohm-generic.h
+++ b/include/linux/mfd/rohm-generic.h
@@ -18,6 +18,7 @@ enum rohm_chip_type {
 	ROHM_CHIP_TYPE_BD71847,
 	ROHM_CHIP_TYPE_BD96801,
 	ROHM_CHIP_TYPE_BD96802,
+	ROHM_CHIP_TYPE_BD96805,
 	ROHM_CHIP_TYPE_AMOUNT
 };
 
-- 
2.49.0


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

  parent reply	other threads:[~2025-04-08  8:46 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-08  8:40 [PATCH v3 00/14] Support ROHM Scalable PMIC family Matti Vaittinen
2025-04-08  8:40 ` [PATCH v3 01/14] dt-bindings: regulator: Add ROHM BD96802 PMIC Matti Vaittinen
2025-04-08 16:16   ` Conor Dooley
2025-04-09  4:30     ` Matti Vaittinen
2025-04-09  5:43       ` Matti Vaittinen
2025-04-08  8:40 ` [PATCH v3 02/14] dt-bindings: mfd: " Matti Vaittinen
2025-04-08 16:11   ` Conor Dooley
2025-04-08  8:41 ` [PATCH v3 03/14] dt-bindings: mfd: bd96801: Add ROHM BD96805 Matti Vaittinen
2025-04-08  8:44 ` [PATCH v3 04/14] dt-bindings: mfd: bd96802: Add ROHM BD96806 Matti Vaittinen
2025-04-08 16:09   ` Conor Dooley
2025-04-08  8:44 ` [PATCH v3 05/14] mfd: rohm-bd96801: Add chip info Matti Vaittinen
2025-04-08  8:45 ` [PATCH v3 06/14] mfd: bd96801: Drop IC name from the regulator IRQ resources Matti Vaittinen
2025-04-08  8:45 ` [PATCH v3 07/14] regulator: bd96801: Drop IC name from the " Matti Vaittinen
2025-04-08 20:19   ` Mark Brown
2025-04-08  8:45 ` [PATCH v3 08/14] mfd: rohm-bd96801: Support ROHM BD96802 Matti Vaittinen
2025-04-08  8:46 ` [PATCH v3 09/14] regulator: bd96801: " Matti Vaittinen
2025-04-08 20:19   ` Mark Brown
2025-04-08  8:46 ` Matti Vaittinen [this message]
2025-04-08  8:46 ` [PATCH v3 11/14] regulator: bd96801: Support ROHM BD96805 PMIC Matti Vaittinen
2025-04-08  8:47 ` [PATCH v3 12/14] mfd: bd96801: Support ROHM BD96806 Matti Vaittinen
2025-04-08  8:47 ` [PATCH v3 13/14] regulator: bd96801: Support ROHM BD96806 PMIC Matti Vaittinen
2025-04-08  8:47 ` [PATCH v3 14/14] MAINTAINERS: Add BD96802 specific header Matti Vaittinen
2025-04-10  7:58 ` [PATCH v3 00/14] Support ROHM Scalable PMIC family Lee Jones
2025-04-10  8:12   ` Matti Vaittinen
2025-04-24 13:58 ` Lee Jones
2025-04-24 13:59   ` Lee Jones
2025-05-02  7:47 ` [GIT PULL] Immutable branch between MFD and Regulator due for the v6.16 merge window Lee Jones
2025-05-02 23:25   ` Mark Brown
2025-05-06  5:28     ` Matti Vaittinen
2025-05-06 14:10       ` Mark Brown
2025-05-06 14:29         ` Matti Vaittinen
2025-05-07 10:33     ` Lee Jones
2025-05-07 10:36       ` Lee Jones

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=8680097dc083f191bea56d3ac7c6fe5c005644ec.1744090658.git.mazziesaccount@gmail.com \
    --to=mazziesaccount@gmail.com \
    --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=linux-kernel@vger.kernel.org \
    --cc=matti.vaittinen@fi.rohmeurope.com \
    --cc=robh@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

all inboxes | Powered by JetHome®