[Gta04-owner] Detecting USB cable insert
NeilBrown
neilb at suse.de
Mon Nov 21 22:18:51 CET 2011
On Mon, 21 Nov 2011 15:50:46 +0100 "Dr. H. Nikolaus Schaller"
<hns at goldelico.com> wrote:
> Hi,
>
> Am 21.11.2011 um 14:22 schrieb Radek Polak:
>
> > Hi,
> > on GTA02 there were comming messages on netlink when USB connector was plugged
>
> This one: http://en.wikipedia.org/wiki/Netlink ?
>
> > and also for battery charge changes. I havent noticed any netlink messages on
> > GTA04. Is there any recommended way how to detect USB cable plugging and
>
> I have not seen any netlink code in the BeagleBoard based kernels. So it must
> have been something special for the GTA02.
>
> > battery charging events?
>
> I am not sure if there are any events (except some dmesg) associated.
>
> The status can be polled through /sys. One is the twl4030_bci
> (battery charger). The other should be the "musb" (Mentor USB) driver which
> controls the USB/OTG part.
>
> If we implement some new notification schemes we should look what
> Kernel 3.2, Nokia N900, OpenPandora and other TI OMAP based devices
> are doing.
>
I think the "correct" way to get power change notifications is as udev events.
So on my 3.2-rc kernel when I plug in USB while running
udevadm monitor --kernel
I see
KERNEL[946688178.944335] change /devices/platform/omap/musb-omap2430/musb-hdrc/udc/musb-hdrc (udc)
KERNEL[946688178.950195] change /devices/platform/omap/omap_i2c.1/i2c-1/1-004b/twl4030_bci/power_supply/twl4030_ac (power_supply)
KERNEL[946688178.952423] change /devices/platform/omap/omap_i2c.1/i2c-1/1-004b/twl4030_bci/power_supply/twl4030_usb (power_supply)
The twl4030_bci_battery drive in the hardware-validation kernel has a call
to power_supply_changed() which is what leads to these (I think) so I suspect
it would have the same sort of messages.
I think these come out through dbus too.
NeilBrown
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: not available
URL: <http://lists.goldelico.com/pipermail/gta04-owner/attachments/20111122/5d7c9763/attachment.bin>
More information about the Gta04-owner
mailing list