linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Gary Yang <gary.yang@cixtech.com>
Cc: Krzysztof Kozlowski <krzk@kernel.org>,
	"robh@kernel.org" <robh@kernel.org>,
	 "krzk+dt@kernel.org" <krzk+dt@kernel.org>,
	"conor+dt@kernel.org" <conor+dt@kernel.org>,
	 "linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	 "devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	 cix-kernel-upstream <cix-kernel-upstream@cixtech.com>
Subject: Re: 回复: [PATCH 2/3] dt-bindings: pinctrl: Add cix,sky1-pinctrl
Date: Thu, 28 Aug 2025 20:19:07 +0200	[thread overview]
Message-ID: <CACRpkdYC-3qybKW7VH5MVfBc3oqSrOa2RTt1Q=p=HHsi5drGOQ@mail.gmail.com> (raw)
In-Reply-To: <PUZPR06MB5887887C93BFF42BC8417D96EF3BA@PUZPR06MB5887.apcprd06.prod.outlook.com>

Hi Gary,

thanks for your patch!

On Thu, Aug 28, 2025 at 10:58 AM Gary Yang <gary.yang@cixtech.com> wrote:
> > On 28/08/2025 07:37, Gary Yang wrote:

> > >> Whats the difference between? You have entire description field to
> > >> explain this but instead you said something obvious there.
> > >>
> > > Cix sky1 has three power states. S0 means work state. S3 means STR state.
> > S5 means SD state.
> > >
> > > The pin-controller on sky1 has two power states. They are S0 and S5.
> >
> >
> > State != device. Please create bindings for devices, not states.
> >
>
> Sorry, maybe I didn't explain it correctly before, and then make you misunderstand
>
> There are two pin-controller on sky1. One is used under s0 state, other is used under s5 state.
>
> They are two devices

Just explain this in the description: and everyone will understand what
is going on. Since "S0" and "S5" can be easy to confuse for "states"
it is extra helpful with some extended descriptions.

> > >>> +    properties:
> > >>> +      cix,pins:
> > >>
> > >> No, use generic properties from pinmux schema.
> > >>
> > >> You should also reference it.
> > >
> > > Did you suggest us to refer to
> > Documentation/devicetree/bindings/pinctrl/pincfg-node.yaml?
> > >
> > > Make us support drive-strength, bias-pull-down properties?
> >
> > and pinmux. There is a standard pins property.
>
> Ok, I see, try our best to support standard

Unfortunately many pin controllers have forged ahead
with custom foo,pins = <....>; settings where they set up
mux and electrical config by OR:in together different bits,
and then they just poke this into some registers.

This isn't very helpful for users.

I initially wanted all functions and groups to be strings
and then to associate groups with functions using
strings in the device tree.

But I have realized (though much pain) that many developers
don't like this. They want a magic number to write to
a register to configure a pin, because their hardware
has one (or several) register for each pin.

So nowadays the most common is to use a compromise.

A magic number in the pinmux property to set up the muxing.

For example:

arch/arm/boot/dts/mediatek/mt7623.dtsi:
pinmux = <MT7623_PIN_75_SDA0_FUNC_SDA0>,
               <MT7623_PIN_76_SCL0_FUNC_SCL0>;

Then the electric properties like bias-pull-down; to set
these on the state:

        i2c0_pins_a: i2c0-default {
                pins-i2c0 {
                        pinmux = <MT7623_PIN_75_SDA0_FUNC_SDA0>,
                                 <MT7623_PIN_76_SCL0_FUNC_SCL0>;
                        bias-disable;
                };
        };

This is a good compromis becaus it looks similar on all
SoCs and you see immediately what is going on: we enable
SDA0 And SCL0 and disable bias, so there must be external
pull-up resistors on this bus since I2C is open drain. Very
easy for an electronics engineer to grasp, they don't need
to be computer engineers or device tree experts.

Yours,
Linus Walleij

  parent reply	other threads:[~2025-08-28 18:19 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-27  2:42 [PATCH 0/3] Add pinctrl support for Sky1 Gary Yang
2025-08-27  2:42 ` [PATCH 1/3] pinctrl: cix: Add pin-controller support for sky1 Gary Yang
2025-08-27  9:07   ` Krzysztof Kozlowski
2025-08-28  6:44     ` 回复: " Gary Yang
2025-08-28  6:49       ` Krzysztof Kozlowski
2025-08-28  8:32         ` 回复: " Gary Yang
2025-08-28 18:00           ` Krzysztof Kozlowski
2025-08-29  4:33             ` 回复: " Gary Yang
2025-08-29  6:21               ` Krzysztof Kozlowski
2025-08-29 10:18                 ` 回复: " Gary Yang
2025-08-29 10:35                   ` Krzysztof Kozlowski
2025-08-28 17:51     ` Linus Walleij
2025-08-28 18:02       ` Krzysztof Kozlowski
2025-08-28 21:03         ` Linus Walleij
2025-08-27  2:42 ` [PATCH 2/3] dt-bindings: pinctrl: Add cix,sky1-pinctrl Gary Yang
2025-08-27  8:22   ` Krzysztof Kozlowski
2025-08-28  5:37     ` 回复: " Gary Yang
2025-08-28  6:52       ` Krzysztof Kozlowski
2025-08-28  8:58         ` 回复: " Gary Yang
2025-08-28 18:04           ` Krzysztof Kozlowski
2025-08-28 18:19           ` Linus Walleij [this message]
2025-08-30 13:20             ` Gary Yang
2025-09-01 12:55               ` Linus Walleij
2025-09-02  2:08                 ` 回复: " Gary Yang
2025-08-28  7:25   ` Krzysztof Kozlowski
2025-08-28 18:27   ` Linus Walleij
2025-08-27  2:42 ` [PATCH 3/3] arm64: dts: cix: Add pinctrl nodes for sky1 Gary Yang
2025-08-27  8:23   ` Krzysztof Kozlowski
2025-08-28  6:14     ` 回复: " Gary Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACRpkdYC-3qybKW7VH5MVfBc3oqSrOa2RTt1Q=p=HHsi5drGOQ@mail.gmail.com' \
    --to=linus.walleij@linaro.org \
    --cc=cix-kernel-upstream@cixtech.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gary.yang@cixtech.com \
    --cc=krzk+dt@kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).