diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2012-05-19 13:08:05 +0200 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2012-05-19 16:10:51 +0200 |
commit | 25feb00a6463dc131a7413d127ea7e5737a35a16 (patch) | |
tree | 6d07b9bada338e9769849c719980391b60cef120 /firmware | |
parent | bc4631055fec68bb842057dd5dade9f7e05d9266 (diff) |
imx233: rework adc battery temperature sensor handling
Change-Id: I770729d7246b0ad8bc6fc5d6e45861325f6b790c
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/target/arm/imx233/adc-imx233.c | 8 | ||||
-rw-r--r-- | firmware/target/arm/imx233/adc-imx233.h | 6 | ||||
-rw-r--r-- | firmware/target/arm/imx233/sansa-fuzeplus/adc-target.h | 2 | ||||
-rw-r--r-- | firmware/target/arm/imx233/sansa-fuzeplus/powermgmt-target.h | 12 |
4 files changed, 17 insertions, 11 deletions
diff --git a/firmware/target/arm/imx233/adc-imx233.c b/firmware/target/arm/imx233/adc-imx233.c index b24f7f6c43..2d2f0de517 100644 --- a/firmware/target/arm/imx233/adc-imx233.c +++ b/firmware/target/arm/imx233/adc-imx233.c @@ -19,10 +19,6 @@ * ****************************************************************************/ -#include "config.h" -#include "adc.h" -#include "adc-target.h" -#include "system.h" #include "adc-imx233.h" void adc_init(void) @@ -73,11 +69,11 @@ static short adc_read_virtual(int c) imx233_lradc_release_channel(nmos_chan); return val; } -#ifdef IMX233_ADC_BATT_TEMP_SENSOR +#ifdef IMX233_BATT_TEMP_SENSOR case IMX233_ADC_BATT_TEMP: { int virt = imx233_lradc_acquire_channel(TIMEOUT_BLOCK); - int val = imx233_lradc_sense_ext_temperature(virt, IMX233_ADC_BATT_TEMP_SENSOR); + int val = imx233_lradc_sense_ext_temperature(virt, IMX233_BATT_TEMP_SENSOR); imx233_lradc_release_channel(virt); return val; } diff --git a/firmware/target/arm/imx233/adc-imx233.h b/firmware/target/arm/imx233/adc-imx233.h index c54e79dc8d..09fd7eb013 100644 --- a/firmware/target/arm/imx233/adc-imx233.h +++ b/firmware/target/arm/imx233/adc-imx233.h @@ -22,15 +22,17 @@ #define _ADC_IMX233_H_ #include "system.h" +#include "adc.h" +#include "adc-target.h" +#include "powermgmt-target.h" #include "lradc-imx233.h" -#include "adc-imx233.h" /* Virtual channels */ #define IMX233_ADC_BATTERY -1 /* Battery voltage (mV) */ #define IMX233_ADC_DIE_TEMP -2 /* Die temperature (°C) */ #define IMX233_ADC_VDDIO -3 /* VddIO voltage (mV) */ #define IMX233_ADC_VDD5V -4 /* Vdd5V voltage (mV) */ -#ifdef IMX233_ADC_BATT_TEMP_SENSOR +#ifdef IMX233_BATT_TEMP_SENSOR #define IMX233_ADC_BATT_TEMP -5 /* Battery temperature (°C) */ #endif diff --git a/firmware/target/arm/imx233/sansa-fuzeplus/adc-target.h b/firmware/target/arm/imx233/sansa-fuzeplus/adc-target.h index 5907eefdc2..9fccfa9da4 100644 --- a/firmware/target/arm/imx233/sansa-fuzeplus/adc-target.h +++ b/firmware/target/arm/imx233/sansa-fuzeplus/adc-target.h @@ -30,6 +30,4 @@ #define ADC_BATT_TEMP 4 #define ADC_CH2 5 -#define IMX233_ADC_BATT_TEMP_SENSOR 0 - #endif diff --git a/firmware/target/arm/imx233/sansa-fuzeplus/powermgmt-target.h b/firmware/target/arm/imx233/sansa-fuzeplus/powermgmt-target.h index 34d1d00e1d..2fd5559baf 100644 --- a/firmware/target/arm/imx233/sansa-fuzeplus/powermgmt-target.h +++ b/firmware/target/arm/imx233/sansa-fuzeplus/powermgmt-target.h @@ -37,12 +37,22 @@ * - top off period: 30 min * - high die temperature: 71 °C * - low die temperature: 56 °C - * - safe temperature current: 30 mA + * - safe die temperature current: 30 mA + * - battery temperature channel: 0 + * - high battery temperature: 1100 + * - low battery temperature: 220 + * - safe battery temperature current: 0 mA + * - low DCDC battery voltage: 3.9 V */ #define IMX233_CHARGE_CURRENT 200 #define IMX233_STOP_CURRENT 30 #define IMX233_TOPOFF_TIMEOUT (30 * 60 * HZ) #define IMX233_CHARGING_TIMEOUT (4 * 3600 * HZ) +#define IMX233_DIE_TEMP_HIGH 71 +#define IMX233_DIE_TEMP_LOW 56 +#define IMX233_BATT_TEMP_SENSOR 0 +#define IMX233_BATT_TEMP_HIGH 1100 +#define IMX233_BATT_TEMP_LOW 220 #endif /* POWERMGMT_TARGET_H */ |