[PATCH 3/4] mfd: max77620: override PSCI poweroff handler on Pixel C
Diogo Ivo
diogo.ivo at tecnico.ulisboa.pt
Thu May 14 07:47:21 PDT 2026
On Pixel C, shutdown must be handled by the MAX77620 PMIC rather
than the PSCI SYSTEM_OFF call, whose firmware implementation is:
__dead2 void tegra_system_off(void)
{
ERROR("Tegra System Off: operation not handled.\n");
panic();
}
Raise the MAX77620 sys-off handler priority above SYS_OFF_PRIO_FIRMWARE
on Pixel C systems so it takes precedence over the PSCI poweroff handler.
Other systems continue to use the default sys-off priority.
Signed-off-by: Diogo Ivo <diogo.ivo at tecnico.ulisboa.pt>
---
drivers/mfd/max77620.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/drivers/mfd/max77620.c b/drivers/mfd/max77620.c
index c4f89a9681f3..3b1f3a2f3566 100644
--- a/drivers/mfd/max77620.c
+++ b/drivers/mfd/max77620.c
@@ -494,6 +494,18 @@ static int max77620_pm_power_off(struct sys_off_data *data)
return NOTIFY_DONE;
}
+static int max77620_power_off_priority(void)
+{
+ /*
+ * For Smaug we need to override the PSCI poweroff handler
+ * which is registered at priority SYS_OFF_PRIO_FIRMWARE.
+ */
+ if (of_machine_is_compatible("google,smaug"))
+ return SYS_OFF_PRIO_FIRMWARE + 1;
+
+ return SYS_OFF_PRIO_DEFAULT;
+}
+
static int max77620_probe(struct i2c_client *client)
{
const struct i2c_device_id *id = i2c_client_get_device_id(client);
@@ -502,6 +514,7 @@ static int max77620_probe(struct i2c_client *client)
struct regmap_irq_chip *chip_desc;
const struct mfd_cell *mfd_cells;
int n_mfd_cells;
+ int priority;
int ret;
chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL);
@@ -574,10 +587,11 @@ static int max77620_probe(struct i2c_client *client)
}
if (of_device_is_system_power_controller(client->dev.of_node)) {
+ priority = max77620_power_off_priority();
ret = devm_register_sys_off_handler(&client->dev,
SYS_OFF_MODE_POWER_OFF,
- SYS_OFF_PRIO_DEFAULT,
- max77620_pm_power_off, chip);
+ priority, max77620_pm_power_off,
+ chip);
if (ret)
return dev_err_probe(&client->dev, ret,
"failed to register power-off handler\n");
--
2.54.0
More information about the linux-arm-kernel
mailing list