public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: Lee Jones <lee@kernel•org>
To: Akashdeep Kaur <a-kaur@ti•com>
Cc: praneeth@ti•com, nm@ti•com, afd@ti•com, vigneshr@ti•com,
	kristo@kernel•org, robh@kernel•org, krzk+dt@kernel•org,
	conor+dt@kernel•org, aaro.koskinen@iki•fi, andreas@kemnade•info,
	khilman@baylibre•com, rogerq@kernel•org, tony@atomide•com,
	linux-arm-kernel@lists•infradead.org, devicetree@vger•kernel.org,
	linux-kernel@vger•kernel.org, linux-omap@vger•kernel.org,
	s-ramamoorthy@ti•com, vishalm@ti•com, sebin.francis@ti•com,
	d-gole@ti•com, k-willis@ti•com
Subject: Re: [PATCH v2 2/2] mfd: tps65219: Make poweroff handler conditional on system-power-controller
Date: Tue, 31 Mar 2026 11:12:03 +0100	[thread overview]
Message-ID: <20260331101203.GA3795166@google.com> (raw)
In-Reply-To: <20260324101419.95616-3-a-kaur@ti.com>

---

On Tue, 24 Mar 2026, Akashdeep Kaur wrote:

> Currently, the TPS65219 driver unconditionally registers a poweroff
> handler. This causes issues on systems where a different component
> (such as TF-A firmware) should handle system poweroff instead.
> 
> Make the poweroff handler registration conditional based on the
> "system-power-controller" device tree property. This follows the
> standard kernel pattern where only the designated power controller
> registers for system poweroff operations.
> 
> On systems where the property is absent, the PMIC will not register
> a poweroff handler, allowing other poweroff mechanisms to function.
> 
> Signed-off-by: Akashdeep Kaur <a-kaur@ti•com>
> ---
>  drivers/mfd/tps65219.c | 14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/mfd/tps65219.c b/drivers/mfd/tps65219.c
> index 7275dcdb7c44..6fa202339a0c 100644
> --- a/drivers/mfd/tps65219.c
> +++ b/drivers/mfd/tps65219.c
> @@ -541,13 +541,15 @@ static int tps65219_probe(struct i2c_client *client)
>  		return ret;
>  	}
>  
> -	ret = devm_register_power_off_handler(tps->dev,
> -					      tps65219_power_off_handler,
> -					      tps);
> -	if (ret) {
> -		dev_err(tps->dev, "failed to register power-off handler: %d\n", ret);
> -		return ret;
> +	if (of_device_is_system_power_controller(tps->dev->of_node)) {
> +		ret = devm_register_power_off_handler(tps->dev,
> +						      tps65219_power_off_handler,
> +						      tps);
> +		if (ret)
> +			return dev_err_probe(tps->dev, ret,
> +					"failed to register power-off handler\n");

Couple of nits to fix.

The `"` should be aligned with the `(` and the `failed` should be capitalised.

>  	}
> +
>  	return 0;
>  }
>  
> -- 
> 2.34.1
> 

-- 
Lee Jones [李琼斯]


  reply	other threads:[~2026-03-31 10:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-24 10:14 [PATCH v2 0/2] Make TPS65219 poweroff handler conditional Akashdeep Kaur
2026-03-24 10:14 ` [PATCH v2 1/2] arm64: dts: ti: k3-am62-lp-sk: Add system-power-controller Akashdeep Kaur
2026-03-24 10:14 ` [PATCH v2 2/2] mfd: tps65219: Make poweroff handler conditional on system-power-controller Akashdeep Kaur
2026-03-31 10:12   ` Lee Jones [this message]
2026-04-01 11:24     ` Akashdeep Kaur

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260331101203.GA3795166@google.com \
    --to=lee@kernel$(echo .)org \
    --cc=a-kaur@ti$(echo .)com \
    --cc=aaro.koskinen@iki$(echo .)fi \
    --cc=afd@ti$(echo .)com \
    --cc=andreas@kemnade$(echo .)info \
    --cc=conor+dt@kernel$(echo .)org \
    --cc=d-gole@ti$(echo .)com \
    --cc=devicetree@vger$(echo .)kernel.org \
    --cc=k-willis@ti$(echo .)com \
    --cc=khilman@baylibre$(echo .)com \
    --cc=kristo@kernel$(echo .)org \
    --cc=krzk+dt@kernel$(echo .)org \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-omap@vger$(echo .)kernel.org \
    --cc=nm@ti$(echo .)com \
    --cc=praneeth@ti$(echo .)com \
    --cc=robh@kernel$(echo .)org \
    --cc=rogerq@kernel$(echo .)org \
    --cc=s-ramamoorthy@ti$(echo .)com \
    --cc=sebin.francis@ti$(echo .)com \
    --cc=tony@atomide$(echo .)com \
    --cc=vigneshr@ti$(echo .)com \
    --cc=vishalm@ti$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox