summaryrefslogtreecommitdiff
path: root/firmware/target/arm/imx233/adc-imx233.c
diff options
context:
space:
mode:
authorAmaury Pouly <pamaury@rockbox.org>2011-11-14 21:42:43 +0000
committerAmaury Pouly <pamaury@rockbox.org>2011-11-14 21:42:43 +0000
commitea8570b48c13b7d86704652cac00934f8831b474 (patch)
tree5fde2873172a22fb303a57a1e49ebe5eaf3929bc /firmware/target/arm/imx233/adc-imx233.c
parentf791a81e87fc6a4a680158e0c92dcd562de8fbbb (diff)
imx233: remove virtual 5V channel (value doesn't make sense), fix battery conversion (need to trigger delay)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30986 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/imx233/adc-imx233.c')
-rw-r--r--firmware/target/arm/imx233/adc-imx233.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/firmware/target/arm/imx233/adc-imx233.c b/firmware/target/arm/imx233/adc-imx233.c
index 5e9717b922..21447bbda7 100644
--- a/firmware/target/arm/imx233/adc-imx233.c
+++ b/firmware/target/arm/imx233/adc-imx233.c
@@ -59,6 +59,7 @@ void adc_init(void)
* conversions per seconds */
imx233_lradc_setup_delay(battery_delay_chan, 1 << battery_chan,
1 << battery_delay_chan, 0, 200);
+ imx233_lradc_kick_delay(battery_delay_chan);
/* enable automatic conversion, use Li-Ion type battery */
imx233_lradc_setup_battery_conversion(true, HW_LRADC_CONVERSION__SCALE_FACTOR__LI_ION);
}
@@ -86,12 +87,9 @@ unsigned short adc_read_virtual(int c)
switch(c)
{
case IMX233_ADC_BATTERY:
- return /*imx233_lradc_read_battery_voltage()*/adc_read_physical_ex(battery_chan);
+ return adc_read_physical_ex(battery_chan);
case IMX233_ADC_VDDIO:
return adc_read_physical_ex(vddio_chan);
- case IMX233_ADC_5V:
- /* channel 15 5V has a 4:1 built it divider */
- return adc_read_physical(HW_LRADC_CHANNEL_5V) * 4;
case IMX233_ADC_DIE_TEMP:
// do kelvin to celsius conversion
return imx233_lradc_sense_die_temperature(nmos_chan, pmos_chan) - 273;