diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2016-05-28 16:50:07 +0100 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2016-05-28 16:50:07 +0100 |
commit | ae7dd5388dca29acca5b07a591f23d95b5fbcf28 (patch) | |
tree | ffec97af85c16c372e22e70a0641d8fce39b45ab /firmware/target/arm/imx233/powermgmt-imx233.c | |
parent | c926a5269e4af6119d54711becc72d7e94d9d5a9 (diff) | |
download | rockbox-ae7dd5388dca29acca5b07a591f23d95b5fbcf28.tar.gz 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.c | 7 |
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) | |||
70 | 70 | ||
71 | #define MAX_4P2_ILIMIT 0x3f | 71 | #define MAX_4P2_ILIMIT 0x3f |
72 | 72 | ||
73 | #if IMX233_SUBTARGET >= 3780 | ||
73 | /* The code below assumes HZ = 100 so that it runs every 10ms */ | 74 | /* The code below assumes HZ = 100 so that it runs every 10ms */ |
74 | #if HZ != 100 | 75 | #if HZ != 100 |
75 | #warning The ramp_up_4p2_rail() tick task assumes HZ = 100, this may break charging | 76 | #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) | |||
81 | if(charge_state == TRICKLE && BF_RD(POWER_5VCTRL, CHARGE_4P2_ILIMIT) < MAX_4P2_ILIMIT) | 82 | if(charge_state == TRICKLE && BF_RD(POWER_5VCTRL, CHARGE_4P2_ILIMIT) < MAX_4P2_ILIMIT) |
82 | HW_POWER_5VCTRL += BF_POWER_5VCTRL_CHARGE_4P2_ILIMIT(1); | 83 | HW_POWER_5VCTRL += BF_POWER_5VCTRL_CHARGE_4P2_ILIMIT(1); |
83 | } | 84 | } |
85 | #endif /* IMX233_SUBTARGET >= 3780 */ | ||
84 | 86 | ||
85 | void powermgmt_init_target(void) | 87 | void powermgmt_init_target(void) |
86 | { | 88 | { |
87 | charge_state = DISCHARGING; | 89 | charge_state = DISCHARGING; |
90 | /* stmp < 3780 does not have a 4.2 rail */ | ||
91 | #if IMX233_SUBTARGET >= 3780 | ||
88 | tick_add_task(&ramp_up_4p2_rail); | 92 | tick_add_task(&ramp_up_4p2_rail); |
93 | #endif | ||
89 | } | 94 | } |
90 | 95 | ||
91 | void charging_algorithm_step(void) | 96 | void charging_algorithm_step(void) |
@@ -191,7 +196,9 @@ void charging_algorithm_step(void) | |||
191 | 196 | ||
192 | void charging_algorithm_close(void) | 197 | void charging_algorithm_close(void) |
193 | { | 198 | { |
199 | #if IMX233_SUBTARGET >= 3780 | ||
194 | tick_remove_task(&ramp_up_4p2_rail); | 200 | tick_remove_task(&ramp_up_4p2_rail); |
201 | #endif | ||
195 | } | 202 | } |
196 | 203 | ||
197 | struct imx233_powermgmt_info_t imx233_powermgmt_get_info(void) | 204 | struct imx233_powermgmt_info_t imx233_powermgmt_get_info(void) |