summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/export/powermgmt.h2
-rw-r--r--firmware/target/arm/as3525/powermgmt-target.h4
-rw-r--r--firmware/target/arm/imx31/gigabeat-s/powermgmt-target.h4
-rw-r--r--firmware/target/arm/philips/sa9200/powermgmt-target.h4
-rw-r--r--firmware/target/arm/sandisk/powermgmt-target.h4
-rw-r--r--firmware/target/sh/archos/recorder/powermgmt-recorder.c8
-rw-r--r--firmware/target/sh/archos/recorder/powermgmt-target.h14
7 files changed, 8 insertions, 32 deletions
diff --git a/firmware/export/powermgmt.h b/firmware/export/powermgmt.h
index 9e9d3d0fd8..14d0078c31 100644
--- a/firmware/export/powermgmt.h
+++ b/firmware/export/powermgmt.h
@@ -139,6 +139,8 @@ int _battery_time(void); /* minutes */
139int _battery_voltage(void); /* voltage in millivolts */ 139int _battery_voltage(void); /* voltage in millivolts */
140#if CONFIG_CHARGING >= CHARGING_TARGET 140#if CONFIG_CHARGING >= CHARGING_TARGET
141void powermgmt_init_target(void); 141void powermgmt_init_target(void);
142void charging_algorithm_close(void);
143void charging_algorithm_step(void);
142#endif 144#endif
143 145
144#ifdef HAVE_BATTERY_SWITCH 146#ifdef HAVE_BATTERY_SWITCH
diff --git a/firmware/target/arm/as3525/powermgmt-target.h b/firmware/target/arm/as3525/powermgmt-target.h
index f2762f3e47..3b459fa695 100644
--- a/firmware/target/arm/as3525/powermgmt-target.h
+++ b/firmware/target/arm/as3525/powermgmt-target.h
@@ -100,10 +100,6 @@
100#error "Charger settings not defined!" 100#error "Charger settings not defined!"
101#endif 101#endif
102 102
103void powermgmt_init_target(void);
104void charging_algorithm_step(void);
105void charging_algorithm_close(void);
106
107/* We want to be able to reset the averaging filter */ 103/* We want to be able to reset the averaging filter */
108#define HAVE_RESET_BATTERY_FILTER 104#define HAVE_RESET_BATTERY_FILTER
109 105
diff --git a/firmware/target/arm/imx31/gigabeat-s/powermgmt-target.h b/firmware/target/arm/imx31/gigabeat-s/powermgmt-target.h
index c881bed68c..a45d1b712f 100644
--- a/firmware/target/arm/imx31/gigabeat-s/powermgmt-target.h
+++ b/firmware/target/arm/imx31/gigabeat-s/powermgmt-target.h
@@ -107,10 +107,6 @@
107#define BATT_AVE_SAMPLES 128 107#define BATT_AVE_SAMPLES 128
108#define ICHARGER_AVE_SAMPLES 32 108#define ICHARGER_AVE_SAMPLES 32
109 109
110void powermgmt_init_target(void);
111void charging_algorithm_step(void);
112void charging_algorithm_close(void);
113
114/* Provide filtered charge current */ 110/* Provide filtered charge current */
115int battery_charge_current(void); 111int battery_charge_current(void);
116 112
diff --git a/firmware/target/arm/philips/sa9200/powermgmt-target.h b/firmware/target/arm/philips/sa9200/powermgmt-target.h
index 4400cda5d1..37ea310efe 100644
--- a/firmware/target/arm/philips/sa9200/powermgmt-target.h
+++ b/firmware/target/arm/philips/sa9200/powermgmt-target.h
@@ -36,10 +36,6 @@
36 */ 36 */
37#define ADC_BATTERY ADC_RTCSUP 37#define ADC_BATTERY ADC_RTCSUP
38 38
39void powermgmt_init_target(void);
40void charging_algorithm_step(void);
41void charging_algorithm_close(void);
42
43/* We want to be able to reset the averaging filter */ 39/* We want to be able to reset the averaging filter */
44#define HAVE_RESET_BATTERY_FILTER 40#define HAVE_RESET_BATTERY_FILTER
45 41
diff --git a/firmware/target/arm/sandisk/powermgmt-target.h b/firmware/target/arm/sandisk/powermgmt-target.h
index aa6a0e0e3d..cb1ccf55c4 100644
--- a/firmware/target/arm/sandisk/powermgmt-target.h
+++ b/firmware/target/arm/sandisk/powermgmt-target.h
@@ -47,10 +47,6 @@
47#define ADC_BATTERY ADC_RTCSUP 47#define ADC_BATTERY ADC_RTCSUP
48#endif 48#endif
49 49
50void powermgmt_init_target(void);
51void charging_algorithm_step(void);
52void charging_algorithm_close(void);
53
54/* We want to be able to reset the averaging filter */ 50/* We want to be able to reset the averaging filter */
55#define HAVE_RESET_BATTERY_FILTER 51#define HAVE_RESET_BATTERY_FILTER
56 52
diff --git a/firmware/target/sh/archos/recorder/powermgmt-recorder.c b/firmware/target/sh/archos/recorder/powermgmt-recorder.c
index 0bce1585cd..1e78b8d155 100644
--- a/firmware/target/sh/archos/recorder/powermgmt-recorder.c
+++ b/firmware/target/sh/archos/recorder/powermgmt-recorder.c
@@ -65,6 +65,10 @@ int _battery_voltage(void)
65 return (adc_read(ADC_UNREG_POWER) * BATTERY_SCALE_FACTOR) >> 10; 65 return (adc_read(ADC_UNREG_POWER) * BATTERY_SCALE_FACTOR) >> 10;
66} 66}
67 67
68void powermgmt_init_target(void)
69{
70}
71
68/** Charger control **/ 72/** Charger control **/
69#ifdef CHARGING_DEBUG_FILE 73#ifdef CHARGING_DEBUG_FILE
70#include "file.h" 74#include "file.h"
@@ -483,12 +487,12 @@ void charging_algorithm_step(void)
483 charger_enable(trickle_sec > 0); 487 charger_enable(trickle_sec > 0);
484} 488}
485 489
486#ifdef CHARGING_DEBUG_FILE
487void charging_algorithm_close(void) 490void charging_algorithm_close(void)
488{ 491{
492#ifdef CHARGING_DEBUG_FILE
489 debug_file_close(); 493 debug_file_close();
490}
491#endif /* CHARGING_DEBUG_FILE */ 494#endif /* CHARGING_DEBUG_FILE */
495}
492 496
493/* Returns true if the unit is charging the batteries. */ 497/* Returns true if the unit is charging the batteries. */
494bool charging_state(void) 498bool charging_state(void)
diff --git a/firmware/target/sh/archos/recorder/powermgmt-target.h b/firmware/target/sh/archos/recorder/powermgmt-target.h
index 7792c05185..6b68d05bd4 100644
--- a/firmware/target/sh/archos/recorder/powermgmt-target.h
+++ b/firmware/target/sh/archos/recorder/powermgmt-target.h
@@ -86,18 +86,4 @@ bool charger_enabled(void);
86/* Battery filter lengths in samples */ 86/* Battery filter lengths in samples */
87#define BATT_AVE_SAMPLES 32 87#define BATT_AVE_SAMPLES 32
88 88
89/* No init to do */
90#if !(CONFIG_PLATFORM & PLATFORM_HOSTED)
91static inline void powermgmt_init_target(void) {}
92#endif
93void charging_algorithm_step(void);
94
95#ifdef CHARGING_DEBUG_FILE
96/* Need to flush and close debug file */
97void charging_algorithm_close(void);
98#else
99/* No poweroff operation to do */
100static inline void charging_algorithm_close(void) {}
101#endif
102
103#endif /* POWERMGMT_TARGET_H */ 89#endif /* POWERMGMT_TARGET_H */