mfd: twl4030-power: Accept standard property for power controller
authorAndreas Kemnade <andreas@kemnade.info>
Sat, 17 Feb 2024 08:20:07 +0000 (09:20 +0100)
committerLee Jones <lee@kernel.org>
Fri, 23 Feb 2024 16:12:03 +0000 (16:12 +0000)
Instead of only accepting the ti specific properties accept also
the standard property. For uniformity, search in the parent node
for the tag. The code for powering off is also isolated from the
rest in this file. So it is a pure Linux design decision to put it
here.

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Link: https://lore.kernel.org/r/20240217082007.3238948-6-andreas@kemnade.info
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/mfd/twl4030-power.c

index 1595e9c76132d80973eb1656604a01e8c23064a2..0bca948ab6baeeb9b9751189257abfcd791f850a 100644 (file)
@@ -686,6 +686,9 @@ static bool twl4030_power_use_poweroff(const struct twl4030_power_data *pdata,
        if (of_property_read_bool(node, "ti,use_poweroff"))
                return true;
 
+       if (of_device_is_system_power_controller(node->parent))
+               return true;
+
        return false;
 }