[Gta04-owner] Kernel 3.14-rc7

Radek Polak psonek2 at seznam.cz
Mon Mar 17 19:53:49 CET 2014


On Monday, March 17, 2014 07:24:17 PM Dr. H. Nikolaus Schaller wrote:

> PS: the current rule is:
> 
> # 500 mA charger
> SUBSYSTEM=="power_supply", ACTION=="change",
> DEVPATH=="*power_supply/twl4030_usb"
> ATTRS{1-0048/twl4030_usb/id}=="floating", ATTR{../../max_current}="500000"
> # 1A charger
> SUBSYSTEM=="power_supply", ACTION=="change",
> DEVPATH=="*power_supply/twl4030_usb" ATTRS{1-0048/twl4030_usb/id}=="102k",
> ATTR{../../max_current}="851000" # 2A charger
> SUBSYSTEM=="power_supply", ACTION=="change",
> DEVPATH=="*power_supply/twl4030_usb" ATTRS{1-0048/twl4030_usb/id}=="GND",
> ATTR{../../max_current}="851000"
> 
> * the devpath is at /sys/class/power_supply/twl4030_usb
> * the 1-0048/twl4030_usb/id has moved to
> /sys/devices/68000000.ocp/48070000.i2c/i2c-0/0-0048/twl4030-usb.36/id *

Isnt there better path for this? There are often symlinks in sysfs that make 
the path shorter and more stable. You cant find them with find /sys | grep xxx 
but find them manually in /sys/class or /sys/bus...

> the ../../max_current has moved to device/max_current (? if relative names
> are as I interpret them)

I think there is patch to move max_current to power supply:

https://github.com/radekp/linux-2.6/commit/21137cd715571a129eafb13525de9e6c413b8c83

> So the questions are specifically:
> * how can a udev rule modify a "foreign" attribute (if at all)?

I guess you can use full path, but that would be quite fragile in this case.

> * does this need another rule that symlinks the twl4030-usb.36/id to a
> stable location in the file system? * how can the udev rule know the path
> and number 36?

Maybe the uevent has some info. Sorry i dont have device here now to try nor i 
am any expert in this.

Regards

Radek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.goldelico.com/pipermail/gta04-owner/attachments/20140317/12bd878a/attachment-0001.html>


More information about the Gta04-owner mailing list