linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* spitz pm: adjust messages
@ 2011-05-21 12:24 Pavel Machek
  2011-05-21 17:27 ` Marek Vasut
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Pavel Machek @ 2011-05-21 12:24 UTC (permalink / raw)
  To: rpurdie, lenz, kernel list, arminlitzel, Cyril Hrubis,
	thommycheck, linux-arm-kernel, dbaryshkov, omegamoon,
	eric.y.miao, utx, zaurus-devel, Marek Vasut

Charger error is something that should be reported to the syslog; do
it. If temperature reading fails, we do not want to charge the
battery, anyway.

Signed-off-by: Pavel Machek <pavel@ucw.cz>

diff --git a/arch/arm/mach-pxa/sharpsl_pm.c b/arch/arm/mach-pxa/sharpsl_pm.c
index 785880f..513588c 100644
--- a/arch/arm/mach-pxa/sharpsl_pm.c
+++ b/arch/arm/mach-pxa/sharpsl_pm.c
@@ -317,6 +302,8 @@ static void sharpsl_charge_off(void)
 
 static void sharpsl_charge_error(void)
 {
+	dev_warn(sharpsl_pm.dev, "Charger Error\n");
+
 	sharpsl_pm_led(SHARPSL_LED_ERROR);
 	sharpsl_pm.machinfo->charge(0);
 	sharpsl_pm.charge_mode = CHRG_ERROR;
@@ -513,8 +500,10 @@ static int sharpsl_check_battery_temp(void)
 	val = get_select_val(buff);
 
 	dev_dbg(sharpsl_pm.dev, "Temperature: %d\n", val);
-	if (val > sharpsl_pm.machinfo->charge_on_temp) {
-		printk(KERN_WARNING "Not charging: temperature out of limits.\n");
+	/* FIXME: this should catch battery read errors, but we should
+	   probably avoid charging in <0C temperatures, too. */
+	if ((val < 0) || (val > sharpsl_pm.machinfo->charge_on_temp)) {
+		dev_warn(sharpsl_pm.dev, "Not charging: temperature %d out of limits.\n", val);
 		return -1;
 	}
 
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: spitz pm: adjust messages
  2011-05-21 12:24 spitz pm: adjust messages Pavel Machek
@ 2011-05-21 17:27 ` Marek Vasut
  2011-05-22 12:42 ` Sergei Shtylyov
  2011-05-26 13:49 ` Pavel Machek
  2 siblings, 0 replies; 4+ messages in thread
From: Marek Vasut @ 2011-05-21 17:27 UTC (permalink / raw)
  To: Pavel Machek
  Cc: rpurdie, lenz, kernel list, arminlitzel, Cyril Hrubis,
	thommycheck, linux-arm-kernel, dbaryshkov, omegamoon,
	eric.y.miao, utx, zaurus-devel

