Re: zaurus: cleanup sharpsl_pm.c

From: Eric Miao
Date: Thu Oct 22 2009 - 14:27:21 EST


> Introduce separate set of battery limits for corgi. This fixes
> compilation, and the values probably should be subtly different, too.
>

[Why I'm receiving this for twice ....?]

Pavel,

Anyway, I was thinkin maybe we need a shared table before there
are real requirements for different machines to have their own?

> Signed-off-by: Pavel Machek <pavel@xxxxxx>
>
> diff -ur linux-rc/arch/arm.ofic/mach-pxa/corgi_pm.c linux-rc/arch/arm/mach-pxa/corgi_pm.c
> --- linux-rc/arch/arm.ofic/mach-pxa/corgi_pm.c Â2009-09-10 00:13:59.000000000 +0200
> +++ linux-rc/arch/arm/mach-pxa/corgi_pm.c    2009-10-22 19:19:02.000000000 +0200
> @@ -35,6 +35,92 @@
> Â#define SHARPSL_FATAL_ACIN_VOLT Â Â Â Â182 Â /* 3.45V */
> Â#define SHARPSL_FATAL_NOACIN_VOLT Â Â Â170 Â /* 3.40V */
>
> +static const struct battery_thresh corgi_battery_levels_acin[] = {
> + Â Â Â { 213, 100},
> + Â Â Â { 212, Â98},
> + Â Â Â { 211, Â95},
> + Â Â Â { 210, Â93},
> + Â Â Â { 209, Â90},
> + Â Â Â { 208, Â88},
> + Â Â Â { 207, Â85},
> + Â Â Â { 206, Â83},
> + Â Â Â { 205, Â80},
> + Â Â Â { 204, Â78},
> + Â Â Â { 203, Â75},
> + Â Â Â { 202, Â73},
> + Â Â Â { 201, Â70},
> + Â Â Â { 200, Â68},
> + Â Â Â { 199, Â65},
> + Â Â Â { 198, Â63},
> + Â Â Â { 197, Â60},
> + Â Â Â { 196, Â58},
> + Â Â Â { 195, Â55},
> + Â Â Â { 194, Â53},
> + Â Â Â { 193, Â50},
> + Â Â Â { 192, Â48},
> + Â Â Â { 192, Â45},
> + Â Â Â { 191, Â43},
> + Â Â Â { 191, Â40},
> + Â Â Â { 190, Â38},
> + Â Â Â { 190, Â35},
> + Â Â Â { 189, Â33},
> + Â Â Â { 188, Â30},
> + Â Â Â { 187, Â28},
> + Â Â Â { 186, Â25},
> + Â Â Â { 185, Â23},
> + Â Â Â { 184, Â20},
> + Â Â Â { 183, Â18},
> + Â Â Â { 182, Â15},
> + Â Â Â { 181, Â13},
> + Â Â Â { 180, Â10},
> + Â Â Â { 179, Â 8},
> + Â Â Â { 178, Â 5},
> + Â Â Â { Â 0, Â 0},
> +};
> +
> +static const struct battery_thresh Âcorgi_battery_levels_noac[] = {
> + Â Â Â { 213, 100},
> + Â Â Â { 212, Â98},
> + Â Â Â { 211, Â95},
> + Â Â Â { 210, Â93},
> + Â Â Â { 209, Â90},
> + Â Â Â { 208, Â88},
> + Â Â Â { 207, Â85},
> + Â Â Â { 206, Â83},
> + Â Â Â { 205, Â80},
> + Â Â Â { 204, Â78},
> + Â Â Â { 203, Â75},
> + Â Â Â { 202, Â73},
> + Â Â Â { 201, Â70},
> + Â Â Â { 200, Â68},
> + Â Â Â { 199, Â65},
> + Â Â Â { 198, Â63},
> + Â Â Â { 197, Â60},
> + Â Â Â { 196, Â58},
> + Â Â Â { 195, Â55},
> + Â Â Â { 194, Â53},
> + Â Â Â { 193, Â50},
> + Â Â Â { 192, Â48},
> + Â Â Â { 191, Â45},
> + Â Â Â { 190, Â43},
> + Â Â Â { 189, Â40},
> + Â Â Â { 188, Â38},
> + Â Â Â { 187, Â35},
> + Â Â Â { 186, Â33},
> + Â Â Â { 185, Â30},
> + Â Â Â { 184, Â28},
> + Â Â Â { 183, Â25},
> + Â Â Â { 182, Â23},
> + Â Â Â { 181, Â20},
> + Â Â Â { 180, Â18},
> + Â Â Â { 179, Â15},
> + Â Â Â { 178, Â13},
> + Â Â Â { 177, Â10},
> + Â Â Â { 176, Â 8},
> + Â Â Â { 175, Â 5},
> + Â Â Â { Â 0, Â 0},
> +};
> +
> Âstatic void corgi_charger_init(void)
> Â{
> Â Â Â Âpxa_gpio_mode(CORGI_GPIO_ADC_TEMP_ON | GPIO_OUT);
> @@ -214,8 +300,8 @@
> Â Â Â Â.fatal_acin_volt Â= SHARPSL_FATAL_ACIN_VOLT,
> Â Â Â Â.fatal_noacin_volt= SHARPSL_FATAL_NOACIN_VOLT,
>    Â.bat_levels    = 40,
> - Â Â Â .bat_levels_noac Â= spitz_battery_levels_noac,
> - Â Â Â .bat_levels_acin Â= spitz_battery_levels_acin,
> + Â Â Â .bat_levels_noac Â= corgi_battery_levels_noac,
> + Â Â Â .bat_levels_acin Â= corgi_battery_levels_acin,
> Â Â Â Â.status_high_acin = 188,
> Â Â Â Â.status_low_acin Â= 178,
> Â Â Â Â.status_high_noac = 185,
>
>
> --
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
>
èº{.nÇ+‰·Ÿ®‰­†+%ŠËlzwm…ébëæìr¸›zX§»®w¥Š{ayºÊÚë,j­¢f£¢·hš‹àz¹®w¥¢¸ ¢·¦j:+v‰¨ŠwèjØm¶Ÿÿ¾«‘êçzZ+ƒùšŽŠÝj"ú!¶iO•æ¬z·švØ^¶m§ÿðà nÆàþY&—