[PATCH 1/1] Update battery status when the external power status changes

Daniel Willmann daniel at totalueberwachung.de
Thu Apr 23 10:59:25 CEST 2009


On Thu, 23 Apr 2009 10:13:31 +0200
Michael Trimarchi <trimarchi at gandalf.sssup.it> wrote:

> Daniel Willmann wrote:
> > diff --git a/drivers/power/bq27000_battery.c
> > b/drivers/power/bq27000_battery.c index bc3856e..c42211a 100644
> > --- a/drivers/power/bq27000_battery.c
> > +++ b/drivers/power/bq27000_battery.c
> > @@ -172,6 +172,7 @@ static void
> > bq27000_battery_external_power_changed(struct power_supply *psy) {
> >  	struct bq27000_device_info *di = container_of(psy, struct
> > bq27000_device_info, bat); 
> > +	power_supply_changed(&di->bat);
> >   
> Are you sure that you can call that funtion from there?

At least it didn't have any immediate side effects and did what I
wanted (immediately updates the charging status). The stable branch has
exactly this call in there which is where I got the idea.

> >  	dev_dbg(di->dev, "%s\n", __FUNCTION__);
> >  }
> >  
> >   
> 
> I send a different fix... Can you test?

I will test later today, first I have to take care of taxes...
I looked briefly at schedule_delayed_work and it seems like you
shouldn't queue a struct delayed_work more than once.
(See BUG_ON(time_pending(timer)); at
http://tomoyo.sourceforge.jp/cgi-bin/lxr/source/kernel/workqueue.c#L236)

I'm not sure if I'm reading this correctly though.

Regards,
Daniel Willmann
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
Url : http://lists.openmoko.org/pipermail/openmoko-kernel/attachments/20090423/76d1ee0e/attachment.pgp 


More information about the openmoko-kernel mailing list