mirror of
https://xff.cz/git/u-boot/
synced 2025-09-30 15:01:27 +02:00
sunxi: Implement poweroff support for axp818 pmic
Adds poweroff support for axp818 pmic. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
committed by
Hans de Goede
parent
9850e20148
commit
511992695d
@@ -44,6 +44,7 @@ config AXP221_POWER
|
|||||||
config AXP818_POWER
|
config AXP818_POWER
|
||||||
boolean "axp818 pmic support"
|
boolean "axp818 pmic support"
|
||||||
depends on MACH_SUN8I_A83T
|
depends on MACH_SUN8I_A83T
|
||||||
|
select CMD_POWEROFF
|
||||||
---help---
|
---help---
|
||||||
Say y here to enable support for the axp818 pmic found on
|
Say y here to enable support for the axp818 pmic found on
|
||||||
A83T dev board.
|
A83T dev board.
|
||||||
|
@@ -255,3 +255,14 @@ int axp_init(void)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int do_poweroff(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||||
|
{
|
||||||
|
pmic_bus_write(AXP818_SHUTDOWN, AXP818_SHUTDOWN_POWEROFF);
|
||||||
|
|
||||||
|
/* infinite loop during shutdown */
|
||||||
|
while (1) {}
|
||||||
|
|
||||||
|
/* not reached */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@@ -55,6 +55,9 @@
|
|||||||
#define AXP818_ALDO2_CTRL 0x29
|
#define AXP818_ALDO2_CTRL 0x29
|
||||||
#define AXP818_ALDO3_CTRL 0x2a
|
#define AXP818_ALDO3_CTRL 0x2a
|
||||||
|
|
||||||
|
#define AXP818_SHUTDOWN 0x32
|
||||||
|
#define AXP818_SHUTDOWN_POWEROFF (1 << 7)
|
||||||
|
|
||||||
/* For axp_gpio.c */
|
/* For axp_gpio.c */
|
||||||
#define AXP_POWER_STATUS 0x00
|
#define AXP_POWER_STATUS 0x00
|
||||||
#define AXP_POWER_STATUS_VBUS_PRESENT (1 << 5)
|
#define AXP_POWER_STATUS_VBUS_PRESENT (1 << 5)
|
||||||
|
Reference in New Issue
Block a user