Re: [PATCH 1/2] dt-bindings: input: gpio-keys: add pinctrl states

From: Kendall Willis

Date: Fri Sep 25 2026 - 11:58:30 EST


On 11:48-20260915, Kendall Willis wrote:
> On 12:13-20260914, Krzysztof Kozlowski wrote:
> > On Sat, Sep 12, 2026 at 04:33:53PM -0500, Kendall Willis wrote:
> > > Document pinctrl properties on the gpio-keys device node. By using the
> > > wakeup pinctrl state, the pins are able to wakeup the system from a
> > > low-power state. The default pinctrl state describes the default pin
> > > configuration.
> > >
> > > Signed-off-by: Kendall Willis <k-willis@xxxxxx>
> > > ---
> > > Documentation/devicetree/bindings/input/gpio-keys.yaml | 16 ++++++++++++++++
> > > 1 file changed, 16 insertions(+)
> > >
> > > diff --git a/Documentation/devicetree/bindings/input/gpio-keys.yaml b/Documentation/devicetree/bindings/input/gpio-keys.yaml
> > > index cc78c2152921308fe0cad3e29ca78a5fad08f066..b554933e93412d8b6c2ec401dc1e1eeff57d4190 100644
> > > --- a/Documentation/devicetree/bindings/input/gpio-keys.yaml
> > > +++ b/Documentation/devicetree/bindings/input/gpio-keys.yaml
> > > @@ -22,6 +22,22 @@ properties:
> > >
> > > poll-interval: true
> > >
> > > + pinctrl-0:
> > > + description: Default pinctrl state
> > > +
> > > + pinctrl-1:
> > > + description: Wakeup pinctrl state
> > > +
> > > + pinctrl-names:
> > > + description:
> > > + When present should contain at least "default" describing the default pin
> > > + states. The second state called "wakeup" describes the pins in their
> > > + wakeup configuration required to exit sleep states.
> > > + minItems: 1
> > > + items:
> > > + - const: default
> > > + - const: wakeup
> >
> > This will introduce new warnings, which should be being fixed in this
> > patchset (e.g. at91-kizbox3-hs.dts).
> >
>
> Will fix the binding to work with current device trees.

I looked into this more, and the only DTS that I could find that uses
more than one pinctrl is at91-kizbox3-hs.dts. I am not able to add the
wakeup pinctrl state and allow endless pinctrls and constrain the first
pinctrl to be the default state, so I will send v2 of this series
without allowing many default pinctrl states.

When I looked at at91-kizbox3-hs.dts it looks like all the pinctrls
could be consolidated to pinctrl-0 since none of the pins overlap. I can
send a patch consolidating it so that if these bindings do get picked,
that device tree is fixed so no more warnings are generated. It does
look like a bug anyways for there to be multiple default pinctrls since
pinctrl would only configure the first default pinctrl state, and the
others would not be touched.

Best,
Kendall

>
> > But nevertheless, isn't second state the sleep state? How can you
> > configure pins for the wakeup state - like being in the wakeup? You
> > configure the pins for given state, which will be a system suspend, so
> > sleep?
> >
>
> The sleep state usually refers to putting the pins in a state to save
> power. The wakeup pinctrl state is for putting the pins in a state to
> allow wakeup from suspend for that device. Both 'sleep' and 'wakeup'
> are for system suspend, but they fill different functions. The CAN
> subsystem also uses the 'wakeup' state in addition to the 'sleep' state
> [1].
>
> [1] https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/net/can/bosch%2Cm_can.yaml#L121
>
> Best,
> Kendall