mbox series

[v2,0/4] pinctrl: qcom: Add support for SM8550

Message ID 20221123152001.694546-1-abel.vesa@linaro.org
Headers show
Series pinctrl: qcom: Add support for SM8550 | expand

Message

Abel Vesa Nov. 23, 2022, 3:19 p.m. UTC
This patchset adds pinctrl support for the new Qualcomm SM8550 SoC,
One thing needed by SM8550 is the I2C specific pull feature.

To: Andy Gross <agross@kernel.org>
To: Bjorn Andersson <andersson@kernel.org>
To: Konrad Dybcio <konrad.dybcio@linaro.org>
To: Linus Walleij <linus.walleij@linaro.org>
To: Rob Herring <robh+dt@kernel.org>
To: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
Cc: linux-arm-msm@vger.kernel.org
Cc: linux-gpio@vger.kernel.org
Cc: devicetree@vger.kernel.org
Cc: linux-kernel@vger.kernel.org

Abel Vesa (2):
  dt-bindings: pinctrl: qcom: Add SM8550 pinctrl
  pinctrl: qcom: Add SM8550 pinctrl driver

Neil Armstrong (2):
  dt-bindings: pinctrl: qcom,tlmm-common: document i2c pull property
  pinctrl: qcom: add support for i2c specific pull feature

 .../bindings/pinctrl/qcom,sm8550-tlmm.yaml    |  163 ++
 .../bindings/pinctrl/qcom,tlmm-common.yaml    |    3 +
 drivers/pinctrl/qcom/Kconfig                  |   10 +
 drivers/pinctrl/qcom/Makefile                 |    1 +
 drivers/pinctrl/qcom/pinctrl-msm.c            |   20 +
 drivers/pinctrl/qcom/pinctrl-msm.h            |    1 +
 drivers/pinctrl/qcom/pinctrl-sm8550.c         | 1790 +++++++++++++++++
 7 files changed, 1988 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/qcom,sm8550-tlmm.yaml
 create mode 100644 drivers/pinctrl/qcom/pinctrl-sm8550.c

Comments

Krzysztof Kozlowski Nov. 24, 2022, 9:57 a.m. UTC | #1
On 23/11/2022 16:19, Abel Vesa wrote:
> Add device tree binding Documentation details for Qualcomm SM8550
> TLMM device
> 
> Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
> ---
> 
> Changes since v1:
>  * based on recent bindings, like Krzysztof asked
>  * changed gpio-line-names maxItems to 210
>  * moved required and additionalProperties below
>  * dropped *-hog since there are no such nodes yet on SM8550
>  * switch to double quotes everywhere
>  * dropped qcom,i2c-pull
>  * dropped if clause for ^gpio*
>  * added tlmm label
> 


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof
Krzysztof Kozlowski Nov. 24, 2022, 9:58 a.m. UTC | #2
On 23/11/2022 16:19, Abel Vesa wrote:
> From: Neil Armstrong <neil.armstrong@linaro.org>
> 
> Document the new i2c_pull property introduced for SM8550 setting
> an I2C specific pull mode on I2C able pins.
> 
> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
> Signed-off-by: Abel Vesa <abel.vesa@linaro.org>

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof
Linus Walleij Nov. 24, 2022, 1:11 p.m. UTC | #3
On Wed, Nov 23, 2022 at 4:20 PM Abel Vesa <abel.vesa@linaro.org> wrote:

> From: Neil Armstrong <neil.armstrong@linaro.org>
>
> Document the new i2c_pull property introduced for SM8550 setting
> an I2C specific pull mode on I2C able pins.
>
> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
> Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
(...)
> +      qcom,i2c-pull:
> +        type: boolean
> +        description: enable bias pull feature designed for I2C on pin

But what is this?

I2C buses are usually just plain old bias-high-impedance, high-z
or open drain, wire-or or whatever you want to call it.

But now there is some special i2c mode, huh?

The description is pretty much "it is what it is"... can we have
some explanation about what this means electrically speaking
and why you cannot use bias-high-impedance?

Yours,
Linus Walleij
Neil Armstrong Nov. 24, 2022, 1:24 p.m. UTC | #4
Hi Linus,

On 24/11/2022 14:11, Linus Walleij wrote:
> On Wed, Nov 23, 2022 at 4:20 PM Abel Vesa <abel.vesa@linaro.org> wrote:
> 
>> From: Neil Armstrong <neil.armstrong@linaro.org>
>>
>> Document the new i2c_pull property introduced for SM8550 setting
>> an I2C specific pull mode on I2C able pins.
>>
>> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
>> Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
> (...)
>> +      qcom,i2c-pull:
>> +        type: boolean
>> +        description: enable bias pull feature designed for I2C on pin
> 
> But what is this?
> 
> I2C buses are usually just plain old bias-high-impedance, high-z
> or open drain, wire-or or whatever you want to call it.
> 
> But now there is some special i2c mode, huh?
> 
> The description is pretty much "it is what it is"... can we have
> some explanation about what this means electrically speaking
> and why you cannot use bias-high-impedance?

I'll try to get some more info, but so far I only found what I wrote in the bindings.

Neil

