[Debian-eeepc-devel] Enable camera autosuspend in udev rule

Luca Niccoli lultimouomo at gmail.com
Thu Oct 22 08:46:27 UTC 2009


2009/10/21 Alan Jenkins <sourcejedi.lkml at googlemail.com>:

> Anyway, it's irrelevant whether it's in-kernel or not.  A udev rule
> should be able to just match on DRIVER=="uvcvideo", if that's what you
> want to try.  (Possibly it needs DRIVERS instead or some similar
> alteration, but it's definitely possible in principle).
>

I'm afraid it is not that simple:
in all the webcam I've seen there's a parent device, and two children.
The children have DRIVER=="uvcvideo", the parent has "usb".
It is the parent device which has the power/level attribute, so DRIVER
is of no use in the sysfs rule.
DRIVERS unfortunately has the opposite semantic that the one that
would suit us: it matches a device if any of the *parent* devices
matches the driver.
DRIVER=="uvcvideo", ATTR{../power/level}="auto" didn't work.
I guess one could write a script that takes a devpath and sets
autosuspend for the parent device, using then the RUN action, but it
sounds ugly.
l



More information about the Debian-eeepc-devel mailing list