mbox series

[0/3] Powerbutton driver and powerdown request for TPS65224 PMIC

Message ID 20250520-linux-stable-tps6594-pwrbutton-v1-0-0cc5c6e0415c@criticallink.com
Headers show
Series Powerbutton driver and powerdown request for TPS65224 PMIC | expand

Message

Job Sava May 20, 2025, 5:43 p.m. UTC
Hello all,

The following patches were created to get the tps65224 PMIC powerbutton driver and power off request working on the MitySOM-AM62PX. The patches are as follows:

1-Powerbutton:
Full implementation
TPS659224 pmic push and release interrupts are now handled by the powerbutton driver. These events now issue a power off request that puts the PMIC into STANDBY mode. tps6594-pwrbutton.c is modeled off the tps65219-pwrbutton.c driver.

2-OFF-request:
The PMIC will now respond to a power off request. This is done by sending the PMIC a command to enter STANDBY mode. The PMIC will then turn off the power to the system.

3-Device tree bindings:
The device tree binding for the TPS65224 PMIC has been updated to include a proper description of the power button functionality.

4-Impact:
Button presses will now be detected reliably by the newly added powerbutton driver. The `tps6594-pfsm.c` file will no longer handle push and release pushbutton interrupts. This is because the powerbutton driver now manages these interrupts, as intended, which ensures the powerbutton functionality operates independently and correctly.

Regards,
Job Sava
jsava@criticallink.com
Critical Link LLC

Signed-off-by: Job Sava <jsava@criticallink.com>
---
Job Sava (3):
      dt-bindings: mfd: Add power-button option for TI TPS6594 PMIC
      mfd: tps6594-pwrbutton: Add powerbutton functionality
      mfd: tps6594: Adds support for powering off the PMIC

 .../devicetree/bindings/mfd/ti,tps6594.yaml        |  15 +++
 drivers/input/misc/Kconfig                         |  10 ++
 drivers/input/misc/Makefile                        |   1 +
 drivers/input/misc/tps6594-pwrbutton.c             | 126 +++++++++++++++++++++
 drivers/mfd/tps6594-core.c                         |  49 +++++++-
 5 files changed, 199 insertions(+), 2 deletions(-)
---
base-commit: a5806cd506af5a7c19bcd596e4708b5c464bfd21
change-id: 20250403-linux-stable-tps6594-pwrbutton-e056dccc6be5

Best regards,

Comments

Krzysztof Kozlowski May 21, 2025, 10:01 a.m. UTC | #1
On Tue, May 20, 2025 at 01:43:36PM GMT, Job Sava wrote:
> The TPS6594 power-button option permits users to enter STANDBY or
> ACTIVE state by a push, release, or short push button request.
> 
> Signed-off-by: Job Sava <jsava@criticallink.com>
> ---
>  Documentation/devicetree/bindings/mfd/ti,tps6594.yaml | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/mfd/ti,tps6594.yaml b/Documentation/devicetree/bindings/mfd/ti,tps6594.yaml
> index 6341b6070366..a40808fd2747 100644
> --- a/Documentation/devicetree/bindings/mfd/ti,tps6594.yaml
> +++ b/Documentation/devicetree/bindings/mfd/ti,tps6594.yaml
> @@ -37,6 +37,21 @@ properties:
>        device on the SPMI bus, and the secondary PMICs are the target devices
>        on the SPMI bus.
>  
> +  ti,power-button:
> +    type: boolean
> +    description: |
> +      Optional property that sets the EN/PB/VSENSE pin to be a
> +      power-button.
> +      TPS6594 has a multipurpose pin called EN/PB/VSENSE that can be either
> +      1. EN in which case it functions as an enable pin.
> +      2. VSENSE which compares the voltages and triggers an automatic
> +      on/off request.
> +      3. PB in which case it can be configured to trigger an interrupt
> +      to the SoC.
> +      ti,power-button reflects the last one of those options
> +      where the board has a button wired to the pin and triggers
> +      an interrupt on pressing it.

Don't you need to handle two other cases as well? I assume you copied
this from the other binding, but all three options are valid?

Best regards,
Krzysztof