Hi Mika, On Fri, Oct 23, 2009 at 03:15:46PM +0300, Mika Westerberg wrote: > From: Mika Westerberg <ext-mika.1.westerberg@xxxxxxxxx> > > In some embedded devices gpio lines are used as keys/buttons > through input layer and gpio-keys. It is, however, impossible > to disable gpio lines separately from waking up the cpu. For > example when device is locked we don't want accidental camera > button press to cause the device to wakeup just to notice that > it should continue sleeping. > > This patch exports gpio-keys through sysfs and allows userland > to control whether single gpio line should wakeup the cpu or not. > > Sysfs interface is accessible via: > > /sys/class/input/gpio-keys/input/input0/gpio-key.N/ > > Following attributes are exported per gpio key: > > /code ... input event code (ro) > /type ... input event type (ro) > /desc ... description of the button (ro) > /disable ... enable/disable gpio line (rw) > > Userspace should be able to find out what key to disable/enable > by investigating {code, type, desc} tuple. > I think registering a full-blown device for every key is way too much, given that most consumers of gpio-keys driver are embedded... Besides, I don't think this should be driven from userspace. Board (platform) code should know what GPIO make sense as wake up sources for the particular device and should set up platform data accordingly. -- Dmitry -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html