summaryrefslogtreecommitdiff
path: root/firmware/powermgmt.c
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2011-12-31 13:34:56 +0000
committerThomas Martitz <kugel@rockbox.org>2011-12-31 13:34:56 +0000
commit05f12e08772d1ca03101b176e329bfd313daf673 (patch)
tree56ce125d3bd3c2c1d3e5588b2a3ddab1b8a460ab /firmware/powermgmt.c
parent07605a659e06efaedb325e9a91214be503188f06 (diff)
downloadrockbox-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/powermgmt.c')
-rw-r--r--firmware/powermgmt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c
index 4d554d6d3c..6027414b71 100644
--- a/firmware/powermgmt.c
+++ b/firmware/powermgmt.c
@@ -86,7 +86,7 @@ void handle_auto_poweroff(void);
86static int poweroff_timeout = 0; 86static int poweroff_timeout = 0;
87static long last_event_tick = 0; 87static long last_event_tick = 0;
88 88
89#if (CONFIG_PLATFORM & PLATFORM_NATIVE) 89#if (CONFIG_PLATFORM & PLATFORM_NATIVE) || defined(SAMSUNG_YPR0)
90/* 90/*
91 * Average battery voltage and charger voltage, filtered via a digital 91 * Average battery voltage and charger voltage, filtered via a digital
92 * exponential filter (aka. exponential moving average, scaled): 92 * exponential filter (aka. exponential moving average, scaled):
@@ -108,7 +108,7 @@ static int battery_type = 0;
108/* Power history: power_history[0] is the newest sample */ 108/* Power history: power_history[0] is the newest sample */
109unsigned short power_history[POWER_HISTORY_LEN] = {0}; 109unsigned short power_history[POWER_HISTORY_LEN] = {0};
110 110
111#if CONFIG_CPU == JZ4732 /* FIXME! */ 111#if CONFIG_CPU == JZ4732 /* FIXME! */ || (CONFIG_PLATFORM & PLATFORM_HOSTED)
112static char power_stack[DEFAULT_STACK_SIZE + POWERMGMT_DEBUG_STACK]; 112static char power_stack[DEFAULT_STACK_SIZE + POWERMGMT_DEBUG_STACK];
113#else 113#else
114static char power_stack[DEFAULT_STACK_SIZE/2 + POWERMGMT_DEBUG_STACK]; 114static char power_stack[DEFAULT_STACK_SIZE/2 + POWERMGMT_DEBUG_STACK];