[PATCH 2/2] mfd: tps65219: Make poweroff handler conditional on system-power-controller
Akashdeep Kaur
a-kaur at ti.com
Tue Mar 24 03:18:05 PDT 2026
On 19/03/26 16:54, Lee Jones wrote:
> On Tue, 10 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 at ti.com>
>> ---
>> drivers/mfd/tps65219.c | 18 ++++++++++++------
>> 1 file changed, 12 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/mfd/tps65219.c b/drivers/mfd/tps65219.c
>> index 7275dcdb7c44..beb816707d8f 100644
>> --- a/drivers/mfd/tps65219.c
>> +++ b/drivers/mfd/tps65219.c
>> @@ -541,13 +541,19 @@ static int tps65219_probe(struct i2c_client *client)
...
>> + /*
>> + * Only register PMIC power-off handler if system-power-controller
>> + * property is present.
>> + */
>> + if (of_device_is_system_power_controller(tps->dev->of_node)) {
>
> The function name `of_device_is_system_power_controller()` is quite
> self-descriptive. Is this comment really necessary? The code seems clear
> enough without it.
Hi Lee, yes, i agree, Removed the comment.
Thanks,
Akashdeep Kaur
>
>> + 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");
>> }
>> +
>> return 0;
>> }
>>
>> --
>> 2.34.1
>>
>
More information about the linux-arm-kernel
mailing list