* [PATCH v3 0/2] Input: gpio-keys - support wakeup pinctrl state
@ 2026-10-01 15:50 Kendall Willis
2026-10-01 15:50 ` [PATCH v3 1/2] dt-bindings: input: gpio-keys: add pinctrl states Kendall Willis
2026-10-01 15:50 ` [PATCH v3 2/2] Input: gpio-keys - support wakeup pinctrl state on suspend Kendall Willis
0 siblings, 2 replies; 10+ messages in thread
From: Kendall Willis @ 2026-10-01 15:50 UTC (permalink / raw)
To: Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: msp, s-kochidanadu, a-kaur, s-tripathi1, vishalm, k-willis,
linux-input, linux-kernel, devicetree
Add 'wakeup' pinctrl state to support separate pin wakeup
configurations for GPIO. Upon suspend the 'wakeup' pinctrl state is
chosen if it exists. On resume the 'default' pinctrl state is selected.
The 'wakeup' pinctrl state allows wakeup from low-power states if a
specific pin configuration is needed.
On TI K3 AM62 family of devices, the GPIO controller is turned off in
suspend to RAM states, so no interrupt can be received by the
controller. This prevents system wakeup from low-power states.
Alternatively, the pins can wakeup the system if a wakeup flag is set on
the pin by using pinctrl.
A corresponding device tree patch using the 'wakeup' pinctrl state can
be found under "arm64: dts: ti: k3-am62l3-evm: add wakeup-source for GPIO
button" [1].
Tested GPIO wakeup from suspend on AM62L EVM and AM62P EVM.
[1] https://lore.kernel.org/all/20260912-upstream-gpio-wakeup-dts-v1-1-2057d76c63aa@ti.com/
Signed-off-by: Kendall Willis <k-willis@ti.com>
---
Changes in v3:
- Propagate -EPROBE_DEFER from devm_pinctrl_get() in probe().
- Link to v2: https://lore.kernel.org/r/20260925-upstream-gpio-wakeup-v2-0-6c5533356246@ti.com
Changes in v2:
- Update gpio-keys dt bindings commit message for better explanation of
wakeup state.
- Fix error pathways for if switching to the "wakeup" pinctrl state
fails.
- Link to v1: https://lore.kernel.org/r/20260912-upstream-gpio-wakeup-v1-0-f0e12484b836@ti.com
---
Kendall Willis (2):
dt-bindings: input: gpio-keys: add pinctrl states
Input: gpio-keys - support wakeup pinctrl state on suspend
.../devicetree/bindings/input/gpio-keys.yaml | 16 +++++++++++++++
drivers/input/keyboard/gpio_keys.c | 24 ++++++++++++++++++++++
2 files changed, 40 insertions(+)
---
base-commit: 93f51579e7df248780214094418f205253383cc5
change-id: 20260904-upstream-gpio-wakeup-52a54080c948
Best regards,
--
Kendall Willis <k-willis@ti.com>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v3 1/2] dt-bindings: input: gpio-keys: add pinctrl states
2026-10-01 15:50 [PATCH v3 0/2] Input: gpio-keys - support wakeup pinctrl state Kendall Willis
@ 2026-10-01 15:50 ` Kendall Willis
2026-10-01 15:59 ` sashiko-bot
2026-10-01 20:01 ` Rob Herring (Arm)
2026-10-01 15:50 ` [PATCH v3 2/2] Input: gpio-keys - support wakeup pinctrl state on suspend Kendall Willis
1 sibling, 2 replies; 10+ messages in thread
From: Kendall Willis @ 2026-10-01 15:50 UTC (permalink / raw)
To: Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: msp, s-kochidanadu, a-kaur, s-tripathi1, vishalm, k-willis,
linux-input, linux-kernel, devicetree
Document pinctrl properties on the gpio-keys device node. The default
pinctrl state describes the default pin configuration. The wakeup state
configures pins to be able to wakeup the system from suspend if GPIO is a
wakeup source.
The pinctrl sleep state is not defined here despite being used to configure
pins for system suspend to save power. It is not defined since no
gpio-key device tree nodes utilize it. If the sleep state was added, a
device could use both the wakeup state and sleep state. The sleep state
would be entered upon suspend when wakeup is disabled for the device,
whereas the wakeup state would be entered upon suspend if wakeup is enabled
for the device. For now only the wakeup state is defined since it is
used specifically to enable pin configurations that can wakeup the
system from suspend.
Signed-off-by: Kendall Willis <k-willis@ti.com>
---
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..a0712fba45845e42ca63489354e0cae87de2143f 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 "wakeup" state describes the pin state used to wakeup the system
+ when wakeup is enabled and the system is suspended.
+ minItems: 1
+ items:
+ - const: default
+ - const: wakeup
+
patternProperties:
"^(button|event|key|switch|(button|event|key|switch)-[a-z0-9-]+|[a-z0-9-]+-(button|event|key|switch))$":
$ref: input.yaml#
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v3 2/2] Input: gpio-keys - support wakeup pinctrl state on suspend
2026-10-01 15:50 [PATCH v3 0/2] Input: gpio-keys - support wakeup pinctrl state Kendall Willis
2026-10-01 15:50 ` [PATCH v3 1/2] dt-bindings: input: gpio-keys: add pinctrl states Kendall Willis
@ 2026-10-01 15:50 ` Kendall Willis
2026-10-01 16:02 ` sashiko-bot
1 sibling, 1 reply; 10+ messages in thread
From: Kendall Willis @ 2026-10-01 15:50 UTC (permalink / raw)
To: Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: msp, s-kochidanadu, a-kaur, s-tripathi1, vishalm, k-willis,
linux-input, linux-kernel, devicetree
GPIO can be used as a wakeup source for TI K3 AM62 devices during
suspend to RAM states. The GPIO controller is powered off in these
states, so a wakeup enable flag must be set on the GPIO pin in the
pinctrl in order to allow wakeup.
If the device is wakeup enabled, select the wakeup pinctrl state on
suspend and restore the default pinctrl state on resume.
Signed-off-by: Kendall Willis <k-willis@ti.com>
---
drivers/input/keyboard/gpio_keys.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index 129fc4212a5ed126496b331ce626682d441c53bf..b95bc5bc65ffa643bac2dd5de242ae7e5986a848 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -28,6 +28,7 @@
#include <linux/of.h>
#include <linux/of_irq.h>
#include <linux/spinlock.h>
+#include <linux/pinctrl/consumer.h>
#include <dt-bindings/input/gpio-keys.h>
struct gpio_button_data {
@@ -60,6 +61,8 @@ struct gpio_keys_drvdata {
struct input_dev *input;
struct mutex disable_lock;
unsigned short *keymap;
+ struct pinctrl *pinctrl;
+ struct pinctrl_state *pinctrl_wakeup;
struct gpio_button_data data[];
};
@@ -884,6 +887,15 @@ static int gpio_keys_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, ddata);
input_set_drvdata(input, ddata);
+ ddata->pinctrl = devm_pinctrl_get(dev);
+ if (IS_ERR(ddata->pinctrl)) {
+ error = PTR_ERR(ddata->pinctrl);
+ if (error == -EPROBE_DEFER)
+ return error;
+ } else if (ddata->pinctrl) {
+ ddata->pinctrl_wakeup = pinctrl_lookup_state(ddata->pinctrl, "wakeup");
+ }
+
input->name = pdata->name ? : pdev->name;
input->phys = "gpio-keys/input0";
input->dev.parent = dev;
@@ -1010,6 +1022,12 @@ gpio_keys_enable_wakeup(struct gpio_keys_drvdata *ddata)
int error;
int i;
+ if (!IS_ERR_OR_NULL(ddata->pinctrl_wakeup)) {
+ error = pinctrl_select_state(ddata->pinctrl, ddata->pinctrl_wakeup);
+ if (error)
+ return error;
+ }
+
for (i = 0; i < ddata->pdata->nbuttons; i++) {
bdata = &ddata->data[i];
if (bdata->button->wakeup) {
@@ -1023,6 +1041,9 @@ gpio_keys_enable_wakeup(struct gpio_keys_drvdata *ddata)
return 0;
err_out:
+ if (!IS_ERR_OR_NULL(ddata->pinctrl_wakeup))
+ pinctrl_pm_select_default_state(ddata->input->dev.parent);
+
while (i--) {
bdata = &ddata->data[i];
if (bdata->button->wakeup)
@@ -1039,6 +1060,9 @@ gpio_keys_disable_wakeup(struct gpio_keys_drvdata *ddata)
struct gpio_button_data *bdata;
int i;
+ if (!IS_ERR_OR_NULL(ddata->pinctrl_wakeup))
+ pinctrl_pm_select_default_state(ddata->input->dev.parent);
+
for (i = 0; i < ddata->pdata->nbuttons; i++) {
bdata = &ddata->data[i];
bdata->suspended = false;
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v3 1/2] dt-bindings: input: gpio-keys: add pinctrl states
2026-10-01 15:50 ` [PATCH v3 1/2] dt-bindings: input: gpio-keys: add pinctrl states Kendall Willis
@ 2026-10-01 15:59 ` sashiko-bot
2026-10-01 16:11 ` Kendall Willis
2026-10-01 20:01 ` Rob Herring (Arm)
1 sibling, 1 reply; 10+ messages in thread
From: sashiko-bot @ 2026-10-01 15:59 UTC (permalink / raw)
To: Kendall Willis; +Cc: devicetree, dmitry.torokhov, robh, linux-input, conor+dt
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] dt-bindings: gpio-keys: pinctrl-names constraint breaks at91-kizbox3-hs.dts
--
commit 907856f3f65db782a0530ddca90b6bdcafcea767
Author: Kendall Willis <k-willis@ti.com>
dt-bindings: input: gpio-keys: add pinctrl states
This commit documents pinctrl properties on the gpio-keys device node. It
adds the default pinctrl state and a wakeup state to configure pins for
system suspend if GPIO is a wakeup source.
> diff --git a/Documentation/devicetree/bindings/input/gpio-keys.yaml b/Documentation/devicetree/bindings/input/gpio-keys.yaml
> index cc78c21529213..a0712fba45845 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 "wakeup" state describes the pin state used to wakeup the system
> + when wakeup is enabled and the system is suspended.
> + minItems: 1
> + items:
> + - const: default
> + - const: wakeup
[Severity: Medium]
Will this implicit maxItems constraint break validation for existing in-tree
device trees?
Looking at arch/arm/boot/dts/microchip/at91-kizbox3-hs.dts, there is an
existing gpio-keys node that defines 5 items in pinctrl-names:
gpio-keys {
compatible = "gpio-keys";
pinctrl-names = "default" , "default", "default",
"default", "default";
pinctrl-0 = <&pinctrl_key_gpio_default>;
pinctrl-1 = <&pinctrl_pio_rf &pinctrl_pio_wifi>;
...
}
Since the schema update limits the items list to exactly two specific
entries ("default" and "wakeup"), this will introduce a make dtbs_check
validation regression for the existing board. Should the schema accommodate
this existing usage, or should the board be updated in the same series?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261001-upstream-gpio-wakeup-v3-0-6f3bcde367a3@ti.com?part=1
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 2/2] Input: gpio-keys - support wakeup pinctrl state on suspend
2026-10-01 15:50 ` [PATCH v3 2/2] Input: gpio-keys - support wakeup pinctrl state on suspend Kendall Willis
@ 2026-10-01 16:02 ` sashiko-bot
2026-10-01 16:12 ` Kendall Willis
0 siblings, 1 reply; 10+ messages in thread
From: sashiko-bot @ 2026-10-01 16:02 UTC (permalink / raw)
To: Kendall Willis; +Cc: robh, conor+dt, devicetree, linux-input, dmitry.torokhov
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] input: gpio-keys: silent masking of pinctrl resource acquisition errors
--
commit f85782ff9c9eb4bfa803e47eea6427b48cb93f09
Author: Kendall Willis <k-willis@ti.com>
Input: gpio-keys - support wakeup pinctrl state on suspend
This commit adds support for selecting a wakeup pinctrl state during suspend
to RAM on TI K3 AM62 devices. It retrieves the pinctrl state using
devm_pinctrl_get() and looks up the wakeup state if the device is enabled.
> diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
> --- a/drivers/input/keyboard/gpio_keys.c
> +++ b/drivers/input/keyboard/gpio_keys.c
[ ... ]
> @@ -884,6 +887,15 @@ static int gpio_keys_probe(struct platform_device *pdev)
> platform_set_drvdata(pdev, ddata);
> input_set_drvdata(input, ddata);
>
> + ddata->pinctrl = devm_pinctrl_get(dev);
> + if (IS_ERR(ddata->pinctrl)) {
> + error = PTR_ERR(ddata->pinctrl);
> + if (error == -EPROBE_DEFER)
> + return error;
[Severity: Medium]
Does this code intentionally swallow all error codes from devm_pinctrl_get()
other than -EPROBE_DEFER?
If devm_pinctrl_get() fails for other reasons, such as a memory allocation
failure (-ENOMEM) or an invalid device tree configuration (-EINVAL), the
error is silently ignored. This allows the driver to probe successfully but
with silently broken wakeup functionality.
Should the error be returned for all failure cases to avoid masking resource
acquisition failures?
> + } else if (ddata->pinctrl) {
> + ddata->pinctrl_wakeup = pinctrl_lookup_state(ddata->pinctrl, "wakeup");
> + }
> +
> input->name = pdata->name ? : pdev->name;
> input->phys = "gpio-keys/input0";
> input->dev.parent = dev;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261001-upstream-gpio-wakeup-v3-0-6f3bcde367a3@ti.com?part=2
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 1/2] dt-bindings: input: gpio-keys: add pinctrl states
2026-10-01 15:59 ` sashiko-bot
@ 2026-10-01 16:11 ` Kendall Willis
0 siblings, 0 replies; 10+ messages in thread
From: Kendall Willis @ 2026-10-01 16:11 UTC (permalink / raw)
To: sashiko-reviews; +Cc: devicetree, dmitry.torokhov, robh, linux-input, conor+dt
On 15:59-20261001, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Medium] dt-bindings: gpio-keys: pinctrl-names constraint breaks at91-kizbox3-hs.dts
> --
>
> commit 907856f3f65db782a0530ddca90b6bdcafcea767
> Author: Kendall Willis <k-willis@ti.com>
>
> dt-bindings: input: gpio-keys: add pinctrl states
>
> This commit documents pinctrl properties on the gpio-keys device node. It
> adds the default pinctrl state and a wakeup state to configure pins for
> system suspend if GPIO is a wakeup source.
>
> > diff --git a/Documentation/devicetree/bindings/input/gpio-keys.yaml b/Documentation/devicetree/bindings/input/gpio-keys.yaml
> > index cc78c21529213..a0712fba45845 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 "wakeup" state describes the pin state used to wakeup the system
> > + when wakeup is enabled and the system is suspended.
> > + minItems: 1
> > + items:
> > + - const: default
> > + - const: wakeup
>
> [Severity: Medium]
> Will this implicit maxItems constraint break validation for existing in-tree
> device trees?
>
> Looking at arch/arm/boot/dts/microchip/at91-kizbox3-hs.dts, there is an
> existing gpio-keys node that defines 5 items in pinctrl-names:
>
> gpio-keys {
> compatible = "gpio-keys";
> pinctrl-names = "default" , "default", "default",
> "default", "default";
> pinctrl-0 = <&pinctrl_key_gpio_default>;
> pinctrl-1 = <&pinctrl_pio_rf &pinctrl_pio_wifi>;
> ...
> }
>
> Since the schema update limits the items list to exactly two specific
> entries ("default" and "wakeup"), this will introduce a make dtbs_check
> validation regression for the existing board. Should the schema accommodate
> this existing usage, or should the board be updated in the same series?
>
I already updated the arch/arm/boot/dts/microchip/at91-kizbox3-hs.dts
in another patch [1] to abide to these bindings since it is not standard
in the kernel to have multiple pinctrls with the same state.
[1] https://lore.kernel.org/all/20260928-gpio-dt-binding-fix-v1-1-552e4b324a36@ti.com/
Best,
Kendall
> --
> Sashiko AI review · https://sashiko.dev/#/patchset/20261001-upstream-gpio-wakeup-v3-0-6f3bcde367a3@ti.com?part=1
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 2/2] Input: gpio-keys - support wakeup pinctrl state on suspend
2026-10-01 16:02 ` sashiko-bot
@ 2026-10-01 16:12 ` Kendall Willis
2026-10-03 5:26 ` Dmitry Torokhov
0 siblings, 1 reply; 10+ messages in thread
From: Kendall Willis @ 2026-10-01 16:12 UTC (permalink / raw)
To: sashiko-reviews; +Cc: robh, conor+dt, devicetree, linux-input, dmitry.torokhov
On 16:02-20261001, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Medium] input: gpio-keys: silent masking of pinctrl resource acquisition errors
> --
>
> commit f85782ff9c9eb4bfa803e47eea6427b48cb93f09
> Author: Kendall Willis <k-willis@ti.com>
>
> Input: gpio-keys - support wakeup pinctrl state on suspend
>
> This commit adds support for selecting a wakeup pinctrl state during suspend
> to RAM on TI K3 AM62 devices. It retrieves the pinctrl state using
> devm_pinctrl_get() and looks up the wakeup state if the device is enabled.
>
> > diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
> > --- a/drivers/input/keyboard/gpio_keys.c
> > +++ b/drivers/input/keyboard/gpio_keys.c
>
> [ ... ]
>
> > @@ -884,6 +887,15 @@ static int gpio_keys_probe(struct platform_device *pdev)
> > platform_set_drvdata(pdev, ddata);
> > input_set_drvdata(input, ddata);
> >
> > + ddata->pinctrl = devm_pinctrl_get(dev);
> > + if (IS_ERR(ddata->pinctrl)) {
> > + error = PTR_ERR(ddata->pinctrl);
> > + if (error == -EPROBE_DEFER)
> > + return error;
>
> [Severity: Medium]
> Does this code intentionally swallow all error codes from devm_pinctrl_get()
> other than -EPROBE_DEFER?
>
> If devm_pinctrl_get() fails for other reasons, such as a memory allocation
> failure (-ENOMEM) or an invalid device tree configuration (-EINVAL), the
> error is silently ignored. This allows the driver to probe successfully but
> with silently broken wakeup functionality.
>
> Should the error be returned for all failure cases to avoid masking resource
> acquisition failures?
Pinctrl is optional to use for gpio-keys so we only care if
-EPROBE_DEFER is the error from pinctrl which would mean that it just
has not been probed yet. All other errors can fall through and the
pinctrl_wakeup variable would be left as NULL.
Best,
Kendall
>
> > + } else if (ddata->pinctrl) {
> > + ddata->pinctrl_wakeup = pinctrl_lookup_state(ddata->pinctrl, "wakeup");
> > + }
> > +
> > input->name = pdata->name ? : pdev->name;
> > input->phys = "gpio-keys/input0";
> > input->dev.parent = dev;
>
> --
> Sashiko AI review · https://sashiko.dev/#/patchset/20261001-upstream-gpio-wakeup-v3-0-6f3bcde367a3@ti.com?part=2
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 1/2] dt-bindings: input: gpio-keys: add pinctrl states
2026-10-01 15:50 ` [PATCH v3 1/2] dt-bindings: input: gpio-keys: add pinctrl states Kendall Willis
2026-10-01 15:59 ` sashiko-bot
@ 2026-10-01 20:01 ` Rob Herring (Arm)
1 sibling, 0 replies; 10+ messages in thread
From: Rob Herring (Arm) @ 2026-10-01 20:01 UTC (permalink / raw)
To: Kendall Willis
Cc: Krzysztof Kozlowski, Conor Dooley, Dmitry Torokhov, msp,
s-tripathi1, vishalm, linux-input, a-kaur, s-kochidanadu,
devicetree, linux-kernel
On Thu, 01 Oct 2026 10:50:33 -0500, Kendall Willis wrote:
> Document pinctrl properties on the gpio-keys device node. The default
> pinctrl state describes the default pin configuration. The wakeup state
> configures pins to be able to wakeup the system from suspend if GPIO is a
> wakeup source.
>
> The pinctrl sleep state is not defined here despite being used to configure
> pins for system suspend to save power. It is not defined since no
> gpio-key device tree nodes utilize it. If the sleep state was added, a
> device could use both the wakeup state and sleep state. The sleep state
> would be entered upon suspend when wakeup is disabled for the device,
> whereas the wakeup state would be entered upon suspend if wakeup is enabled
> for the device. For now only the wakeup state is defined since it is
> used specifically to enable pin configurations that can wakeup the
> system from suspend.
>
> Signed-off-by: Kendall Willis <k-willis@ti.com>
> ---
> Documentation/devicetree/bindings/input/gpio-keys.yaml | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 2/2] Input: gpio-keys - support wakeup pinctrl state on suspend
2026-10-01 16:12 ` Kendall Willis
@ 2026-10-03 5:26 ` Dmitry Torokhov
2026-10-05 20:42 ` Kendall Willis
0 siblings, 1 reply; 10+ messages in thread
From: Dmitry Torokhov @ 2026-10-03 5:26 UTC (permalink / raw)
To: Kendall Willis; +Cc: sashiko-reviews, robh, conor+dt, devicetree, linux-input
Hi Kendall,
On Thu, Oct 01, 2026 at 11:12:31AM -0500, Kendall Willis wrote:
> Pinctrl is optional to use for gpio-keys so we only care if
> -EPROBE_DEFER is the error from pinctrl which would mean that it just
> has not been probed yet. All other errors can fall through and the
> pinctrl_wakeup variable would be left as NULL.
If pinctrl is not specified, devm_pinctrl_get() returns -ENODEV (or NULL
if !CONFIG_PINCTRL). Other errors (-ENOMEM, -EINVAL) indicate genuine
issues that should not be swallowed.
Please reset ddata->pinctrl to NULL, ignore -ENODEV, and propagate any
other errors:
ddata->pinctrl = devm_pinctrl_get(dev);
if (IS_ERR(ddata->pinctrl)) {
error = PTR_ERR(ddata->pinctrl);
ddata->pinctrl = NULL;
if (error != -ENODEV)
return dev_err_probe(dev, error,
"Failed to get pinctrl\n");
}
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3 2/2] Input: gpio-keys - support wakeup pinctrl state on suspend
2026-10-03 5:26 ` Dmitry Torokhov
@ 2026-10-05 20:42 ` Kendall Willis
0 siblings, 0 replies; 10+ messages in thread
From: Kendall Willis @ 2026-10-05 20:42 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: sashiko-reviews, robh, conor+dt, devicetree, linux-input
Hi Dmitry,
On 22:26-20261002, Dmitry Torokhov wrote:
> Hi Kendall,
>
> On Thu, Oct 01, 2026 at 11:12:31AM -0500, Kendall Willis wrote:
> > Pinctrl is optional to use for gpio-keys so we only care if
> > -EPROBE_DEFER is the error from pinctrl which would mean that it just
> > has not been probed yet. All other errors can fall through and the
> > pinctrl_wakeup variable would be left as NULL.
>
> If pinctrl is not specified, devm_pinctrl_get() returns -ENODEV (or NULL
> if !CONFIG_PINCTRL). Other errors (-ENOMEM, -EINVAL) indicate genuine
> issues that should not be swallowed.
>
> Please reset ddata->pinctrl to NULL, ignore -ENODEV, and propagate any
> other errors:
>
> ddata->pinctrl = devm_pinctrl_get(dev);
> if (IS_ERR(ddata->pinctrl)) {
> error = PTR_ERR(ddata->pinctrl);
> ddata->pinctrl = NULL;
>
> if (error != -ENODEV)
> return dev_err_probe(dev, error,
> "Failed to get pinctrl\n");
> }
>
> Thanks.
>
> --
> Dmitry
Will update the code to this in the next version. Thanks for pointing
this out.
Best,
Kendall
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2026-10-05 20:43 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-01 15:50 [PATCH v3 0/2] Input: gpio-keys - support wakeup pinctrl state Kendall Willis
2026-10-01 15:50 ` [PATCH v3 1/2] dt-bindings: input: gpio-keys: add pinctrl states Kendall Willis
2026-10-01 15:59 ` sashiko-bot
2026-10-01 16:11 ` Kendall Willis
2026-10-01 20:01 ` Rob Herring (Arm)
2026-10-01 15:50 ` [PATCH v3 2/2] Input: gpio-keys - support wakeup pinctrl state on suspend Kendall Willis
2026-10-01 16:02 ` sashiko-bot
2026-10-01 16:12 ` Kendall Willis
2026-10-03 5:26 ` Dmitry Torokhov
2026-10-05 20:42 ` Kendall Willis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox