summaryrefslogtreecommitdiff
path: root/drivers/power/axp221.c
diff options
context:
space:
mode:
authorSamuel Holland <samuel@sholland.org>2021-08-23 02:18:05 +0300
committerAndre Przywara <andre.przywara@arm.com>2021-10-25 16:50:54 +0300
commit830e161eb4e9dbd3e9eb20ad6a3255eb8b4ed3c4 (patch)
tree384bd10d5a308a33b806f0a4e2058e61d6590d00 /drivers/power/axp221.c
parent344df3ca2c3c2e98c9ab4112e8ebd660ad2be6ea (diff)
downloadu-boot-830e161eb4e9dbd3e9eb20ad6a3255eb8b4ed3c4.tar.xz
power: axp: Avoid do_poweroff conflict with sysreset
The sysreset uclass has an option to provide the do_poweroff() function. When that option is enabled, the AXP power drivers should not provide their own definition. For the AXP305, which is paired with 64-bit systems where TF-A provides PSCI, there is another possible conflict with the PSCI firmware driver. This driver can be enabled even if CONFIG_PSCI_RESET is disabled, so make sure to use the right symbol in the condition. Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Diffstat (limited to 'drivers/power/axp221.c')
-rw-r--r--drivers/power/axp221.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/power/axp221.c b/drivers/power/axp221.c
index 3446fe7365..d251c314b9 100644
--- a/drivers/power/axp221.c
+++ b/drivers/power/axp221.c
@@ -264,6 +264,7 @@ int axp_get_sid(unsigned int *sid)
return 0;
}
+#if !IS_ENABLED(CONFIG_SYSRESET_CMD_POWEROFF)
int do_poweroff(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
pmic_bus_write(AXP221_SHUTDOWN, AXP221_SHUTDOWN_POWEROFF);
@@ -274,3 +275,4 @@ int do_poweroff(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
/* not reached */
return 0;
}
+#endif