On Saturday, May 21, 2011 02:24:50 PM Pavel Machek wrote:
> Charger error is something that should be reported to the syslog; do
> it. If temperature reading fails, we do not want to charge the
> battery, anyway.
> 
> Signed-off-by: Pavel Machek <pavel@ucw.cz>
> 
> diff --git a/arch/arm/mach-pxa/sharpsl_pm.c
> b/arch/arm/mach-pxa/sharpsl_pm.c index 785880f..513588c 100644
> --- a/arch/arm/mach-pxa/sharpsl_pm.c
> +++ b/arch/arm/mach-pxa/sharpsl_pm.c
> @@ -317,6 +302,8 @@ static void sharpsl_charge_off(void)
> 
>  static void sharpsl_charge_error(void)
>  {
> +	dev_warn(sharpsl_pm.dev, "Charger Error\n");
> +
>  	sharpsl_pm_led(SHARPSL_LED_ERROR);
>  	sharpsl_pm.machinfo->charge(0);
>  	sharpsl_pm.charge_mode = CHRG_ERROR;
> @@ -513,8 +500,10 @@ static int sharpsl_check_battery_temp(void)
>  	val = get_select_val(buff);
> 
>  	dev_dbg(sharpsl_pm.dev, "Temperature: %d\n", val);
> -	if (val > sharpsl_pm.machinfo->charge_on_temp) {
> -		printk(KERN_WARNING "Not charging: temperature out of limits.\n");
> +	/* FIXME: this should catch battery read errors, but we should
> +	   probably avoid charging in <0C temperatures, too. */
> +	if ((val < 0) || (val > sharpsl_pm.machinfo->charge_on_temp)) {
> +		dev_warn(sharpsl_pm.dev, "Not charging: temperature %d out of
> limits.\n", val); return -1;
>  	}

Acked-by: Marek Vasut <marek.vasut@gmail.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: spitz pm: adjust messages
  2011-05-21 12:24 spitz pm: adjust messages Pavel Machek
  2011-05-21 17:27 ` Marek Vasut
@ 2011-05-22 12:42 ` Sergei Shtylyov
  2011-05-26 13:49 ` Pavel Machek
  2 siblings, 0 replies; 4+ messages in thread
From: Sergei Shtylyov @ 2011-05-22 12:42 UTC (permalink / raw)
  To: Pavel Machek
  Cc: rpurdie, lenz, kernel list, arminlitzel, Cyril Hrubis,
	thommycheck, linux-arm-kernel, dbaryshkov, omegamoon,
	eric.y.miao, utx, zaurus-devel, Marek Vasut

Hello.

On 21-05-2011 16:24, Pavel Machek wrote:

> Charger error is something that should be reported to the syslog; do
> it. If temperature reading fails, we do not want to charge the
> battery, anyway.

> Signed-off-by: Pavel Machek <pavel@ucw.cz>

> diff --git a/arch/arm/mach-pxa/sharpsl_pm.c b/arch/arm/mach-pxa/sharpsl_pm.c
> index 785880f..513588c 100644
> --- a/arch/arm/mach-pxa/sharpsl_pm.c
> +++ b/arch/arm/mach-pxa/sharpsl_pm.c
[...]
> @@ -513,8 +500,10 @@ static int sharpsl_check_battery_temp(void)
>   	val = get_select_val(buff);
>
>   	dev_dbg(sharpsl_pm.dev, "Temperature: %d\n", val);
> -	if (val>  sharpsl_pm.machinfo->charge_on_temp) {
> -		printk(KERN_WARNING "Not charging: temperature out of limits.\n");
> +	/* FIXME: this should catch battery read errors, but we should
> +	   probably avoid charging in<0C temperatures, too. */

    The preferred style of the multi-line comments is this:

/*
  * bla
  * bla
  */

WBR, Sergei

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: spitz pm: adjust messages
  2011-05-21 12:24 spitz pm: adjust messages Pavel Machek
  2011-05-21 17:27 ` Marek Vasut
  2011-05-22 12:42 ` Sergei Shtylyov
@ 2011-05-26 13:49 ` Pavel Machek
  2 siblings, 0 replies; 4+ messages in thread
From: Pavel Machek @ 2011-05-26 13:49 UTC (permalink / raw)
  To: rpurdie, lenz, kernel list, arminlitzel, Cyril Hrubis,
	thommycheck, linux-arm-kernel, dbaryshkov, omegamoon,
	eric.y.miao, utx, zaurus-devel, Marek Vasut

Eric, it should probably be you merging this and surrounding
patches... Any comments? Merge?
							Pavel

On Sat 2011-05-21 14:24:50, Pavel Machek wrote:
> Charger error is something that should be reported to the syslog; do
> it. If temperature reading fails, we do not want to charge the
> battery, anyway.
> 
> Signed-off-by: Pavel Machek <pavel@ucw.cz>
> 
> diff --git a/arch/arm/mach-pxa/sharpsl_pm.c b/arch/arm/mach-pxa/sharpsl_pm.c
> index 785880f..513588c 100644
> --- a/arch/arm/mach-pxa/sharpsl_pm.c
> +++ b/arch/arm/mach-pxa/sharpsl_pm.c
> @@ -317,6 +302,8 @@ static void sharpsl_charge_off(void)
>  
>  static void sharpsl_charge_error(void)
>  {
> +	dev_warn(sharpsl_pm.dev, "Charger Error\n");
> +
>  	sharpsl_pm_led(SHARPSL_LED_ERROR);
>  	sharpsl_pm.machinfo->charge(0);
>  	sharpsl_pm.charge_mode = CHRG_ERROR;
> @@ -513,8 +500,10 @@ static int sharpsl_check_battery_temp(void)
>  	val = get_select_val(buff);
>  
>  	dev_dbg(sharpsl_pm.dev, "Temperature: %d\n", val);
> -	if (val > sharpsl_pm.machinfo->charge_on_temp) {
> -		printk(KERN_WARNING "Not charging: temperature out of limits.\n");
> +	/* FIXME: this should catch battery read errors, but we should
> +	   probably avoid charging in <0C temperatures, too. */
> +	if ((val < 0) || (val > sharpsl_pm.machinfo->charge_on_temp)) {
> +		dev_warn(sharpsl_pm.dev, "Not charging: temperature %d out of limits.\n", val);
>  		return -1;
>  	}
>  
> -- 
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-05-26 13:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-21 12:24 spitz pm: adjust messages Pavel Machek
2011-05-21 17:27 ` Marek Vasut
2011-05-22 12:42 ` Sergei Shtylyov
2011-05-26 13:49 ` Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).