summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/imx233/powermgmt-imx233.c
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2013-06-17 00:26:24 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2013-06-17 00:29:25 +0200
commit8d7cc320b720c088a8ccb7e33ed85a7de0b89aeb (patch)
tree3286f13c637aef007b67823241bb63552d3ecae8 /firmware/target/arm/imx233/powermgmt-imx233.c
parent2ed36fc4a244549fab3fb7129776a98ec2bf74ca (diff)
downloadrockbox-8d7cc320b720c088a8ccb7e33ed85a7de0b89aeb.tar.gz
rockbox-8d7cc320b720c088a8ccb7e33ed85a7de0b89aeb.tar.bz2
rockbox-8d7cc320b720c088a8ccb7e33ed85a7de0b89aeb.zip
imx233: only do power management on imx233
Power management is somewhat different on stmp3700 which doesn't have the 4.2V rail and completely different on stmp3600 which has several DCDC. Currently only handle imx233. Change-Id: Ic7815141286117b74022ffc53cfa48664fd7faac
Diffstat (limited to 'firmware/target/arm/imx233/powermgmt-imx233.c')
-rw-r--r--firmware/target/arm/imx233/powermgmt-imx233.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/firmware/target/arm/imx233/powermgmt-imx233.c b/firmware/target/arm/imx233/powermgmt-imx233.c
index b155b5fcb8..8980124b33 100644
--- a/firmware/target/arm/imx233/powermgmt-imx233.c
+++ b/firmware/target/arm/imx233/powermgmt-imx233.c
@@ -48,6 +48,7 @@ void powermgmt_init_target(void)
{
imx233_power_set_charge_current(IMX233_CHARGE_CURRENT);
imx233_power_set_stop_current(IMX233_STOP_CURRENT);
+#if IMX233_SUBTARGET >= 3780
/* assume that adc_init was called and battery monitoring via LRADC setup */
BF_WR(POWER_BATTMONITOR, EN_BATADJ, 1);
/* make sure we are in a known state: disable charger and 4p2 */
@@ -55,11 +56,13 @@ void powermgmt_init_target(void)
BF_WR(POWER_DCDC4P2, ENABLE_DCDC, 0);
BF_WR(POWER_DCDC4P2, ENABLE_4P2, 0);
BF_SET(POWER_5VCTRL, PWD_CHARGE_4P2);
+#endif
charge_state = DISCHARGING;
}
void charging_algorithm_step(void)
{
+#if IMX233_SUBTARGET >= 3780
bool is_5v_present = usb_detect() == USB_INSERTED;
/* initial state & 5v -> battery transition */
@@ -139,6 +142,7 @@ void charging_algorithm_step(void)
BF_SET(POWER_CHARGE, PWD_BATTCHRG);
charge_state = CHARGE_STATE_DISABLED;
}
+#endif
}
void charging_algorithm_close(void)