diff options
author | Klaus Goger <klaus.goger@theobroma-systems.com> | 2015-07-26 09:00:57 +0200 |
---|---|---|
committer | Klaus Goger <klaus.goger@theobroma-systems.com> | 2015-07-30 18:44:07 +0200 |
commit | f70779b436fa5ef792c66fab42163bf3dd6a1267 (patch) | |
tree | ec95801b0f36301b07e2550c6f8282a4e7d67fa5 | |
parent | c5c6d44527c4ec85b86eeddb1c1f07faaaa3dbcc (diff) |
sunxi: pangolin: enable ATX power supply
when powered by ATX the SUS3 line must be HIGH to enable the ATX
power supply.
Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
-rw-r--r-- | board/sunxi/board.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/board/sunxi/board.c b/board/sunxi/board.c index c9a8c55c98..88b5c54559 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -445,9 +445,24 @@ void sunxi_board_init(void) #endif #ifdef CONFIG_AXP221_POWER power_failed = axp221_init(); - power_failed |= axp221_write(0x8f,0x41); - power_failed |= axp221_write(0x30,0x66); - power_failed |= axp221_write(0x30,0x62); +#ifdef CONFIG_SUNXI_PANGOLIN + /* Enable ATX power supply */ + gpio_request(SUNXI_GPM(4), "SUS3"); + sunxi_gpio_set_cfgpin(SUNXI_GPM(4),SUNXI_GPIO_OUTPUT); + gpio_direction_output(SUNXI_GPM(4),1); + /* Force VBUS power path disable current limit*/ + power_failed |= axp221_write(0x30,0xE6); + /* wait for ATX power to be stable */ + gpio_request(SUNXI_GPM(6),"PWGIN"); + sunxi_gpio_set_cfgpin(SUNXI_GPM(6),SUNXI_GPIO_INPUT); + while(gpio_get_value(SUNXI_GPM(6))==0) + { + mdelay(100); + } + mdelay(500); /* let the power supply settle */ + power_failed |= axp221_write(0x8f,0x41); /* AC-VBUS shorten */ + power_failed |= axp221_write(0x30,0x62); /* disable force VBUS */ +#endif power_failed |= axp221_set_dcdc1(CONFIG_AXP221_DCDC1_VOLT); power_failed |= axp221_set_dcdc2(1200); /* A31:VDD-GPU, A23:VDD-SYS */ power_failed |= axp221_set_dcdc3(1200); /* VDD-CPU */ |