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) |
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 @@ #define USB_NONE /* Hardware controlled charging with monitoring */ -//#define CONFIG_CHARGING CHARGING_MONITOR +#define CONFIG_CHARGING CHARGING_MONITOR /* There is only USB charging */ //#define HAVE_USB_POWER @@ -127,16 +127,16 @@ /* Define current usage levels. */ /* TODO: to be filled with correct values after implementing power management */ -#define CURRENT_NORMAL 88 /* 18 hours from a 1600 mAh battery */ -#define CURRENT_BACKLIGHT 30 /* TBD */ -#define CURRENT_RECORD 0 /* no recording yet */ +//#define CURRENT_NORMAL 88 /* 18 hours from a 1600 mAh battery */ +//#define CURRENT_BACKLIGHT 30 /* TBD */ +//#define CURRENT_RECORD 0 /* no recording yet */ /* TODO: We need to do battery handling */ -//#define BATTERY_CAPACITY_DEFAULT 600 /* default battery capacity */ -//#define BATTERY_CAPACITY_MIN 600 /* min. capacity selectable */ -//#define BATTERY_CAPACITY_MAX 700 /* max. capacity selectable */ -//#define BATTERY_CAPACITY_INC 50 /* capacity increment */ -//#define BATTERY_TYPES_COUNT 1 /* only one type */ +#define BATTERY_CAPACITY_DEFAULT 600 /* default battery capacity */ +#define BATTERY_CAPACITY_MIN 600 /* min. capacity selectable */ +#define BATTERY_CAPACITY_MAX 600 /* max. capacity selectable */ +#define BATTERY_CAPACITY_INC 0 /* capacity increment */ +#define BATTERY_TYPES_COUNT 1 /* only one type */ /* TODO: We possibly can only watch linux charging */ //#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 @@ #include "config.h" +#if (CONFIG_PLATFORM & PLATFORM_NATIVE) || defined(SAMSUNG_YPR0) #if CONFIG_CHARGING enum power_input_flags { /* No external power source? Default. */ @@ -100,4 +101,6 @@ bool tuner_power(bool status); bool tuner_powered(void); #endif +#endif + #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; /* Start up power management thread */ void powermgmt_init(void) INIT_ATTR; -#if (CONFIG_PLATFORM & PLATFORM_NATIVE) +#if (CONFIG_PLATFORM & PLATFORM_NATIVE) || defined(SAMSUNG_YPR0) /* Generic current values that are intentionally meaningless - config header * 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; } #define storage_enable(on) #define storage_sleepnow() - #define storage_disk_is_active() + #define storage_disk_is_active() 0 #define storage_soft_reset() #define storage_init() #define storage_close() |