summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/imx233/powermgmt-imx233.c
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2016-05-28 16:50:07 +0100
committerAmaury Pouly <amaury.pouly@gmail.com>2016-05-28 16:50:07 +0100
commitae7dd5388dca29acca5b07a591f23d95b5fbcf28 (patch)
treeffec97af85c16c372e22e70a0641d8fce39b45ab /firmware/target/arm/imx233/powermgmt-imx233.c
parentc926a5269e4af6119d54711becc72d7e94d9d5a9 (diff)
downloadrockbox-ae7dd5388dca29acca5b07a591f23d95b5fbcf28.tar.gz
rockbox-ae7dd5388dca29acca5b07a591f23d95b5fbcf28.tar.bz2
rockbox-ae7dd5388dca29acca5b07a591f23d95b5fbcf28.zip
imx233: fix red
stop pretending that stmp3600 and stmp3700 have a 4.2V power rail Change-Id: If2506ed3e7c5db96dedc668f0931d59a5197dd88
Diffstat (limited to 'firmware/target/arm/imx233/powermgmt-imx233.c')
-rw-r--r--firmware/target/arm/imx233/powermgmt-imx233.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/firmware/target/arm/imx233/powermgmt-imx233.c b/firmware/target/arm/imx233/powermgmt-imx233.c
index 2706ee99fa..3aee5934b9 100644
--- a/firmware/target/arm/imx233/powermgmt-imx233.c
+++ b/firmware/target/arm/imx233/powermgmt-imx233.c
@@ -70,6 +70,7 @@ void imx233_powermgmt_init(void)
#define MAX_4P2_ILIMIT 0x3f
+#if IMX233_SUBTARGET >= 3780
/* The code below assumes HZ = 100 so that it runs every 10ms */
#if HZ != 100
#warning The ramp_up_4p2_rail() tick task assumes HZ = 100, this may break charging
@@ -81,11 +82,15 @@ static void ramp_up_4p2_rail(void)
if(charge_state == TRICKLE && BF_RD(POWER_5VCTRL, CHARGE_4P2_ILIMIT) < MAX_4P2_ILIMIT)
HW_POWER_5VCTRL += BF_POWER_5VCTRL_CHARGE_4P2_ILIMIT(1);
}
+#endif /* IMX233_SUBTARGET >= 3780 */
void powermgmt_init_target(void)
{
charge_state = DISCHARGING;
+ /* stmp < 3780 does not have a 4.2 rail */
+#if IMX233_SUBTARGET >= 3780
tick_add_task(&ramp_up_4p2_rail);
+#endif
}
void charging_algorithm_step(void)
@@ -191,7 +196,9 @@ void charging_algorithm_step(void)
void charging_algorithm_close(void)
{
+#if IMX233_SUBTARGET >= 3780
tick_remove_task(&ramp_up_4p2_rail);
+#endif
}
struct imx233_powermgmt_info_t imx233_powermgmt_get_info(void)