From nobody Thu Oct 2 22:52:45 2025 Received: from ahti.lucaweiss.eu (ahti.lucaweiss.eu [128.199.32.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3E0BE31CA4B; Tue, 9 Sep 2025 13:31:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=128.199.32.197 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757424708; cv=none; b=QZ61FDaoPvNtJmDa+d1UFVAelYQG4iv452vy8BatSErJ9p3TXGrvSaLUjvdIOLAMORBpWYZRgvGdFdJXICu2fksNZh5PuiByaH1m1VYMXU8ciTKI3fM++JoCgOdUlqfFQoF8RaM38+uLIIvzqdE1iBJLhQMqCL5uU09a7rYQMho= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757424708; c=relaxed/simple; bh=cBl3AU1k+NzEf9lUPtx7pk/rcGjQFRSJ5fDmsDRVK70=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=h2+agIDdfrGcUUwdoZle3Tm8t1X5ke+gfQKmBzZJ7yFHiOljGEb+vu7hxwzNOWvUqCx59s3BUE5CiOuI2kk4GnijWLMmXFKuQi7mN2CS7LpUfpyeWA5wkEkF3SWjI42dv/Id4ZsR/Sys6Fc6cQJpyuaxIeQo0EeqZEei3V2uFrc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=lucaweiss.eu; spf=pass smtp.mailfrom=lucaweiss.eu; dkim=pass (1024-bit key) header.d=lucaweiss.eu header.i=@lucaweiss.eu header.b=4j67O6Nq; arc=none smtp.client-ip=128.199.32.197 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=lucaweiss.eu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lucaweiss.eu Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lucaweiss.eu header.i=@lucaweiss.eu header.b="4j67O6Nq" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lucaweiss.eu; s=s1; t=1757424243; bh=cBl3AU1k+NzEf9lUPtx7pk/rcGjQFRSJ5fDmsDRVK70=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=4j67O6Nq86O/ZpZcrFsxdLKePJMelHDGH/zAE6jSGHIba5XIP8yMec560lNNZ5kLA lpbxZT+NRNyYp8ppXK0ocMD+GJuu/mXIhxDdOQ0wSz2rxnr8VJ+jVzJ5bSvjkXSGjY 5BH7nEGoAv6a620LUyWD4NSg1XW/12yksVM7xXwY= From: Luca Weiss Date: Tue, 09 Sep 2025 15:23:07 +0200 Subject: [PATCH 1/2] dt-bindings: input: pm8941-pwrkey: Document wakeup-source property Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250909-resin-wakeup-v1-1-46159940e02b@lucaweiss.eu> References: <20250909-resin-wakeup-v1-0-46159940e02b@lucaweiss.eu> In-Reply-To: <20250909-resin-wakeup-v1-0-46159940e02b@lucaweiss.eu> To: Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Courtney Cavin , Vinod Koul Cc: Bhushan Shah , ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Luca Weiss X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1971; i=luca@lucaweiss.eu; h=from:subject:message-id; bh=cBl3AU1k+NzEf9lUPtx7pk/rcGjQFRSJ5fDmsDRVK70=; b=owEBbQKS/ZANAwAKAXLYQ7idTddWAcsmYgBowCpweiIckbskuUc7f7npWuCyS80JUHjvIQhyO bdFredz7MOJAjMEAAEKAB0WIQQ5utIvCCzakboVj/py2EO4nU3XVgUCaMAqcAAKCRBy2EO4nU3X Vn1/EADRz+wg59O5TtMeFXiFb5SvQzYCt96JPA5eakPexScAuNSUHrFNk0K2ZAOHOHdUNfg3rT0 ov+53QtSdLVsvjAsgC9HSzK2a//y2DXiz1U57euuU4cf3HwH4YE9oY/Lhlf3ypKR/ITsPOVglL2 lbi247kMBBxP+22JUHBrpK3m+ir7tZu/qs/M54TxfxPPRj+s3EP3VD0gQQa1TX9MxDa6vVVmDGO SKkBw/PtCBUYVB7vglyD940GyodC8LV0Fa4kDhFEUmRb3MecTJMJT+pQQj4GVzDwgMvJVauwYA0 ceKeAFd6I0ZJ0vKRDY4IUtBgfgkCcFefcffD63REsNURVfwy9tSj09OZLbWlQ3+pVAGLNHvu1WG KxVOFex3vb08rN7Arero5LXR2sXfbbQr5nKLAsUQcvBofImJTbzinsjY57lzjy0fUr7XCvDXFVp Ik8hoZ+SsvwipiltbktYcZ/AikDVJMecYtCjbyIzEOA+T+0+wX3gm6fLPUV1oY4/2NBncRnJYWH sZzCBRxV8FrS0xvK6un7+WCVAkhIPUSuNdFkaV2WcLcQ1jW0D2RzUmW2hy/YerpfRkh1LV9OKww RG1bIZzWS0Pe44uCqkBWI0FrAf5cXWyeCp3Uas/5nMdFG0ue2Dl97HY9EcYwCvTqnRT7T4VyJcb aAMhdZHasDc0oOQ== X-Developer-Key: i=luca@lucaweiss.eu; a=openpgp; fpr=BD04DA24C971B8D587B2B8D7FAF69CF6CD2D02CD 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 Reviewed-by: Krzysztof Kozlowski --- .../bindings/input/qcom,pm8941-pwrkey.yaml | 21 +++++++++++++++++= +--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/input/qcom,pm8941-pwrkey.yam= l b/Documentation/devicetree/bindings/input/qcom,pm8941-pwrkey.yaml index 62314a5fdce59bb00d1e8b86d6a29a091128aa50..62a08e675ef9511e0ae9ed9fbab= 5694ab7242c35 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 - Vinod Koul =20 -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 =20 + 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. =20 +allOf: + - $ref: input.yaml# + - if: + properties: + compatible: + contains: + enum: + - qcom,pm8941-pwrkey + - qcom,pmk8350-pwrkey + then: + properties: + wakeup-source: false + required: - compatible - interrupts --=20 2.51.0 From nobody Thu Oct 2 22:52:45 2025 Received: from ahti.lucaweiss.eu (ahti.lucaweiss.eu [128.199.32.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D4003314C1; Tue, 9 Sep 2025 13:31:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=128.199.32.197 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757424709; cv=none; b=RSxA0lgjV3YkXkRgaKpSxRT/FNLbEpuB7rbUDwMbDYU+69pVsDNtwTAOnVOjnwfRtIceTK2JBs/MnO1upXcJm6S18+dEF6BcIlKNbKfXI8BFjN8StM5CLr+0dVKoeL4qEPBj9gnFjkHMwtzPCdaLdnhIQ9+IKQL+Ub/VZxCjBYc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757424709; c=relaxed/simple; bh=FlT7W0/J3zxEIOtm/dP6L7RmnHSRfjzVbrAlelngAlc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=chJqwnONRApVLDwsaDYdW271OpR8eiqVRPKeTJ1y54dD9m9hbckI+vn6kezqFK0p+ewbUimpSUX6X73kvtNW92B2j245IDLKC5ca90fFm5pDTSfKYUgfVg8ZibZ50q5TjQOo3HzczuwqlF8aPErFxujYwiYxjB9hzwIheNdLX44= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=lucaweiss.eu; spf=pass smtp.mailfrom=lucaweiss.eu; dkim=pass (1024-bit key) header.d=lucaweiss.eu header.i=@lucaweiss.eu header.b=aMJvw+AE; arc=none smtp.client-ip=128.199.32.197 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=lucaweiss.eu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lucaweiss.eu Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lucaweiss.eu header.i=@lucaweiss.eu header.b="aMJvw+AE" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lucaweiss.eu; s=s1; t=1757424244; bh=FlT7W0/J3zxEIOtm/dP6L7RmnHSRfjzVbrAlelngAlc=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=aMJvw+AECLnus3QgnTXgdFILMEaryvHTcJR4K+tYFTAX3CW42a+/y+9mEuwV5HDo2 cotkXRo9pff6+XQkfmg1g7cHptfMjzmdpuEifKGtNWyO7V/IzLLNHRgjJoB+5/R8DC d9WXpMW0PDllnmk5gITqq37ewujZKhDIHr3k2nAg= From: Luca Weiss Date: Tue, 09 Sep 2025 15:23:08 +0200 Subject: [PATCH 2/2] Input: pm8941-pwrkey - Disable wakeup for resin by default Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250909-resin-wakeup-v1-2-46159940e02b@lucaweiss.eu> References: <20250909-resin-wakeup-v1-0-46159940e02b@lucaweiss.eu> In-Reply-To: <20250909-resin-wakeup-v1-0-46159940e02b@lucaweiss.eu> To: Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Courtney Cavin , Vinod Koul Cc: Bhushan Shah , ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Luca Weiss X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=3014; i=luca@lucaweiss.eu; h=from:subject:message-id; bh=FlT7W0/J3zxEIOtm/dP6L7RmnHSRfjzVbrAlelngAlc=; b=owEBbQKS/ZANAwAKAXLYQ7idTddWAcsmYgBowCpxYxRNRMVNMYjmF7ir7BZ+PIuD6035dlrlv CCR3+yGisGJAjMEAAEKAB0WIQQ5utIvCCzakboVj/py2EO4nU3XVgUCaMAqcQAKCRBy2EO4nU3X VqfsD/9V9Tt7r5/HwTQYc6+73mp8hxTu4Hbv1L6FEle9aTIzUk6k0NDx86Q+g3IzKIQYqSJjuzh vueJF35iYxl/n6QYT+rgfy+18oBH4crDp++9QNaMKeo7LDAWApvPgZvaiasyyNOQ+Wd3wSw/2xG Rm7gN96lg5d4Q+tbqUhqxY6RajFrcYtjwMaej4lGIcjdfjCCs3l8uKTG1PZQjybU21wawNhbmBr hKhoLK36lqRurYEPUUsWZfzfK3Kjhz/nQS6wzLgCyupX9x0Es4LJk2a66FNJQZaDmUACisSsr5g ZM9wNexpj5UqUrCdJsCmtmITRKBYRVMkXzXQxlIRE1WkecFFC9iFPvQERExrf2nhREwm3wqWEXn UY7fsbe050eeB3mqd31V3KM5DN+zIA2kVv7ypeIm6KxeSboL0o5iZ3S6YtfTJcauJBCpG4x0Zid 2Fw+2opAmNhwzGTGV30gNtgMC8MZHpNMw4ijjQj6PKBnRmRRr1I//tQlqEH7sMGHN5wPFvGZUD8 SISTXrHFjvpXsX7QKCsfLRidBW7v5aWkE2QmDvj+o1waos8D/dnvqGvZIzdfk/aMgDKAVNcZvve qvkxTTaghGqDRo+60AESnC+8jN6vZFQMcR9kbZRyz6qZgMgsO9U0VoGwBof6dpeEyNV6edvzjtc qWtxDx4VYSbSIYQ== X-Developer-Key: i=luca@lucaweiss.eu; a=openpgp; fpr=BD04DA24C971B8D587B2B8D7FAF69CF6CD2D02CD '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 Reviewed-by: Neil Armstrong --- 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..53249d2c081fba8b8235393e147= 36494bf9b238b 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) } } =20 + wakeup =3D 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); =20 return 0; } @@ -424,6 +428,7 @@ static const struct pm8941_data pwrkey_data =3D { .supports_ps_hold_poff_config =3D true, .supports_debounce_config =3D true, .has_pon_pbs =3D false, + .wakeup_source_default =3D true, }; =20 static const struct pm8941_data resin_data =3D { @@ -434,6 +439,7 @@ static const struct pm8941_data resin_data =3D { .supports_ps_hold_poff_config =3D true, .supports_debounce_config =3D true, .has_pon_pbs =3D false, + .wakeup_source_default =3D false, }; =20 static const struct pm8941_data pon_gen3_pwrkey_data =3D { @@ -443,6 +449,7 @@ static const struct pm8941_data pon_gen3_pwrkey_data = =3D { .supports_ps_hold_poff_config =3D false, .supports_debounce_config =3D false, .has_pon_pbs =3D true, + .wakeup_source_default =3D true, }; =20 static const struct pm8941_data pon_gen3_resin_data =3D { @@ -452,6 +459,7 @@ static const struct pm8941_data pon_gen3_resin_data =3D= { .supports_ps_hold_poff_config =3D false, .supports_debounce_config =3D false, .has_pon_pbs =3D true, + .wakeup_source_default =3D false, }; =20 static const struct of_device_id pm8941_pwr_key_id_table[] =3D { --=20 2.51.0