Skip to contentSkip to conversation

Utilize pinctrl-single for bcm7038-style chips

PATCH In review Florian Fainelli 3 participants 6 messages Apr 7 – Apr 9

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

cover Utilize pinctrl-single for bcm7038-style chips

This patch set allows Broadcom STB chips with the BCM7038-style pinmux/configuration blocks to use pinctrl-single. This does not preclude us from making use of a more sophisticated driver in the future, should we need to.

Florian Fainelli (2):
dt-bindings: pinctrl: pinctrl-single: Add brcm,bcm7038-padconf
pinctrl: single: Add bcm7038-padconf compatible matching

 .../devicetree/bindings/pinctrl/pinctrl-single.yaml          | 4 ++++
 drivers/pinctrl/pinctrl-single.c                             | 5 +++--
 2 files changed, 7 insertions(+), 2 deletions(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/2 dt-bindings: pinctrl: pinctrl-single: Add brcm,bcm7038-padconf

Add the "brcm,bcm7038-padconf" compatible to the pinctrl-single binding.

---
 Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml +4 -0
index 9135788cf62e..afe7329a1df2 100644
@@ -38,6 +38,10 @@ properties:
           - enum:
               - marvell,pxa1908-padconf
           - const: pinconf-single
+      - items:
+          - enum:
+              - brcm,bcm7038-padconf
+          - const: pinctrl-single
 
   reg:
     maxItems: 1
Signature · 1 line
2.34.1
Acked-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] dt-bindings: pinctrl: pinctrl-single: Add brcm,bcm7038-padconf

Quoted 12 lines · Florian Fainelli

Add the "brcm,bcm7038-padconf" compatible to the pinctrl-single binding.

---
 Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml +0 -0
index 9135788cf62e..afe7329a1df2 100644

Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml properties: · line 44

Quoted 7 lines
Documentation/devicetree/bindings/pinctrl/pinctrl-single.yaml +4 -0
@@ -38,6 +38,10 @@ properties:
           - enum:
               - marvell,pxa1908-padconf
           - const: pinconf-single
+      - items:
+          - enum:
+              - brcm,bcm7038-padconf
+          - const: pinctrl-single

If there is going to be a new version, entire block should be placed before 'ti' to have some sort of sorting by compatible.

But no need to resend just for that.

Best regards,
Krzysztof

#3 lore raw

PATCH 2/2 pinctrl: single: Add bcm7038-padconf compatible matching

In reply to Florian Fainelli

Just like the TI J7200 padconf, we lose the context and therefore need to save it and restore it across suspend/resume states.

---
 drivers/pinctrl/pinctrl-single.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/pinctrl/pinctrl-single.c +3 -2
index d85e6c1f6321..657b42caf811 100644
@@ -1960,7 +1960,7 @@ static const struct pcs_soc_data pinctrl_single_am654 = {
 	.irq_status_mask = (1 << 30),   /* WKUP_EVT */
 };
 
-static const struct pcs_soc_data pinctrl_single_j7200 = {
+static const struct pcs_soc_data pinctrl_single_loss_off = {
 	.flags = PCS_CONTEXT_LOSS_OFF,
 };
 
@@ -1972,6 +1972,7 @@ static const struct pcs_soc_data pinconf_single = {
 };
 
 static const struct of_device_id pcs_of_match[] = {
+	{ .compatible = "brcm,bcm7038-padconf", .data = &pinctrl_single_loss_off },
 	{ .compatible = "marvell,pxa1908-padconf", .data = &pinconf_single },
 	{ .compatible = "ti,am437-padconf", .data = &pinctrl_single_am437x },
 	{ .compatible = "ti,am654-padconf", .data = &pinctrl_single_am654 },
@@ -1979,7 +1980,7 @@ static const struct of_device_id pcs_of_match[] = {
 	{ .compatible = "ti,omap3-padconf", .data = &pinctrl_single_omap_wkup },
 	{ .compatible = "ti,omap4-padconf", .data = &pinctrl_single_omap_wkup },
 	{ .compatible = "ti,omap5-padconf", .data = &pinctrl_single_omap_wkup },
-	{ .compatible = "ti,j7200-padconf", .data = &pinctrl_single_j7200 },
+	{ .compatible = "ti,j7200-padconf", .data = &pinctrl_single_loss_off },
 	{ .compatible = "pinctrl-single", .data = &pinctrl_single },
 	{ .compatible = "pinconf-single", .data = &pinconf_single },
 	{ },
Signature · 1 line
2.34.1
maintainer
#4 lore raw
In reply to Florian Fainelli
Quoted 4 lines · Florian Fainelli

This patch set allows Broadcom STB chips with the BCM7038-style pinmux/configuration blocks to use pinctrl-single. This does not preclude us from making use of a more sophisticated driver in the future, should we need to.

OK that's one way to do it. I wonder if this approach also works for BCMBCA given Haojian's comments on my previous patch attempts.

drivers/pinctrl/bcm/pinctrl-bcm4908.c would then be phased over to pinctrl-single, or does the MSB/LSB register layout create a problem? If we always write 0 into MSB I guess we could just add some quirk...

Yours,
Linus Walleij

maintainer
#5 lore raw
In reply to Florian Fainelli
Quoted 4 lines · Florian Fainelli

This patch set allows Broadcom STB chips with the BCM7038-style pinmux/configuration blocks to use pinctrl-single. This does not preclude us from making use of a more sophisticated driver in the future, should we need to.

Patches applied for v7.1!

Yours,
Linus Walleij