2024-04-08 17:14:18

by Luca Weiss

[permalink] [raw]
Subject: [PATCH 0/2] Allow gpio-hog nodes in qcom,pmic-gpio bindings (& dt fixup)

Resolve the dt validation failure on Nexus 5.

Signed-off-by: Luca Weiss <[email protected]>
---
Luca Weiss (2):
dt-bindings: pinctrl: qcom,pmic-gpio: Allow gpio-hog nodes
ARM: dts: qcom: msm8974-hammerhead: Update gpio hog node name

.../devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml | 12 ++++++++++++
.../arm/boot/dts/qcom/qcom-msm8974-lge-nexus5-hammerhead.dts | 2 +-
2 files changed, 13 insertions(+), 1 deletion(-)
---
base-commit: 8568bb2ccc278f344e6ac44af6ed010a90aa88dc
change-id: 20240408-qcom-pmic-gpio-hog-2b4c5f103126

Best regards,
--
Luca Weiss <[email protected]>



2024-04-08 17:14:25

by Luca Weiss

[permalink] [raw]
Subject: [PATCH 1/2] dt-bindings: pinctrl: qcom,pmic-gpio: Allow gpio-hog nodes

Allow specifying a GPIO hog, as already used on
qcom-msm8974-lge-nexus5-hammerhead.dts.

Signed-off-by: Luca Weiss <[email protected]>
---
.../devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml
index a786357ed1af..510a05369dbb 100644
--- a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml
+++ b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml
@@ -424,6 +424,10 @@ patternProperties:
$ref: "#/$defs/qcom-pmic-gpio-state"
additionalProperties: false

+ "^(hog-[0-9]+|.+-hog(-[0-9]+)?)$":
+ required:
+ - gpio-hog
+
$defs:
qcom-pmic-gpio-state:
type: object
@@ -571,6 +575,7 @@ $defs:

examples:
- |
+ #include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>

pm8921_gpio: gpio@150 {
@@ -594,5 +599,12 @@ examples:
power-source = <PM8921_GPIO_S4>;
};
};
+
+ otg-hog {
+ gpio-hog;
+ gpios = <35 GPIO_ACTIVE_HIGH>;
+ output-high;
+ line-name = "otg-gpio";
+ };
};
...

--
2.44.0


2024-04-08 17:27:42

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH 1/2] dt-bindings: pinctrl: qcom,pmic-gpio: Allow gpio-hog nodes



On 4/8/24 18:39, Luca Weiss wrote:
> Allow specifying a GPIO hog, as already used on
> qcom-msm8974-lge-nexus5-hammerhead.dts.
>
> Signed-off-by: Luca Weiss <[email protected]>
> ---
> .../devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml
> index a786357ed1af..510a05369dbb 100644
> --- a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml
> +++ b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml
> @@ -424,6 +424,10 @@ patternProperties:
> $ref: "#/$defs/qcom-pmic-gpio-state"
> additionalProperties: false
>
> + "^(hog-[0-9]+|.+-hog(-[0-9]+)?)$":

I see a couple bindings do this, but I'm not sure if we want two
allow two styles for no reason.. Rob?

Konrad

2024-04-08 18:36:21

by Luca Weiss

[permalink] [raw]
Subject: Re: [PATCH 1/2] dt-bindings: pinctrl: qcom,pmic-gpio: Allow gpio-hog nodes

On Montag, 8. April 2024 19:26:49 CEST Konrad Dybcio wrote:
>
> On 4/8/24 18:39, Luca Weiss wrote:
> > Allow specifying a GPIO hog, as already used on
> > qcom-msm8974-lge-nexus5-hammerhead.dts.
> >
> > Signed-off-by: Luca Weiss <[email protected]>
> > ---
> > .../devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml | 12 ++++++++++++
> > 1 file changed, 12 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml
> > index a786357ed1af..510a05369dbb 100644
> > --- a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml
> > +++ b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml
> > @@ -424,6 +424,10 @@ patternProperties:
> > $ref: "#/$defs/qcom-pmic-gpio-state"
> > additionalProperties: false
> >
> > + "^(hog-[0-9]+|.+-hog(-[0-9]+)?)$":
>
> I see a couple bindings do this, but I'm not sure if we want two
> allow two styles for no reason.. Rob?

This regex is actually from the gpio-hog.yaml base
https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/gpio/gpio-hog.yaml#L23

Why it's made this way I cannot tell you, but I didn't want to 'artifically'
restrict the pattern for qcom,pmic-gpio.

>
> Konrad
>





2024-04-09 06:44:16

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 1/2] dt-bindings: pinctrl: qcom,pmic-gpio: Allow gpio-hog nodes

On 08/04/2024 20:36, Luca Weiss wrote:
> On Montag, 8. April 2024 19:26:49 CEST Konrad Dybcio wrote:
>>
>> On 4/8/24 18:39, Luca Weiss wrote:
>>> Allow specifying a GPIO hog, as already used on
>>> qcom-msm8974-lge-nexus5-hammerhead.dts.
>>>
>>> Signed-off-by: Luca Weiss <[email protected]>
>>> ---
>>> .../devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml | 12 ++++++++++++
>>> 1 file changed, 12 insertions(+)
>>>
>>> diff --git a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml
>>> index a786357ed1af..510a05369dbb 100644
>>> --- a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml
>>> +++ b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml
>>> @@ -424,6 +424,10 @@ patternProperties:
>>> $ref: "#/$defs/qcom-pmic-gpio-state"
>>> additionalProperties: false
>>>
>>> + "^(hog-[0-9]+|.+-hog(-[0-9]+)?)$":
>>
>> I see a couple bindings do this, but I'm not sure if we want two
>> allow two styles for no reason.. Rob?
>
> This regex is actually from the gpio-hog.yaml base
> https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/gpio/gpio-hog.yaml#L23
>
> Why it's made this way I cannot tell you, but I didn't want to 'artifically'
> restrict the pattern for qcom,pmic-gpio.

Use the same as in tlmm:
https://lore.kernel.org/linux-devicetree/[email protected]/

Best regards,
Krzysztof