> 
> Yours,
> Linus Walleij
Linus Walleij Nov. 25, 2022, 9:47 a.m. UTC | #5
On Thu, Nov 24, 2022 at 2:24 PM Neil Armstrong
<neil.armstrong@linaro.org> wrote:
> On 24/11/2022 14:11, Linus Walleij wrote:
> > On Wed, Nov 23, 2022 at 4:20 PM Abel Vesa <abel.vesa@linaro.org> wrote:
> >
> >> From: Neil Armstrong <neil.armstrong@linaro.org>
> >>
> >> Document the new i2c_pull property introduced for SM8550 setting
> >> an I2C specific pull mode on I2C able pins.
> >>
> >> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
> >> Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
> > (...)
> >> +      qcom,i2c-pull:
> >> +        type: boolean
> >> +        description: enable bias pull feature designed for I2C on pin
> >
> > But what is this?
> >
> > I2C buses are usually just plain old bias-high-impedance, high-z
> > or open drain, wire-or or whatever you want to call it.
> >
> > But now there is some special i2c mode, huh?
> >
> > The description is pretty much "it is what it is"... can we have
> > some explanation about what this means electrically speaking
> > and why you cannot use bias-high-impedance?
>
> I'll try to get some more info, but so far I only found what I wrote in the bindings.

Björn: can you see if you can get some clarity about the i2c
bias thing?

Yours,
Linus Walleij
Neil Armstrong Nov. 25, 2022, 12:40 p.m. UTC | #6
On 25/11/2022 10:47, Linus Walleij wrote:
> On Thu, Nov 24, 2022 at 2:24 PM Neil Armstrong
> <neil.armstrong@linaro.org> wrote:
>> On 24/11/2022 14:11, Linus Walleij wrote:
>>> On Wed, Nov 23, 2022 at 4:20 PM Abel Vesa <abel.vesa@linaro.org> wrote:
>>>
>>>> From: Neil Armstrong <neil.armstrong@linaro.org>
>>>>
>>>> Document the new i2c_pull property introduced for SM8550 setting
>>>> an I2C specific pull mode on I2C able pins.
>>>>
>>>> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
>>>> Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
>>> (...)
>>>> +      qcom,i2c-pull:
>>>> +        type: boolean
>>>> +        description: enable bias pull feature designed for I2C on pin
>>>
>>> But what is this?
>>>
>>> I2C buses are usually just plain old bias-high-impedance, high-z
>>> or open drain, wire-or or whatever you want to call it.
>>>
>>> But now there is some special i2c mode, huh?
>>>
>>> The description is pretty much "it is what it is"... can we have
>>> some explanation about what this means electrically speaking
>>> and why you cannot use bias-high-impedance?
>>
>> I'll try to get some more info, but so far I only found what I wrote in the bindings.
> 
> Björn: can you see if you can get some clarity about the i2c
> bias thing?

As I understood, it enables an "I2C resistor" on the pin, removing the need
of an external pull-up resistor on the line.

I assume the classical pull-up bias is not strong enough to replace an actual
resistor on the PCB.

Neil

> 
> Yours,
> Linus Walleij
Neil Armstrong Nov. 29, 2022, 8:15 a.m. UTC | #7
Hi Linus,

On 26/11/2022 22:53, Linus Walleij wrote:
> On Fri, Nov 25, 2022 at 1:40 PM <neil.armstrong@linaro.org> wrote:
> 
>> As I understood, it enables an "I2C resistor" on the pin, removing the need
>> of an external pull-up resistor on the line.
>>
>> I assume the classical pull-up bias is not strong enough to replace an actual
>> resistor on the PCB.
> 
> In that case I think this should be an argument to bias-pull-up like:
> 
> bias-pull-up = <360000>;
> 
> Nominally the pull up is in ohms:
> 
>    bias-pull-up:
>      oneOf:
>        - type: boolean
>        - $ref: /schemas/types.yaml#/definitions/uint32
>      description: pull up the pin. Takes as optional argument on hardware
>        supporting it the pull strength in Ohm.
> 
> Then the driver can choose to shunt in this extra I2C resistance
> from the resistance passed as argument. So no special property
> is needed, provided you can get an idea about the resistance
> provided here.

I like this alternative, I'll try to figure out if we can find a value
to match against.

Thanks,
Neil

> 
> Yours,
> Linus Walleij
Bjorn Andersson Dec. 15, 2022, 8:49 p.m. UTC | #8
On Tue, Nov 29, 2022 at 09:15:02AM +0100, Neil Armstrong wrote:
> Hi Linus,
> 
> On 26/11/2022 22:53, Linus Walleij wrote:
> > On Fri, Nov 25, 2022 at 1:40 PM <neil.armstrong@linaro.org> wrote:
> > 
> > > As I understood, it enables an "I2C resistor" on the pin, removing the need
> > > of an external pull-up resistor on the line.
> > > 
> > > I assume the classical pull-up bias is not strong enough to replace an actual
> > > resistor on the PCB.

That is correct.

> > 
> > In that case I think this should be an argument to bias-pull-up like:
> > 
> > bias-pull-up = <360000>;
> > 
> > Nominally the pull up is in ohms:
> > 
> >    bias-pull-up:
> >      oneOf:
> >        - type: boolean
> >        - $ref: /schemas/types.yaml#/definitions/uint32
> >      description: pull up the pin. Takes as optional argument on hardware
> >        supporting it the pull strength in Ohm.
> > 
> > Then the driver can choose to shunt in this extra I2C resistance
> > from the resistance passed as argument. So no special property
> > is needed, provided you can get an idea about the resistance
> > provided here.
> 
> I like this alternative, I'll try to figure out if we can find a value
> to match against.
> 

The typical value for this resistor is 2.2kOhm.

Regards,
Bjorn