From nobody Sun Feb 8 12:58:31 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C668736E379; Thu, 30 Oct 2025 19:10:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761851447; cv=none; b=f1isrluO3ctx5SHeluzUuIkKSqH6I1R8JQfS9N1YS9YtaZKJuT40+Rln2zODo3HPnfWBM26Mzrge41hTPdM5XO9W8fVfxlGMudKhnYc6UoHGRxg9JxCXSrOVsCR0H5l0sZ1gpSCZ5f5kZDfreHj/bulzvR8H9zCTxokIgOd7bOk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761851447; c=relaxed/simple; bh=91KY+nkPE2QzFwyk2r+ohZxGPmfb6eb5RwKvQfl3ZgE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=osc0rDXjt2pYecPyG6IHBCZUNueZmTeIMwSvAj4EWYtplRnCScfSmN4W3tjIBTUK5yCcv5Ypnd6Fp+8UHKQ67RYgFRgh1WHXfuRtvX3v1ZIrbQ1DFTFSurpTq/Lc8dog7A9wcmuOUzW7gF9A99+dBAuUhyiMMudNHF45CXNuxSU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gJkbj8BL; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gJkbj8BL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A0FEC4CEF8; Thu, 30 Oct 2025 19:10:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1761851447; bh=91KY+nkPE2QzFwyk2r+ohZxGPmfb6eb5RwKvQfl3ZgE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=gJkbj8BLLN5Aa6pq8QS85yNz5UkJoNgYsVSUt8jYha2XGcib1lx3Fys7NeAz69DT0 zAA6zo/2qiFXMuQmVRqiyYH8w6ysUaAFeOwIJNCf14oB4JVjuYFWAFSNJfAdZ6skVu rQfNpvR+PTftr+sTzlrqSWHd20lneIg4NkqVW6Gnz+dM4LbNMfMfTMylKVK6W0T3+U j74Sz1g9CopHRecjuutenDizsfV7XfSYXCScXd43ZZn5ja1+rIAED6sZi7nknLU4/J eHb5vIehQgmOCFPSSJQf4BX8Z5fDjlwUaE8lJJrQyqmbzW7pEWvek2vtD/X6UBHeOU lmktVhUS3cGWA== From: akemnade@kernel.org Date: Thu, 30 Oct 2025 20:10:34 +0100 Subject: [PATCH v2 1/3] dt-bindings: mfd: twl: enable power button also for twl603x 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: <20251030-twl6030-button-v2-1-09653d05a2b1@kernel.org> References: <20251030-twl6030-button-v2-0-09653d05a2b1@kernel.org> In-Reply-To: <20251030-twl6030-button-v2-0-09653d05a2b1@kernel.org> To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andreas Kemnade , Dmitry Torokhov , Tony Lindgren , Kevin Hilman Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-omap@vger.kernel.org, Andreas Kemnade X-Mailer: b4 0.15-dev-50721 X-Developer-Signature: v=1; a=openpgp-sha256; l=2557; i=akemnade@kernel.org; h=from:subject:message-id; bh=bcJuM4UZV6ZlrCUfx8ZxWUkWFTQekHy49XD66j2NCIg=; b=owGbwMvMwCUm/rzkS6lq2x3G02pJDJnMOww9PQ0rb0jaJi1QO1vocWlyk85Hya7Z6x2YfIzz/ HvnOk7rKGVhEONikBVTZPllreD2SeVZbvDUCHuYOaxMIEMYuDgFYCIfQxgZZmyoPvJM49cU7k7x H79Ytk0SnFDB4dp+YqHy0zf7rn+9XsXIcMwpu3JtJbfwnEXrVz0pf/X+TuPyx4K5R2ep5X3j+zO /nAsA X-Developer-Key: i=akemnade@kernel.org; a=openpgp; fpr=EEC0DB858E66C0DA70620AC07DBD6AC74DE29324 From: Andreas Kemnade TWL603x has also a power button function, so add the corresponding subnode. As not in all cases there is a power button connected to the corresponding pad of the TWL603x, the functionality can be disabled by status =3D "disabled" or simply not adding the subnode. To keep things simple, follow the established design pattern of using const interrupts as used also by the other subdevices. Signed-off-by: Andreas Kemnade --- Documentation/devicetree/bindings/mfd/ti,twl.yaml | 40 ++++++++++++++++++-= ---- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/Documentation/devicetree/bindings/mfd/ti,twl.yaml b/Documentat= ion/devicetree/bindings/mfd/ti,twl.yaml index 776b04e182cb..3527fee32cb0 100644 --- a/Documentation/devicetree/bindings/mfd/ti,twl.yaml +++ b/Documentation/devicetree/bindings/mfd/ti,twl.yaml @@ -55,6 +55,15 @@ allOf: =20 gpadc: false =20 + pwrbutton: + properties: + compatible: + const: ti,twl4030-pwrbutton + interrupts: + items: + - items: + const: 8 + usb-comparator: false =20 - if: @@ -95,7 +104,14 @@ allOf: compatible: const: ti,twl6030-gpadc =20 - pwrbutton: false + pwrbutton: + properties: + compatible: + const: ti,twl6030-pwrbutton + interrupts: + items: + - items: + const: 0 =20 madc: false =20 @@ -146,7 +162,14 @@ allOf: compatible: const: ti,twl6032-gpadc =20 - pwrbutton: false + pwrbutton: + properties: + compatible: + const: ti,twl6030-pwrbutton + interrupts: + items: + - items: + const: 0 =20 madc: false =20 @@ -225,12 +248,8 @@ properties: additionalProperties: false =20 properties: - compatible: - const: ti,twl4030-pwrbutton - interrupts: - items: - - items: - const: 8 + compatible: true + interrupts: true =20 watchdog: type: object @@ -459,6 +478,11 @@ examples: #io-channel-cells =3D <1>; }; =20 + pwrbutton { + compatible =3D "ti,twl6030-pwrbutton"; + interrupts =3D <0>; + }; + rtc { compatible =3D "ti,twl4030-rtc"; interrupts =3D <8>; --=20 2.47.3 From nobody Sun Feb 8 12:58:31 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C5DA36E379; Thu, 30 Oct 2025 19:10:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761851451; cv=none; b=JJpdUc8HhaHubXTqsTWnCJNnTxFh4My9dy5kPAhb6jjyS8YyF2IJynzG59D9Y9xI4oQ4knZFgCly1UjYY4yNG52+oMUbHRHPCw4Fv4U5eLmTRUnUbcmUQUNeVWCWdVf80ewDPr/7UnQuYKbOYGHVCD8fYTUih89BbMME4w/WWS8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761851451; c=relaxed/simple; bh=cHjDlZtTYftdFCvuNHubVcxeKWbrgg4EsP+LZCBO4Ek=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=sxb7au5cpXaNy425Ozo4IVJJcTuspEV00sYRufE4VCwghN6m1sS37hDMdQeOb/YegFN/Bcrq8CwWVwnMh8eDUHbFUorWZsPTMgew6bVoqGJLCIyWMwd2HlX1/ftSiKTToUguiBg5VZ8IWxL/5Ir0aF3AUoBrECmChEWHSSpH2kE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rdXW9ZLZ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rdXW9ZLZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B613C4CEF1; Thu, 30 Oct 2025 19:10:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1761851450; bh=cHjDlZtTYftdFCvuNHubVcxeKWbrgg4EsP+LZCBO4Ek=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=rdXW9ZLZJauTxe+QtZqgSgua8IRFS1EFy0bazqNUKizqtrmuemngl6/rHt+k3Ka4o Q/R4TN/vdiEjMRuypP4N1elYwXaN51Ir/mt9BAoAY9eNlLovKTWwpqQs27fEM7y+G/ elidbZARQBcEsoaRJS+lOV4ZG62zRkxpc1M15OQy+yxWHnQHKRLY8S5Rc2Y/xJOSps i5siMD8KI3nfj+7D2PGVgUSZNuxhwe+FAQLmxSJ8YAvoemq+CfK1rndGLevoy6bguV fPmsoEvc56+sZKu6qZUuclkGX0rN/XauWFS1CmfKIS4XZsfGW0ibq2bctpjmJDYZ3l jQUSdDkZXgcdQ== From: akemnade@kernel.org Date: Thu, 30 Oct 2025 20:10:35 +0100 Subject: [PATCH v2 2/3] Input: twl4030 - add TWL603x power button 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: <20251030-twl6030-button-v2-2-09653d05a2b1@kernel.org> References: <20251030-twl6030-button-v2-0-09653d05a2b1@kernel.org> In-Reply-To: <20251030-twl6030-button-v2-0-09653d05a2b1@kernel.org> To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andreas Kemnade , Dmitry Torokhov , Tony Lindgren , Kevin Hilman Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-omap@vger.kernel.org, Andreas Kemnade X-Mailer: b4 0.15-dev-50721 X-Developer-Signature: v=1; a=openpgp-sha256; l=3808; i=akemnade@kernel.org; h=from:subject:message-id; bh=Ky78W5nAVHuvnJu9A9mhWPFKniz0N8RHMmhyKRDnhUA=; b=owGbwMvMwCUm/rzkS6lq2x3G02pJDJnMOwyvsj/+nJbuzTJr3mk2hWWvGucmVO2++b/6t9LeN dcZIk/e6ihlYRDjYpAVU2T5Za3g9knlWW7w1Ah7mDmsTCBDGLg4BWAik+8wMky+7nhn+2f9VpOp n/hO+VtGPD8kULrmzbMFeaJul3qM9k5l+Gd9aKUV01Xh7LKvwTs2VbHpPpjEVm7AFxDcftEm+68 tJwcA X-Developer-Key: i=akemnade@kernel.org; a=openpgp; fpr=EEC0DB858E66C0DA70620AC07DBD6AC74DE29324 From: Andreas Kemnade Like the TWL4030, these PMICs also have a power button feature, so extend the TWL4030 power button driver. As the irqchip of the TWL6030 mfd driver does not provide mask, unmask finctions, do it manually. Signed-off-by: Andreas Kemnade --- drivers/input/misc/twl4030-pwrbutton.c | 61 ++++++++++++++++++++++++++++++= +--- 1 file changed, 57 insertions(+), 4 deletions(-) diff --git a/drivers/input/misc/twl4030-pwrbutton.c b/drivers/input/misc/tw= l4030-pwrbutton.c index f85cc289c053..f8c337f62393 100644 --- a/drivers/input/misc/twl4030-pwrbutton.c +++ b/drivers/input/misc/twl4030-pwrbutton.c @@ -25,22 +25,40 @@ #include #include #include +#include #include #include #include #include =20 -#define PWR_PWRON_IRQ (1 << 0) +#define PWR_PWRON_IRQ BIT(0) =20 -#define STS_HW_CONDITIONS 0xf +#define STS_HW_CONDITIONS_4030 0xf +#define STS_HW_CONDITIONS_6030 0x2 + +struct twl_pwrbutton_chipdata { + u8 status_reg; + bool need_manual_irq; +}; + +struct twl_pwrbutton_chipdata twl4030_chipdata =3D { + STS_HW_CONDITIONS_4030, + false, +}; + +struct twl_pwrbutton_chipdata twl6030_chipdata =3D { + STS_HW_CONDITIONS_6030, + true, +}; =20 static irqreturn_t powerbutton_irq(int irq, void *_pwr) { struct input_dev *pwr =3D _pwr; + const struct twl_pwrbutton_chipdata *pdata =3D dev_get_drvdata(pwr->dev.p= arent); int err; u8 value; =20 - err =3D twl_i2c_read_u8(TWL_MODULE_PM_MASTER, &value, STS_HW_CONDITIONS); + err =3D twl_i2c_read_u8(TWL_MODULE_PM_MASTER, &value, pdata->status_reg); if (!err) { pm_wakeup_event(pwr->dev.parent, 0); input_report_key(pwr, KEY_POWER, value & PWR_PWRON_IRQ); @@ -55,10 +73,17 @@ static irqreturn_t powerbutton_irq(int irq, void *_pwr) =20 static int twl4030_pwrbutton_probe(struct platform_device *pdev) { + const struct twl_pwrbutton_chipdata *pdata; struct input_dev *pwr; int irq =3D platform_get_irq(pdev, 0); int err; =20 + pdata =3D device_get_match_data(&pdev->dev); + if (!pdata) + return -EINVAL; + + platform_set_drvdata(pdev, (void *)pdata); + pwr =3D devm_input_allocate_device(&pdev->dev); if (!pwr) { dev_err(&pdev->dev, "Can't allocate power button\n"); @@ -85,14 +110,41 @@ static int twl4030_pwrbutton_probe(struct platform_dev= ice *pdev) return err; } =20 + if (pdata->need_manual_irq) { + err =3D twl6030_interrupt_unmask(0x01, REG_INT_MSK_LINE_A); + if (err < 0) + return err; + + err =3D twl6030_interrupt_unmask(0x01, REG_INT_MSK_STS_A); + if (err < 0) + return err; + } + device_init_wakeup(&pdev->dev, true); =20 return 0; } =20 +static void twl4030_pwrbutton_remove(struct platform_device *pdev) +{ + const struct twl_pwrbutton_chipdata *pdata =3D platform_get_drvdata(pdev); + + if (pdata->need_manual_irq) { + twl6030_interrupt_mask(0x01, REG_INT_MSK_LINE_A); + twl6030_interrupt_mask(0x01, REG_INT_MSK_STS_A); + } +} + #ifdef CONFIG_OF static const struct of_device_id twl4030_pwrbutton_dt_match_table[] =3D { - { .compatible =3D "ti,twl4030-pwrbutton" }, + { + .compatible =3D "ti,twl4030-pwrbutton", + .data =3D &twl4030_chipdata, + }, + { + .compatible =3D "ti,twl6030-pwrbutton", + .data =3D &twl6030_chipdata, + }, {}, }; MODULE_DEVICE_TABLE(of, twl4030_pwrbutton_dt_match_table); @@ -100,6 +152,7 @@ MODULE_DEVICE_TABLE(of, twl4030_pwrbutton_dt_match_tabl= e); =20 static struct platform_driver twl4030_pwrbutton_driver =3D { .probe =3D twl4030_pwrbutton_probe, + .remove =3D twl4030_pwrbutton_remove, .driver =3D { .name =3D "twl4030_pwrbutton", .of_match_table =3D of_match_ptr(twl4030_pwrbutton_dt_match_table), --=20 2.47.3 From nobody Sun Feb 8 12:58:31 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2BAA337572A; Thu, 30 Oct 2025 19:10:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761851454; cv=none; b=Ntkaky6nqZza0PecRP99q8Byvf5LcdQ7nVYWM4OmTKxvUgzK+RWyKyA5aju4TyOM+ZWu5GiABufillsuVsaH+G7rgWxsarq4aPFI1S8abrGOOwREPSxjPloAr3cjcSechslzvV5rKL8Sb5Tr7qFPp71f4+uSVSz6qwB2YM4EJdo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761851454; c=relaxed/simple; bh=adyXiT86E3/PnN/XVD2yWuOTXuTxM2aPkCYxiEEjduY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hF0L4FzUgelS+Hr+C8kDgQN5LaqbQbMlkQ/RKG5Dbyw3PosU2df/16JR6uAO+JuxPPrsYfuVB7gAr6u2FUlsmCLZDXqzpfurxCbqLw7VfEuAwKOTqldToCfGFiGRnT3dROK7JhHk8S5Gfn1vWKyyeuPOTSWrly1xsqxCkPB7cIc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=g5e2tGMs; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="g5e2tGMs" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2FD2AC4CEFD; Thu, 30 Oct 2025 19:10:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1761851453; bh=adyXiT86E3/PnN/XVD2yWuOTXuTxM2aPkCYxiEEjduY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=g5e2tGMsymwn+FJBI5n1hSvtBJs0RhOvxQjknbrX07WyiUzOsLS0uIuE2C9Hmao4L Gm0B3HaAw+egPQJaJu9zGagx+wq+ARareGR0iXjMpULLlRsZCRDcRHxh0Sw5oKQUlv 50tD4SlGVSqJZ11l3T6UMlB3n9/a7D+V9DD4GKb8vPOEvSpqL7pViiwopbcQkNedV2 JrG2OBYSk9YZ6FsTdjouV48hYMh9Y+Zz5wkVnBwQMdSGpE7cBbDf6sW9O5R10xnz6M mJQLdAzM579Oj3g6HC170GETub0SU4WqyYhklgluYBYDf8GZSm8wXewpUQbenM6tSV gSWEST+q3TMBQ== From: akemnade@kernel.org Date: Thu, 30 Oct 2025 20:10:36 +0100 Subject: [PATCH v2 3/3] ARM: dts: ti/omap: omap4-epson-embt2ws: add powerbutton 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: <20251030-twl6030-button-v2-3-09653d05a2b1@kernel.org> References: <20251030-twl6030-button-v2-0-09653d05a2b1@kernel.org> In-Reply-To: <20251030-twl6030-button-v2-0-09653d05a2b1@kernel.org> To: Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andreas Kemnade , Dmitry Torokhov , Tony Lindgren , Kevin Hilman Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-omap@vger.kernel.org, Andreas Kemnade X-Mailer: b4 0.15-dev-50721 X-Developer-Signature: v=1; a=openpgp-sha256; l=828; i=akemnade@kernel.org; h=from:subject:message-id; bh=kCywPpfG6XQhiUheZwu6EG6J7hIkcu/XRNjW/00c6gg=; b=owGbwMvMwCUm/rzkS6lq2x3G02pJDJnMOwwn8gmrlubETTjWsksq4ZzuSSPphL8zjpfdjOrfo nsyuXRhRykLgxgXg6yYIssvawW3TyrPcoOnRtjDzGFlAhnCwMUpABOJVGFkuGq027yq88/klKDj rBFPv07YwvUxqy1livmfso0Zyjd9WRj+Z+188rBn2t1cn40+IXMFtm3aJGq7QVyrPP3Jx/T4twn X+QA= X-Developer-Key: i=akemnade@kernel.org; a=openpgp; fpr=EEC0DB858E66C0DA70620AC07DBD6AC74DE29324 From: Andreas Kemnade There is a power button connected to the PMIC, so describe it to be able to power off the device in a convenient manner. Signed-off-by: Andreas Kemnade --- arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts b/arch/arm/b= oot/dts/ti/omap/omap4-epson-embt2ws.dts index c90f43cc2fae..673df1b693f2 100644 --- a/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts +++ b/arch/arm/boot/dts/ti/omap/omap4-epson-embt2ws.dts @@ -229,6 +229,11 @@ rtc { interrupts =3D <11>; }; =20 + pwrbutton { + compatible =3D "ti,twl6030-pwrbutton"; + interrupts =3D <0>; + }; + ldo2: regulator-ldo2 { compatible =3D "ti,twl6032-ldo2"; regulator-min-microvolt =3D <1000000>; --=20 2.47.3