diff options
author | Thomas Martitz <kugel@rockbox.org> | 2011-12-31 13:34:56 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2011-12-31 13:34:56 +0000 |
commit | 05f12e08772d1ca03101b176e329bfd313daf673 (patch) | |
tree | 56ce125d3bd3c2c1d3e5588b2a3ddab1b8a460ab /firmware/export | |
parent | 07605a659e06efaedb325e9a91214be503188f06 (diff) | |
download | rockbox-05f12e08772d1ca03101b176e329bfd313daf673.tar.gz rockbox-05f12e08772d1ca03101b176e329bfd313daf673.zip |
ypr0: Enable battery voltage read-out, charging monitoring and charger detection.
Voltage can be read using as3543 adc (i.e. ascodec api, on this target implemented
via ioctl()). TODO: Look into possibly controlling charging more by re-using
powermgmt-ascodec.c. However, charging seems to be controlled by the kernel,
so may not be needed.
Charger state can be read using /dev/minivet. It allows to differentiate between
wall charger and usb charging, but that's not implemented (is it even worthwhile?)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31470 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export')
-rw-r--r-- | firmware/export/config/samsungypr0.h | 18 | ||||
-rw-r--r-- | firmware/export/power.h | 3 | ||||
-rw-r--r-- | firmware/export/powermgmt.h | 2 | ||||
-rw-r--r-- | firmware/export/storage.h | 2 |
4 files changed, 14 insertions, 11 deletions
diff --git a/firmware/export/config/samsungypr0.h b/firmware/export/config/samsungypr0.h index 25e1906a80..8d133c4e24 100644 --- a/firmware/export/config/samsungypr0.h +++ b/firmware/export/config/samsungypr0.h | |||
@@ -21,7 +21,7 @@ | |||
21 | #define USB_NONE | 21 | #define USB_NONE |
22 | 22 | ||
23 | /* Hardware controlled charging with monitoring */ | 23 | /* Hardware controlled charging with monitoring */ |
24 | //#define CONFIG_CHARGING CHARGING_MONITOR | 24 | #define CONFIG_CHARGING CHARGING_MONITOR |
25 | 25 | ||
26 | /* There is only USB charging */ | 26 | /* There is only USB charging */ |
27 | //#define HAVE_USB_POWER | 27 | //#define HAVE_USB_POWER |
@@ -127,16 +127,16 @@ | |||
127 | 127 | ||
128 | /* Define current usage levels. */ | 128 | /* Define current usage levels. */ |
129 | /* TODO: to be filled with correct values after implementing power management */ | 129 | /* TODO: to be filled with correct values after implementing power management */ |
130 | #define CURRENT_NORMAL 88 /* 18 hours from a 1600 mAh battery */ | 130 | //#define CURRENT_NORMAL 88 /* 18 hours from a 1600 mAh battery */ |
131 | #define CURRENT_BACKLIGHT 30 /* TBD */ | 131 | //#define CURRENT_BACKLIGHT 30 /* TBD */ |
132 | #define CURRENT_RECORD 0 /* no recording yet */ | 132 | //#define CURRENT_RECORD 0 /* no recording yet */ |
133 | 133 | ||
134 | /* TODO: We need to do battery handling */ | 134 | /* TODO: We need to do battery handling */ |
135 | //#define BATTERY_CAPACITY_DEFAULT 600 /* default battery capacity */ | 135 | #define BATTERY_CAPACITY_DEFAULT 600 /* default battery capacity */ |
136 | //#define BATTERY_CAPACITY_MIN 600 /* min. capacity selectable */ | 136 | #define BATTERY_CAPACITY_MIN 600 /* min. capacity selectable */ |
137 | //#define BATTERY_CAPACITY_MAX 700 /* max. capacity selectable */ | 137 | #define BATTERY_CAPACITY_MAX 600 /* max. capacity selectable */ |
138 | //#define BATTERY_CAPACITY_INC 50 /* capacity increment */ | 138 | #define BATTERY_CAPACITY_INC 0 /* capacity increment */ |
139 | //#define BATTERY_TYPES_COUNT 1 /* only one type */ | 139 | #define BATTERY_TYPES_COUNT 1 /* only one type */ |
140 | 140 | ||
141 | /* TODO: We possibly can only watch linux charging */ | 141 | /* TODO: We possibly can only watch linux charging */ |
142 | //#define CONFIG_CHARGING CHARGING_TARGET | 142 | //#define CONFIG_CHARGING CHARGING_TARGET |
diff --git a/firmware/export/power.h b/firmware/export/power.h index d46b9ba924..4937705910 100644 --- a/firmware/export/power.h +++ b/firmware/export/power.h | |||
@@ -23,6 +23,7 @@ | |||
23 | 23 | ||
24 | #include "config.h" | 24 | #include "config.h" |
25 | 25 | ||
26 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) || defined(SAMSUNG_YPR0) | ||
26 | #if CONFIG_CHARGING | 27 | #if CONFIG_CHARGING |
27 | enum power_input_flags { | 28 | enum power_input_flags { |
28 | /* No external power source? Default. */ | 29 | /* No external power source? Default. */ |
@@ -100,4 +101,6 @@ bool tuner_power(bool status); | |||
100 | bool tuner_powered(void); | 101 | bool tuner_powered(void); |
101 | #endif | 102 | #endif |
102 | 103 | ||
104 | #endif | ||
105 | |||
103 | #endif /* _POWER_H_ */ | 106 | #endif /* _POWER_H_ */ |
diff --git a/firmware/export/powermgmt.h b/firmware/export/powermgmt.h index d54f1d5a18..837767f56b 100644 --- a/firmware/export/powermgmt.h +++ b/firmware/export/powermgmt.h | |||
@@ -78,7 +78,7 @@ extern unsigned int power_thread_inputs; | |||
78 | /* Start up power management thread */ | 78 | /* Start up power management thread */ |
79 | void powermgmt_init(void) INIT_ATTR; | 79 | void powermgmt_init(void) INIT_ATTR; |
80 | 80 | ||
81 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) | 81 | #if (CONFIG_PLATFORM & PLATFORM_NATIVE) || defined(SAMSUNG_YPR0) |
82 | 82 | ||
83 | /* Generic current values that are intentionally meaningless - config header | 83 | /* Generic current values that are intentionally meaningless - config header |
84 | * should define proper numbers.*/ | 84 | * should define proper numbers.*/ |
diff --git a/firmware/export/storage.h b/firmware/export/storage.h index 58d8d32b6d..6c875bc847 100644 --- a/firmware/export/storage.h +++ b/firmware/export/storage.h | |||
@@ -71,7 +71,7 @@ static inline void stub_storage_spindown(int timeout) { (void)timeout; } | |||
71 | 71 | ||
72 | #define storage_enable(on) | 72 | #define storage_enable(on) |
73 | #define storage_sleepnow() | 73 | #define storage_sleepnow() |
74 | #define storage_disk_is_active() | 74 | #define storage_disk_is_active() 0 |
75 | #define storage_soft_reset() | 75 | #define storage_soft_reset() |
76 | #define storage_init() | 76 | #define storage_init() |
77 | #define storage_close() | 77 | #define storage_close() |