mbox series

[v2,0/2] pinctl: qcom: Add SM4450 pinctrl driver

Message ID 20230915015808.18296-1-quic_tengfan@quicinc.com
Headers show
Series pinctl: qcom: Add SM4450 pinctrl driver | expand

Message

Tengfei Fan Sept. 15, 2023, 1:58 a.m. UTC
Add Sm4450 pinctrl driver for support enable uart console.

Signed-off-by: Tengfei Fan <quic_tengfan@quicinc.com>
---
v1 -> v2:
  - update right platform name
  - update gpio-reserved-ranges have right maxItems
  - update gpio-line-names have right maxItems
  - add min/maxItems for pins properties
  - redo dt_binding_check check
  - delete reserved gpios setting
  - combine separate pinctrl functions

previous discussion here:
[1] https://lore.kernel.org/linux-arm-msm/20230908063843.26835-1-quic_tengfan@quicinc.com/

Tengfei Fan (2):
  dt-bindings: pinctrl: qcom: Add SM4450 pinctrl
  pinctrl: qcom: Add SM4450 pinctrl driver

 .../bindings/pinctrl/qcom,sm4450-tlmm.yaml    |  132 +++
 drivers/pinctrl/qcom/Kconfig.msm              |    8 +
 drivers/pinctrl/qcom/Makefile                 |    1 +
 drivers/pinctrl/qcom/pinctrl-sm4450.c         | 1013 +++++++++++++++++
 4 files changed, 1154 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/qcom,sm4450-tlmm.yaml
 create mode 100644 drivers/pinctrl/qcom/pinctrl-sm4450.c


base-commit: 98897dc735cf6635f0966f76eb0108354168fb15

Comments

Tengfei Fan Sept. 15, 2023, 7:30 a.m. UTC | #1
在 9/15/2023 3:04 PM, Krzysztof Kozlowski 写道:
> On 15/09/2023 03:58, Tengfei Fan wrote:
>> Add device tree binding Documentation details for Qualcomm SM4450
>> TLMM device.
>>
>> Signed-off-by: Tengfei Fan <quic_tengfan@quicinc.com>
> 
> ...
> 
>> +
>> +patternProperties:
>> +  "-state$":
>> +    oneOf:
>> +      - $ref: "#/$defs/qcom-sm4450-tlmm-state"
>> +      - patternProperties:
>> +          "-pins$":
>> +            $ref: "#/$defs/qcom-sm4450-tlmm-state"
>> +        additionalProperties: false
>> +
>> +$defs:
>> +  qcom-sm4450-tlmm-state:
>> +    type: object
>> +    description:
>> +      Pinctrl node's client devices use subnodes for desired pin configuration.
>> +      Client device subnodes use below standard properties.
>> +    $ref: qcom,tlmm-common.yaml#/$defs/qcom-tlmm-state
>> +    unevaluatedProperties: false
>> +
>> +    properties:
>> +      pins:
>> +        description:
>> +          List of gpio pins affected by the properties specified in this
>> +          subnode.
>> +        items:
>> +          oneOf:
>> +            - pattern: "^gpio([0-9]|[1-9][0-9]|1[0-9][0-9])$"
> 
> This is still wrong. How many GPIOs do you have? Please open existing
> bindings for recent device (e.g. sm8550) and look how it is done there.
yes, will update to "^gpio([0-9]|[1-9][0-9]|1[0-2][0-5])$".
> 
> ...
> 
> 
>> +
>> +examples:
>> +  - |
>> +    #include <dt-bindings/interrupt-controller/arm-gic.h>
>> +    tlmm: pinctrl@f100000 {
>> +      compatible = "qcom,sm4450-tlmm";
>> +      reg = <0x0f100000 0x300000>;
>> +      gpio-controller;
>> +      #gpio-cells = <2>;
>> +      gpio-ranges = <&tlmm 0 0 137>;
>> +      interrupt-controller;
>> +      #interrupt-cells = <2>;
>> +      interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>;
> 
> Missing example pieces. Again, please base your work on other recent files.
yes, will reference other platform, and update
> 
>> +    };
>> +...
> 
> Best regards,
> Krzysztof
>
Tengfei Fan Sept. 18, 2023, 1:39 a.m. UTC | #2
在 9/15/2023 10:59 PM, Rob Herring 写道:
> On Fri, Sep 15, 2023 at 03:30:16PM +0800, Tengfei Fan wrote:
>>
>>
>> 在 9/15/2023 3:04 PM, Krzysztof Kozlowski 写道:
>>> On 15/09/2023 03:58, Tengfei Fan wrote:
>>>> Add device tree binding Documentation details for Qualcomm SM4450
>>>> TLMM device.
>>>>
>>>> Signed-off-by: Tengfei Fan <quic_tengfan@quicinc.com>
>>>
>>> ...
>>>
>>>> +
>>>> +patternProperties:
>>>> +  "-state$":
>>>> +    oneOf:
>>>> +      - $ref: "#/$defs/qcom-sm4450-tlmm-state"
>>>> +      - patternProperties:
>>>> +          "-pins$":
>>>> +            $ref: "#/$defs/qcom-sm4450-tlmm-state"
>>>> +        additionalProperties: false
>>>> +
>>>> +$defs:
>>>> +  qcom-sm4450-tlmm-state:
>>>> +    type: object
>>>> +    description:
>>>> +      Pinctrl node's client devices use subnodes for desired pin configuration.
>>>> +      Client device subnodes use below standard properties.
>>>> +    $ref: qcom,tlmm-common.yaml#/$defs/qcom-tlmm-state
>>>> +    unevaluatedProperties: false
>>>> +
>>>> +    properties:
>>>> +      pins:
>>>> +        description:
>>>> +          List of gpio pins affected by the properties specified in this
>>>> +          subnode.
>>>> +        items:
>>>> +          oneOf:
>>>> +            - pattern: "^gpio([0-9]|[1-9][0-9]|1[0-9][0-9])$"
>>>
>>> This is still wrong. How many GPIOs do you have? Please open existing
>>> bindings for recent device (e.g. sm8550) and look how it is done there.
>> yes, will update to "^gpio([0-9]|[1-9][0-9]|1[0-2][0-5])$".
> 
> What about 106, 116, etc.?
> 
> Rob
understand more, need "^gpio([0-9]|[1-9][0-9]|1[0-1][0-9]|12[0-5])$".