aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorChristoph Egger <siccegge@cs.fau.de>2010-07-05 09:31:55 -0400
committerTony Lindgren <tony@atomide.com>2010-07-05 10:03:59 -0400
commit74b86b3d57211129cd165a4de8b59258830bfaaa (patch)
tree157c77dc18dcf628a5755f77468ce1366c62155b /arch/arm
parent3c8ed2a90e7b8ce34dbf4cb35b67b48e351308fa (diff)
Removing dead APM
APM doesn't exist in Kconfig, therefore removing all references for it from the source code. Signed-off-by: Christoph Egger <siccegge@cs.fau.de> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-omap1/board-palmte.c84
1 files changed, 0 insertions, 84 deletions
diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c
index 51d5c4dc7967..514564f1df22 100644
--- a/arch/arm/mach-omap1/board-palmte.c
+++ b/arch/arm/mach-omap1/board-palmte.c
@@ -213,90 +213,6 @@ static struct omap_lcd_config palmte_lcd_config __initdata = {
213 .ctrl_name = "internal", 213 .ctrl_name = "internal",
214}; 214};
215 215
216#ifdef CONFIG_APM
217/*
218 * Values measured in 10 minute intervals averaged over 10 samples.
219 * May differ slightly from device to device but should be accurate
220 * enough to give basic idea of battery life left and trigger
221 * potential alerts.
222 */
223static const int palmte_battery_sample[] = {
224 2194, 2157, 2138, 2120,
225 2104, 2089, 2075, 2061,
226 2048, 2038, 2026, 2016,
227 2008, 1998, 1989, 1980,
228 1970, 1958, 1945, 1928,
229 1910, 1888, 1860, 1827,
230 1791, 1751, 1709, 1656,
231};
232
233#define INTERVAL 10
234#define BATTERY_HIGH_TRESHOLD 66
235#define BATTERY_LOW_TRESHOLD 33
236
237static void palmte_get_power_status(struct apm_power_info *info, int *battery)
238{
239 int charging, batt, hi, lo, mid;
240
241 charging = !gpio_get_value(PALMTE_DC_GPIO);
242 batt = battery[0];
243 if (charging)
244 batt -= 60;
245
246 hi = ARRAY_SIZE(palmte_battery_sample);
247 lo = 0;
248
249 info->battery_flag = 0;
250 info->units = APM_UNITS_MINS;
251
252 if (batt > palmte_battery_sample[lo]) {
253 info->battery_life = 100;
254 info->time = INTERVAL * ARRAY_SIZE(palmte_battery_sample);
255 } else if (batt <= palmte_battery_sample[hi - 1]) {
256 info->battery_life = 0;
257 info->time = 0;
258 } else {
259 while (hi > lo + 1) {
260 mid = (hi + lo) >> 1;
261 if (batt <= palmte_battery_sample[mid])
262 lo = mid;
263 else
264 hi = mid;
265 }
266
267 mid = palmte_battery_sample[lo] - palmte_battery_sample[hi];
268 hi = palmte_battery_sample[lo] - batt;
269 info->battery_life = 100 - (100 * lo + 100 * hi / mid) /
270 ARRAY_SIZE(palmte_battery_sample);
271 info->time = INTERVAL * (ARRAY_SIZE(palmte_battery_sample) -
272 lo) - INTERVAL * hi / mid;
273 }
274
275 if (charging) {
276 info->ac_line_status = APM_AC_ONLINE;
277 info->battery_status = APM_BATTERY_STATUS_CHARGING;
278 info->battery_flag |= APM_BATTERY_FLAG_CHARGING;
279 } else {
280 info->ac_line_status = APM_AC_OFFLINE;
281 if (info->battery_life > BATTERY_HIGH_TRESHOLD)
282 info->battery_status = APM_BATTERY_STATUS_HIGH;
283 else if (info->battery_life > BATTERY_LOW_TRESHOLD)
284 info->battery_status = APM_BATTERY_STATUS_LOW;
285 else
286 info->battery_status = APM_BATTERY_STATUS_CRITICAL;
287 }
288
289 if (info->battery_life > BATTERY_HIGH_TRESHOLD)
290 info->battery_flag |= APM_BATTERY_FLAG_HIGH;
291 else if (info->battery_life > BATTERY_LOW_TRESHOLD)
292 info->battery_flag |= APM_BATTERY_FLAG_LOW;
293 else
294 info->battery_flag |= APM_BATTERY_FLAG_CRITICAL;
295}
296#else
297#define palmte_get_power_status NULL
298#endif
299
300static struct omap_board_config_kernel palmte_config[] __initdata = { 216static struct omap_board_config_kernel palmte_config[] __initdata = {
301 { OMAP_TAG_LCD, &palmte_lcd_config }, 217 { OMAP_TAG_LCD, &palmte_lcd_config },
302}; 218};