Re: [RFC PATCH 2/2] power_supply: Add new LED triggercharging-blink-solid-full

From: Anton Vorontsov
Date: Fri Jan 14 2011 - 11:19:08 EST


On Fri, Jan 07, 2011 at 06:28:17PM +0200, Vasily Khoruzhick wrote:
> Add new trigger to power_supply LEDs. It will blink when
> battery is charging, and stay solid when battery is charged.
> It's usefull to indicate battery state when there's only one
> LED available.
>
> Signed-off-by: Vasily Khoruzhick <anarsoul@xxxxxxxxx>

Strange, I got neither 0/2 nor 1/2.

Anyway, I'm fine with this particular patch, but to take 1/2 via
battery-2.6.git I need Richard's Acked-by tag.

A note wrt the new LEDs API...

> ---
> drivers/power/power_supply_leds.c | 18 ++++++++++++++++++
> include/linux/power_supply.h | 2 ++
> 2 files changed, 20 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/power/power_supply_leds.c b/drivers/power/power_supply_leds.c
> index 031a554..b640bbf 100644
> --- a/drivers/power/power_supply_leds.c
> +++ b/drivers/power/power_supply_leds.c
> @@ -21,6 +21,7 @@
> static void power_supply_update_bat_leds(struct power_supply *psy)
> {
> union power_supply_propval status;
> + unsigned long delay_on = 0, delay_off = 0;
[...]
> + led_trigger_blink(psy->charging_blink_full_solid_trig,
> + &delay_on, &delay_off);

I think it's better to allow passing NULL to led_trigger_blink()
and thus avoid delay_{on,off} dummy variables.

Thanks,

--
Anton Vorontsov
Email: cbouatmailru@xxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/