Skip to contentSkip to conversation

mfd: Add ROHM BD71879

PATCH Applied Andreas Kemnade 5 participants 9 messages Apr 4, 2024 – Apr 11, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v2 cover mfd: Add ROHM BD71879

Add software-compatible variant of the BD71828.

Changes in v2:
allow compatible = "rohm,bd71879", "rohm,bd71828"

Andreas Kemnade (2):
dt-bindings: mfd: Add ROHM BD71879
mfd: rohm-bd71828: Add software-compatible variant BD71879

 .../devicetree/bindings/mfd/rohm,bd71828-pmic.yaml         | 7 ++++++-
 drivers/mfd/rohm-bd71828.c                                 | 4 ++++
 2 files changed, 10 insertions(+), 1 deletion(-)
Signature · 1 line
2.39.2
#1 lore raw

PATCH v2 1/2 dt-bindings: mfd: Add ROHM BD71879

As this chip was seen in several devices in the wild, add it.

---
 .../devicetree/bindings/mfd/rohm,bd71828-pmic.yaml         | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml +6 -1
index 0b62f854bf6b..07f99738fcf6 100644
@@ -17,7 +17,12 @@ description: |
 
 properties:
   compatible:
-    const: rohm,bd71828
+    oneOf:
+      - const: rohm,bd71828
+
+      - items:
+          - const: rohm,bd71879
+          - const: rohm,bd71828
 
   reg:
     description:
Signature · 1 line
2.39.2
Acked-by on v2 1/2
#2 lore raw

Re: [PATCH v2 1/2] dt-bindings: mfd: Add ROHM BD71879

Quoted 7 lines · Andreas Kemnade

As this chip was seen in several devices in the wild, add it.

---
 .../devicetree/bindings/mfd/rohm,bd71828-pmic.yaml         | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Best regards,
Krzysztof

maintainer
#3 lore raw

Re: [PATCH v2 1/2] dt-bindings: mfd: Add ROHM BD71879

In reply to Andreas Kemnade
Quoted 16 lines · Andreas Kemnade

As this chip was seen in several devices in the wild, add it.

---
  .../devicetree/bindings/mfd/rohm,bd71828-pmic.yaml         | 7 ++++++-
  1 file changed, 6 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml +0 -0
index 0b62f854bf6b..07f99738fcf6 100644
@@ -17,7 +17,12 @@ description: |
 
  properties:
    compatible:

Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml description: | · line 28

Quoted 10 lines
Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml +6 -1
-    const: rohm,bd71828
+    oneOf:
+      - const: rohm,bd71828
+
+      - items:
+          - const: rohm,bd71879
+          - const: rohm,bd71828
 
    reg:
      description:

Am I correct, this reads as:

Either

	compatible = rohm,bd71828
or
	compatible = rohm,bd71879, rohm,bd71828

but not compatible = rohm,bd71879?

If so, this looks ok to me. :)

Signature · 5 lines
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland

~~ When things go utterly wrong vim users can always type :help! ~~
#4 lore raw

Re: [PATCH v2 1/2] dt-bindings: mfd: Add ROHM BD71879

Quoted 28 lines · Matti Vaittinen
Quoted 14 lines · Andreas Kemnade

As this chip was seen in several devices in the wild, add it.

---
  .../devicetree/bindings/mfd/rohm,bd71828-pmic.yaml         | 7 ++++++-
  1 file changed, 6 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml +0 -0
index 0b62f854bf6b..07f99738fcf6 100644
@@ -17,7 +17,12 @@ description: |
  properties:

Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml description: | · line 26

Quoted 10 lines
Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml +6 -1
    compatible:
-    const: rohm,bd71828
+    oneOf:
+      - const: rohm,bd71828
+
+      - items:
+          - const: rohm,bd71879
+          - const: rohm,bd71828
    reg:
      description:

Am I correct, this reads as:

Quoted 6 lines

Either

	compatible = rohm,bd71828
