* [PATCH 0/2] Disable wakeup for resin keys by default
@ 2025-09-09 13:23 Luca Weiss
2025-09-09 13:23 ` [PATCH 1/2] dt-bindings: input: pm8941-pwrkey: Document wakeup-source property Luca Weiss
2025-09-09 13:23 ` [PATCH 2/2] Input: pm8941-pwrkey - Disable wakeup for resin by default Luca Weiss
0 siblings, 2 replies; 11+ messages in thread
From: Luca Weiss @ 2025-09-09 13:23 UTC (permalink / raw)
To: Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Courtney Cavin, Vinod Koul
Cc: Bhushan Shah, ~postmarketos/upstreaming, phone-devel,
linux-arm-msm, linux-input, devicetree, linux-kernel, Luca Weiss
'Resin' (*Res*et *In*put) on Qualcomm PMICs is usually connected to
volume down buttons on devices, which are usually not expected to wake
up the device from suspend.
On the other hand, pwrkey should keep wakeup on.
Note, that this does change behavior by turning off wakeup by default
for 'resin' and requiring a new dt property to be added to turn it on
again. But since this is not expected behavior in the first place, and
most users will not expect this, I'd argue this change is acceptable.
Signed-off-by: Luca Weiss <luca@lucaweiss.eu>
---
Luca Weiss (2):
dt-bindings: input: pm8941-pwrkey: Document wakeup-source property
Input: pm8941-pwrkey - Disable wakeup for resin by default
.../bindings/input/qcom,pm8941-pwrkey.yaml | 21 ++++++++++++++++++---
drivers/input/misc/pm8941-pwrkey.c | 12 ++++++++++--
2 files changed, 28 insertions(+), 5 deletions(-)
---
base-commit: 76eeb9b8de9880ca38696b2fb56ac45ac0a25c6c
change-id: 20250909-resin-wakeup-ebc77fe75b81
Best regards,
--
Luca Weiss <luca@lucaweiss.eu>
^ permalink raw reply [flat|nested] 11+ messages in thread* [PATCH 1/2] dt-bindings: input: pm8941-pwrkey: Document wakeup-source property 2025-09-09 13:23 [PATCH 0/2] Disable wakeup for resin keys by default Luca Weiss @ 2025-09-09 13:23 ` Luca Weiss 2025-09-09 14:02 ` Krzysztof Kozlowski 2025-09-09 13:23 ` [PATCH 2/2] Input: pm8941-pwrkey - Disable wakeup for resin by default Luca Weiss 1 sibling, 1 reply; 11+ messages in thread From: Luca Weiss @ 2025-09-09 13:23 UTC (permalink / raw) To: Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Courtney Cavin, Vinod Koul Cc: Bhushan Shah, ~postmarketos/upstreaming, phone-devel, linux-arm-msm, linux-input, devicetree, linux-kernel, Luca Weiss The 'resin' keys (usually connected to a volume-down button) are generally not supposed to wake up the device from suspend, so explicitly document a wakeup-source property to enable this wakeup behavior. For 'pwrkey' the default stays that pressing the button does wake up the device from suspend. Signed-off-by: Luca Weiss <luca@lucaweiss.eu> --- .../bindings/input/qcom,pm8941-pwrkey.yaml | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/input/qcom,pm8941-pwrkey.yaml b/Documentation/devicetree/bindings/input/qcom,pm8941-pwrkey.yaml index 62314a5fdce59bb00d1e8b86d6a29a091128aa50..62a08e675ef9511e0ae9ed9fbab5694ab7242c35 100644 --- a/Documentation/devicetree/bindings/input/qcom,pm8941-pwrkey.yaml +++ b/Documentation/devicetree/bindings/input/qcom,pm8941-pwrkey.yaml @@ -10,9 +10,6 @@ maintainers: - Courtney Cavin <courtney.cavin@sonymobile.com> - Vinod Koul <vkoul@kernel.org> -allOf: - - $ref: input.yaml# - properties: compatible: enum: @@ -36,6 +33,11 @@ properties: pin should be configured for pull up. $ref: /schemas/types.yaml#/definitions/flag + wakeup-source: + description: | + Button can wake-up the system. Only applicable for 'resin', + 'pwrkey' always wakes the system by default. + linux,code: description: | The input key-code associated with the power key. @@ -43,6 +45,19 @@ properties: include/dt-bindings/input/linux-event-codes.h When property is omitted KEY_POWER is assumed. +allOf: + - $ref: input.yaml# + - if: + properties: + compatible: + contains: + enum: + - qcom,pm8941-pwrkey + - qcom,pmk8350-pwrkey + then: + properties: + wakeup-source: false + required: - compatible - interrupts -- 2.51.0 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 1/2] dt-bindings: input: pm8941-pwrkey: Document wakeup-source property 2025-09-09 13:23 ` [PATCH 1/2] dt-bindings: input: pm8941-pwrkey: Document wakeup-source property Luca Weiss @ 2025-09-09 14:02 ` Krzysztof Kozlowski 2025-09-09 14:08 ` Dmitry Torokhov 0 siblings, 1 reply; 11+ messages in thread From: Krzysztof Kozlowski @ 2025-09-09 14:02 UTC (permalink / raw) To: Luca Weiss, Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Courtney Cavin, Vinod Koul Cc: Bhushan Shah, ~postmarketos/upstreaming, phone-devel, linux-arm-msm, linux-input, devicetree, linux-kernel On 09/09/2025 15:23, Luca Weiss wrote: > The 'resin' keys (usually connected to a volume-down button) are > generally not supposed to wake up the device from suspend, so explicitly > document a wakeup-source property to enable this wakeup behavior. > > For 'pwrkey' the default stays that pressing the button does wake up the > device from suspend. > > Signed-off-by: Luca Weiss <luca@lucaweiss.eu> > --- > .../bindings/input/qcom,pm8941-pwrkey.yaml | 21 ++++++++++++++++++--- > 1 file changed, 18 insertions(+), 3 deletions(-) > > diff --git a/Documentation/devicetree/bindings/input/qcom,pm8941-pwrkey.yaml b/Documentation/devicetree/bindings/input/qcom,pm8941-pwrkey.yaml > index 62314a5fdce59bb00d1e8b86d6a29a091128aa50..62a08e675ef9511e0ae9ed9fbab5694ab7242c35 100644 > --- a/Documentation/devicetree/bindings/input/qcom,pm8941-pwrkey.yaml > +++ b/Documentation/devicetree/bindings/input/qcom,pm8941-pwrkey.yaml > @@ -10,9 +10,6 @@ maintainers: > - Courtney Cavin <courtney.cavin@sonymobile.com> > - Vinod Koul <vkoul@kernel.org> > > -allOf: > - - $ref: input.yaml# > - > properties: > compatible: > enum: > @@ -36,6 +33,11 @@ properties: > pin should be configured for pull up. > $ref: /schemas/types.yaml#/definitions/flag > > + wakeup-source: > + description: | > + Button can wake-up the system. Only applicable for 'resin', > + 'pwrkey' always wakes the system by default. I'll fix existing code, so don't repeat that style. Best regards, Krzysztof ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/2] dt-bindings: input: pm8941-pwrkey: Document wakeup-source property 2025-09-09 14:02 ` Krzysztof Kozlowski @ 2025-09-09 14:08 ` Dmitry Torokhov 2025-09-09 14:33 ` Krzysztof Kozlowski 0 siblings, 1 reply; 11+ messages in thread From: Dmitry Torokhov @ 2025-09-09 14:08 UTC (permalink / raw) To: Krzysztof Kozlowski Cc: Luca Weiss, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Courtney Cavin, Vinod Koul, Bhushan Shah, ~postmarketos/upstreaming, phone-devel, linux-arm-msm, linux-input, devicetree, linux-kernel On Tue, Sep 09, 2025 at 04:02:47PM +0200, Krzysztof Kozlowski wrote: > On 09/09/2025 15:23, Luca Weiss wrote: > > The 'resin' keys (usually connected to a volume-down button) are > > generally not supposed to wake up the device from suspend, so explicitly > > document a wakeup-source property to enable this wakeup behavior. > > > > For 'pwrkey' the default stays that pressing the button does wake up the > > device from suspend. > > > > Signed-off-by: Luca Weiss <luca@lucaweiss.eu> > > --- > > .../bindings/input/qcom,pm8941-pwrkey.yaml | 21 ++++++++++++++++++--- > > 1 file changed, 18 insertions(+), 3 deletions(-) > > > > diff --git a/Documentation/devicetree/bindings/input/qcom,pm8941-pwrkey.yaml b/Documentation/devicetree/bindings/input/qcom,pm8941-pwrkey.yaml > > index 62314a5fdce59bb00d1e8b86d6a29a091128aa50..62a08e675ef9511e0ae9ed9fbab5694ab7242c35 100644 > > --- a/Documentation/devicetree/bindings/input/qcom,pm8941-pwrkey.yaml > > +++ b/Documentation/devicetree/bindings/input/qcom,pm8941-pwrkey.yaml > > @@ -10,9 +10,6 @@ maintainers: > > - Courtney Cavin <courtney.cavin@sonymobile.com> > > - Vinod Koul <vkoul@kernel.org> > > > > -allOf: > > - - $ref: input.yaml# > > - > > properties: > > compatible: > > enum: > > @@ -36,6 +33,11 @@ properties: > > pin should be configured for pull up. > > $ref: /schemas/types.yaml#/definitions/flag > > > > + wakeup-source: > > + description: | > > + Button can wake-up the system. Only applicable for 'resin', > > + 'pwrkey' always wakes the system by default. > > > I'll fix existing code, so don't repeat that style. If you ack I can reformat on my side to match the patch you just sent. Thanks. -- Dmitry ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/2] dt-bindings: input: pm8941-pwrkey: Document wakeup-source property 2025-09-09 14:08 ` Dmitry Torokhov @ 2025-09-09 14:33 ` Krzysztof Kozlowski 2025-09-09 14:41 ` Luca Weiss 0 siblings, 1 reply; 11+ messages in thread From: Krzysztof Kozlowski @ 2025-09-09 14:33 UTC (permalink / raw) To: Dmitry Torokhov Cc: Luca Weiss, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Courtney Cavin, Vinod Koul, Bhushan Shah, ~postmarketos/upstreaming, phone-devel, linux-arm-msm, linux-input, devicetree, linux-kernel On 09/09/2025 16:08, Dmitry Torokhov wrote: >>> compatible: >>> enum: >>> @@ -36,6 +33,11 @@ properties: >>> pin should be configured for pull up. >>> $ref: /schemas/types.yaml#/definitions/flag >>> >>> + wakeup-source: >>> + description: | >>> + Button can wake-up the system. Only applicable for 'resin', >>> + 'pwrkey' always wakes the system by default. >> >> >> I'll fix existing code, so don't repeat that style. > > If you ack I can reformat on my side to match the patch you just sent. Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Best regards, Krzysztof ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/2] dt-bindings: input: pm8941-pwrkey: Document wakeup-source property 2025-09-09 14:33 ` Krzysztof Kozlowski @ 2025-09-09 14:41 ` Luca Weiss 2025-09-09 14:54 ` Dmitry Torokhov 0 siblings, 1 reply; 11+ messages in thread From: Luca Weiss @ 2025-09-09 14:41 UTC (permalink / raw) To: Krzysztof Kozlowski, Dmitry Torokhov Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Courtney Cavin, Vinod Koul, Bhushan Shah, ~postmarketos/upstreaming, phone-devel, linux-arm-msm, linux-input, devicetree, linux-kernel On 2025-09-09 16:33, Krzysztof Kozlowski wrote: > On 09/09/2025 16:08, Dmitry Torokhov wrote: >>>> compatible: >>>> enum: >>>> @@ -36,6 +33,11 @@ properties: >>>> pin should be configured for pull up. >>>> $ref: /schemas/types.yaml#/definitions/flag >>>> >>>> + wakeup-source: >>>> + description: | >>>> + Button can wake-up the system. Only applicable for >>>> 'resin', >>>> + 'pwrkey' always wakes the system by default. >>> >>> >>> I'll fix existing code, so don't repeat that style. >> >> If you ack I can reformat on my side to match the patch you just sent. > > Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Thanks for fixing that up Krzysztof! I noticed but didn't want to deviate from the style just for this description. Of course better to fix the formatting in the first place. @Dmitry: Maybe give this patch some time (1-2 weeks?) to gather more feedback, given the reasons outlined in the cover letter. Also on the driver patch. Regards Luca > > Best regards, > Krzysztof ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/2] dt-bindings: input: pm8941-pwrkey: Document wakeup-source property 2025-09-09 14:41 ` Luca Weiss @ 2025-09-09 14:54 ` Dmitry Torokhov 2025-09-25 5:45 ` Dmitry Torokhov 0 siblings, 1 reply; 11+ messages in thread From: Dmitry Torokhov @ 2025-09-09 14:54 UTC (permalink / raw) To: Luca Weiss Cc: Krzysztof Kozlowski, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Courtney Cavin, Vinod Koul, Bhushan Shah, ~postmarketos/upstreaming, phone-devel, linux-arm-msm, linux-input, devicetree, linux-kernel On Tue, Sep 09, 2025 at 04:41:26PM +0200, Luca Weiss wrote: > On 2025-09-09 16:33, Krzysztof Kozlowski wrote: > > On 09/09/2025 16:08, Dmitry Torokhov wrote: > > > > > compatible: > > > > > enum: > > > > > @@ -36,6 +33,11 @@ properties: > > > > > pin should be configured for pull up. > > > > > $ref: /schemas/types.yaml#/definitions/flag > > > > > > > > > > + wakeup-source: > > > > > + description: | > > > > > + Button can wake-up the system. Only applicable > > > > > for 'resin', > > > > > + 'pwrkey' always wakes the system by default. > > > > > > > > > > > > I'll fix existing code, so don't repeat that style. > > > > > > If you ack I can reformat on my side to match the patch you just sent. > > > > Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> > > Thanks for fixing that up Krzysztof! I noticed but didn't want to deviate > from the style just for this description. Of course better to fix the > formatting in the first place. > > @Dmitry: Maybe give this patch some time (1-2 weeks?) to gather more > feedback, > given the reasons outlined in the cover letter. Also on the driver patch. OK, I'll hold on to this for a couple of weeks. Thanks. -- Dmitry ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/2] dt-bindings: input: pm8941-pwrkey: Document wakeup-source property 2025-09-09 14:54 ` Dmitry Torokhov @ 2025-09-25 5:45 ` Dmitry Torokhov 2025-09-29 15:44 ` Luca Weiss 0 siblings, 1 reply; 11+ messages in thread From: Dmitry Torokhov @ 2025-09-25 5:45 UTC (permalink / raw) To: Luca Weiss Cc: Krzysztof Kozlowski, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Courtney Cavin, Vinod Koul, Bhushan Shah, ~postmarketos/upstreaming, phone-devel, linux-arm-msm, linux-input, devicetree, linux-kernel On Tue, Sep 09, 2025 at 07:54:33AM -0700, Dmitry Torokhov wrote: > On Tue, Sep 09, 2025 at 04:41:26PM +0200, Luca Weiss wrote: > > On 2025-09-09 16:33, Krzysztof Kozlowski wrote: > > > On 09/09/2025 16:08, Dmitry Torokhov wrote: > > > > > > compatible: > > > > > > enum: > > > > > > @@ -36,6 +33,11 @@ properties: > > > > > > pin should be configured for pull up. > > > > > > $ref: /schemas/types.yaml#/definitions/flag > > > > > > > > > > > > + wakeup-source: > > > > > > + description: | > > > > > > + Button can wake-up the system. Only applicable > > > > > > for 'resin', > > > > > > + 'pwrkey' always wakes the system by default. > > > > > > > > > > > > > > > I'll fix existing code, so don't repeat that style. > > > > > > > > If you ack I can reformat on my side to match the patch you just sent. > > > > > > Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> > > > > Thanks for fixing that up Krzysztof! I noticed but didn't want to deviate > > from the style just for this description. Of course better to fix the > > formatting in the first place. > > > > @Dmitry: Maybe give this patch some time (1-2 weeks?) to gather more > > feedback, > > given the reasons outlined in the cover letter. Also on the driver patch. > > OK, I'll hold on to this for a couple of weeks. Nobody voiced any objections so far, so applied both. -- Dmitry ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/2] dt-bindings: input: pm8941-pwrkey: Document wakeup-source property 2025-09-25 5:45 ` Dmitry Torokhov @ 2025-09-29 15:44 ` Luca Weiss 0 siblings, 0 replies; 11+ messages in thread From: Luca Weiss @ 2025-09-29 15:44 UTC (permalink / raw) To: Dmitry Torokhov Cc: Krzysztof Kozlowski, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Courtney Cavin, Vinod Koul, Bhushan Shah, ~postmarketos/upstreaming, phone-devel, linux-arm-msm, linux-input, devicetree, linux-kernel On 25-09-25 7:45 atm, Dmitry Torokhov wrote: > On Tue, Sep 09, 2025 at 07:54:33AM -0700, Dmitry Torokhov wrote: >> On Tue, Sep 09, 2025 at 04:41:26PM +0200, Luca Weiss wrote: >>> On 2025-09-09 16:33, Krzysztof Kozlowski wrote: >>>> On 09/09/2025 16:08, Dmitry Torokhov wrote: >>>>>>> compatible: >>>>>>> enum: >>>>>>> @@ -36,6 +33,11 @@ properties: >>>>>>> pin should be configured for pull up. >>>>>>> $ref: /schemas/types.yaml#/definitions/flag >>>>>>> >>>>>>> + wakeup-source: >>>>>>> + description: | >>>>>>> + Button can wake-up the system. Only applicable >>>>>>> for 'resin', >>>>>>> + 'pwrkey' always wakes the system by default. >>>>>> >>>>>> >>>>>> I'll fix existing code, so don't repeat that style. >>>>> >>>>> If you ack I can reformat on my side to match the patch you just sent. >>>> >>>> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> >>> >>> Thanks for fixing that up Krzysztof! I noticed but didn't want to deviate >>> from the style just for this description. Of course better to fix the >>> formatting in the first place. >>> >>> @Dmitry: Maybe give this patch some time (1-2 weeks?) to gather more >>> feedback, >>> given the reasons outlined in the cover letter. Also on the driver patch. >> >> OK, I'll hold on to this for a couple of weeks. > > Nobody voiced any objections so far, so applied both. Thanks Dmitry! ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 2/2] Input: pm8941-pwrkey - Disable wakeup for resin by default 2025-09-09 13:23 [PATCH 0/2] Disable wakeup for resin keys by default Luca Weiss 2025-09-09 13:23 ` [PATCH 1/2] dt-bindings: input: pm8941-pwrkey: Document wakeup-source property Luca Weiss @ 2025-09-09 13:23 ` Luca Weiss 2025-09-09 14:55 ` Neil Armstrong 1 sibling, 1 reply; 11+ messages in thread From: Luca Weiss @ 2025-09-09 13:23 UTC (permalink / raw) To: Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Courtney Cavin, Vinod Koul Cc: Bhushan Shah, ~postmarketos/upstreaming, phone-devel, linux-arm-msm, linux-input, devicetree, linux-kernel, Luca Weiss 'Resin' (*Res*et *In*put) is usually connected to a volume down button on devices, which is usually not expected to wake up the device from suspend. On the other hand, pwrkey should keep wakeup on. So do not enable wakeup for resin unless the "wakeup-source" property is specified in devicetree. Note, that this does change behavior by turning off wakeup by default for 'resin' and requiring a new dt property to be added to turn it on again. But since this is not expected behavior in the first place, and most users will not expect this, I'd argue this change is acceptable. Signed-off-by: Luca Weiss <luca@lucaweiss.eu> --- drivers/input/misc/pm8941-pwrkey.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/input/misc/pm8941-pwrkey.c b/drivers/input/misc/pm8941-pwrkey.c index d952c16f24582bfc792e335a1fc954919561fa87..53249d2c081fba8b8235393e14736494bf9b238b 100644 --- a/drivers/input/misc/pm8941-pwrkey.c +++ b/drivers/input/misc/pm8941-pwrkey.c @@ -60,6 +60,7 @@ struct pm8941_data { bool supports_ps_hold_poff_config; bool supports_debounce_config; bool has_pon_pbs; + bool wakeup_source_default; const char *name; const char *phys; }; @@ -245,7 +246,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(pm8941_pwr_key_pm_ops, static int pm8941_pwrkey_probe(struct platform_device *pdev) { struct pm8941_pwrkey *pwrkey; - bool pull_up; + bool pull_up, wakeup; struct device *parent; struct device_node *regmap_node; const __be32 *addr; @@ -402,8 +403,11 @@ static int pm8941_pwrkey_probe(struct platform_device *pdev) } } + wakeup = pwrkey->data->wakeup_source_default || + of_property_read_bool(pdev->dev.of_node, "wakeup-source"); + platform_set_drvdata(pdev, pwrkey); - device_init_wakeup(&pdev->dev, 1); + device_init_wakeup(&pdev->dev, wakeup); return 0; } @@ -424,6 +428,7 @@ static const struct pm8941_data pwrkey_data = { .supports_ps_hold_poff_config = true, .supports_debounce_config = true, .has_pon_pbs = false, + .wakeup_source_default = true, }; static const struct pm8941_data resin_data = { @@ -434,6 +439,7 @@ static const struct pm8941_data resin_data = { .supports_ps_hold_poff_config = true, .supports_debounce_config = true, .has_pon_pbs = false, + .wakeup_source_default = false, }; static const struct pm8941_data pon_gen3_pwrkey_data = { @@ -443,6 +449,7 @@ static const struct pm8941_data pon_gen3_pwrkey_data = { .supports_ps_hold_poff_config = false, .supports_debounce_config = false, .has_pon_pbs = true, + .wakeup_source_default = true, }; static const struct pm8941_data pon_gen3_resin_data = { @@ -452,6 +459,7 @@ static const struct pm8941_data pon_gen3_resin_data = { .supports_ps_hold_poff_config = false, .supports_debounce_config = false, .has_pon_pbs = true, + .wakeup_source_default = false, }; static const struct of_device_id pm8941_pwr_key_id_table[] = { -- 2.51.0 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] Input: pm8941-pwrkey - Disable wakeup for resin by default 2025-09-09 13:23 ` [PATCH 2/2] Input: pm8941-pwrkey - Disable wakeup for resin by default Luca Weiss @ 2025-09-09 14:55 ` Neil Armstrong 0 siblings, 0 replies; 11+ messages in thread From: Neil Armstrong @ 2025-09-09 14:55 UTC (permalink / raw) To: Luca Weiss, Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Courtney Cavin, Vinod Koul Cc: Bhushan Shah, ~postmarketos/upstreaming, phone-devel, linux-arm-msm, linux-input, devicetree, linux-kernel On 09/09/2025 15:23, Luca Weiss wrote: > 'Resin' (*Res*et *In*put) is usually connected to a volume down button > on devices, which is usually not expected to wake up the device from > suspend. > > On the other hand, pwrkey should keep wakeup on. So do not enable wakeup > for resin unless the "wakeup-source" property is specified in > devicetree. > > Note, that this does change behavior by turning off wakeup by default > for 'resin' and requiring a new dt property to be added to turn it on > again. But since this is not expected behavior in the first place, and > most users will not expect this, I'd argue this change is acceptable. > > Signed-off-by: Luca Weiss <luca@lucaweiss.eu> > --- > drivers/input/misc/pm8941-pwrkey.c | 12 ++++++++++-- > 1 file changed, 10 insertions(+), 2 deletions(-) > > diff --git a/drivers/input/misc/pm8941-pwrkey.c b/drivers/input/misc/pm8941-pwrkey.c > index d952c16f24582bfc792e335a1fc954919561fa87..53249d2c081fba8b8235393e14736494bf9b238b 100644 > --- a/drivers/input/misc/pm8941-pwrkey.c > +++ b/drivers/input/misc/pm8941-pwrkey.c > @@ -60,6 +60,7 @@ struct pm8941_data { > bool supports_ps_hold_poff_config; > bool supports_debounce_config; > bool has_pon_pbs; > + bool wakeup_source_default; > const char *name; > const char *phys; > }; > @@ -245,7 +246,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(pm8941_pwr_key_pm_ops, > static int pm8941_pwrkey_probe(struct platform_device *pdev) > { > struct pm8941_pwrkey *pwrkey; > - bool pull_up; > + bool pull_up, wakeup; > struct device *parent; > struct device_node *regmap_node; > const __be32 *addr; > @@ -402,8 +403,11 @@ static int pm8941_pwrkey_probe(struct platform_device *pdev) > } > } > > + wakeup = pwrkey->data->wakeup_source_default || > + of_property_read_bool(pdev->dev.of_node, "wakeup-source"); > + > platform_set_drvdata(pdev, pwrkey); > - device_init_wakeup(&pdev->dev, 1); > + device_init_wakeup(&pdev->dev, wakeup); > > return 0; > } > @@ -424,6 +428,7 @@ static const struct pm8941_data pwrkey_data = { > .supports_ps_hold_poff_config = true, > .supports_debounce_config = true, > .has_pon_pbs = false, > + .wakeup_source_default = true, > }; > > static const struct pm8941_data resin_data = { > @@ -434,6 +439,7 @@ static const struct pm8941_data resin_data = { > .supports_ps_hold_poff_config = true, > .supports_debounce_config = true, > .has_pon_pbs = false, > + .wakeup_source_default = false, > }; > > static const struct pm8941_data pon_gen3_pwrkey_data = { > @@ -443,6 +449,7 @@ static const struct pm8941_data pon_gen3_pwrkey_data = { > .supports_ps_hold_poff_config = false, > .supports_debounce_config = false, > .has_pon_pbs = true, > + .wakeup_source_default = true, > }; > > static const struct pm8941_data pon_gen3_resin_data = { > @@ -452,6 +459,7 @@ static const struct pm8941_data pon_gen3_resin_data = { > .supports_ps_hold_poff_config = false, > .supports_debounce_config = false, > .has_pon_pbs = true, > + .wakeup_source_default = false, > }; > > static const struct of_device_id pm8941_pwr_key_id_table[] = { > Thanks ! Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2025-09-29 15:53 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-09-09 13:23 [PATCH 0/2] Disable wakeup for resin keys by default Luca Weiss 2025-09-09 13:23 ` [PATCH 1/2] dt-bindings: input: pm8941-pwrkey: Document wakeup-source property Luca Weiss 2025-09-09 14:02 ` Krzysztof Kozlowski 2025-09-09 14:08 ` Dmitry Torokhov 2025-09-09 14:33 ` Krzysztof Kozlowski 2025-09-09 14:41 ` Luca Weiss 2025-09-09 14:54 ` Dmitry Torokhov 2025-09-25 5:45 ` Dmitry Torokhov 2025-09-29 15:44 ` Luca Weiss 2025-09-09 13:23 ` [PATCH 2/2] Input: pm8941-pwrkey - Disable wakeup for resin by default Luca Weiss 2025-09-09 14:55 ` Neil Armstrong
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox