[PATCH 0/3] PMU and Battery interaction in regard to kobject uevent

Andy Green andy at openmoko.com
Wed Jun 4 19:12:07 CEST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Somebody in the thread at some point said:
| On Wednesday 04 June 2008 16:01:19 Holger Freyther wrote:
|
|> Well, I might look at this from another way. In userspace we
|> have /sys/class/power/*/ to get information about the available
batteries.
|> For one battery we want to immediately know when its charging state is
|> changing or might have changed (the other option would be to do even more
|> polling). And according to my understanding this is what the uevent
file in
|> sysfs for the battery is for.
|>
|> I have decided to follow andy's comment and will make mach-gta02 and
|> bq27000 talk to each other to do this update. A patch should be on
the way
|> soon(tm).
|
| here we go... comments, criticism, gifts welcome

|  		case PMU_EVT_INSERT:
|  		case PMU_EVT_USB_INSERT:
|  			pcf50633_charge_enable(pcf50633_global, 1);
| +			bq27000_charging_state_change(&bq27000_battery_device);
|  			break;
|  		case PMU_EVT_REMOVE:
|  		case PMU_EVT_USB_REMOVE:
|  			pcf50633_charge_enable(pcf50633_global, 0);
| +			bq27000_charging_state_change(&bq27000_battery_device);
|  			break;

Looks fine.  I poked through the power_supply stuff briefly to try to
figure out what power_supply_changed() does and why it doesn't take an
argument.  It seems that it purely an event that something happened and
you need to look closer at the state in /sys yourself.

(I noticed a whole world of kernel support for charging LEDs in that
power supply stuff, but never mind).

When the charging state tracking patch is integrated it can all work the
same way (with some added charging state setting business from
power_supply, because only the events are generated and no shadow state
kept).

- -Andy

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAkhGzOcACgkQOjLpvpq7dMpFdgCfZem9O7BrLgSGzSlF4lNLnj4i
6ZsAn1d8+NWbPkRMNptpP+6ajcN8I+Ft
=5rPZ
-----END PGP SIGNATURE-----




More information about the openmoko-kernel mailing list