or
	compatible = rohm,bd71879, rohm,bd71828

but not compatible = rohm,bd71879?

Correct.

maintainer Acked-by
#5 lore raw

Re: [PATCH v2 1/2] dt-bindings: mfd: Add ROHM BD71879

Quoted 29 lines · Conor Dooley
Quoted 28 lines · Matti Vaittinen
Quoted 14 lines · Andreas Kemnade

As this chip was seen in several devices in the wild, add it.

---
   .../devicetree/bindings/mfd/rohm,bd71828-pmic.yaml         | 7 ++++++-
   1 file changed, 6 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml +0 -0
index 0b62f854bf6b..07f99738fcf6 100644
@@ -17,7 +17,12 @@ description: |
   properties:

Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml description: | · line 26

Quoted 10 lines
Documentation/devicetree/bindings/mfd/rohm,bd71828-pmic.yaml +6 -1
     compatible:
-    const: rohm,bd71828
+    oneOf:
+      - const: rohm,bd71828
+
+      - items:
+          - const: rohm,bd71879
+          - const: rohm,bd71828
     reg:
       description:

Am I correct, this reads as:

Quoted 8 lines
Quoted 6 lines

Either

	compatible = rohm,bd71828
or
	compatible = rohm,bd71879, rohm,bd71828

but not compatible = rohm,bd71879?

Correct.

Thanks Conor!

I guess that if we later find out that there is a 'gizmo' in BD71828 which is not present on BD71879 - and if we write driver supporting this, then we need to have handling for both the BD71879 and BD71828 in this driver to ensure the fall-back wont happen. It's a bit ugly as I think the fall-back compatible should be used only in case where the "fall-back" HW can be guaranteed to have exactly same, or a subset of, features of the "full board".

Well, I've been told these are similar by HW colleagues. I have my doubts if 'similar' really is '_similar_', or if it's 'similar, except of course...' - but let's trust the HW guys on this. We have the above mentioned workaround if we should not have trusted...

Signature · 5 lines
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland

~~ When things go utterly wrong vim users can always type :help! ~~
maintainer Applied
#6 lore raw

Re: (subset) [PATCH v2 1/2] dt-bindings: mfd: Add ROHM BD71879

In reply to Andreas Kemnade
Quoted 3 lines · Andreas Kemnade

As this chip was seen in several devices in the wild, add it.

Applied, thanks!

[1/2] dt-bindings: mfd: Add ROHM BD71879

      commit: 9814ee9b64c06aae57c8a8f003014b3d90e09a3d

--
Lee Jones [李琼斯]

#7 lore raw

PATCH v2 2/2 mfd: rohm-bd71828: Add software-compatible variant BD71879

In reply to Andreas Kemnade

Add the BD71879 PMIC which is software-compatible to the BD71828, so reuse the same device_type enum.

---
 drivers/mfd/rohm-bd71828.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/mfd/rohm-bd71828.c +4 -0
index 4a1fa8a0d76a..f0b444690d4d 100644
@@ -585,6 +585,10 @@ static const struct of_device_id bd71828_of_match[] = {
 	{
 		.compatible = "rohm,bd71828",
 		.data = (void *)ROHM_CHIP_TYPE_BD71828,
+	}, {
+		.compatible = "rohm,bd71879",
+		/* equivalent from a software point of view */
+		.data = (void *)ROHM_CHIP_TYPE_BD71828,
 	}, {
 		.compatible = "rohm,bd71815",
 		.data = (void *)ROHM_CHIP_TYPE_BD71815,
Signature · 1 line
2.39.2
#8 lore raw

Re: [PATCH v2 2/2] mfd: rohm-bd71828: Add software-compatible variant BD71879

Quoted 7 lines · Andreas Kemnade

Add the BD71879 PMIC which is software-compatible to the BD71828, so reuse the same device_type enum.

---

Now you can drop this patch. The benefit of the compatibility is to drop this code.

Best regards,
Krzysztof