On Mon, Mar 14, 2011 at 05:10:22PM +0530, ext Menon, Nishanth wrote: > Date: Mon, 14 Mar 2011 17:10:22 +0530 > From: "ext Menon, Nishanth" <nm@xxxxxx> > To: Denis Karpov <ext-denis.2.karpov@xxxxxxxxx> > CC: tony@xxxxxxxxxxx, linux-omap@xxxxxxxxxxxxxxx > Subject: Re: [PATCH 0/2] power button repeat input events > In-Reply-To: <20110314111327.GA10563@xxxxxxxxxxxxxxxxxxxxxxxx> > > On Mon, Mar 14, 2011 at 16:43, Denis Karpov > <ext-denis.2.karpov@xxxxxxxxx> wrote: > > > > On Fri, Mar 11, 2011 at 10:25:27PM +0530, ext Nishanth Menon wrote: > > > > > > Denis Karpov wrote, on 03/11/2011 10:07 PM: > > > >Hi, > > > > > > > >this patchset adds optional generation of repeat input events for > > > >twl4030 power button. It adds optional platform data for > > > >twl4030-pwrbutton and initializes it for RX51/N900 (default > > > >behavior kept - repeated input events disabled). > > > > > > > >We are working on an OMAP3 with TWL5031 MFD. In one of the use > > > >scenarios userspace wants to receive repeated input events from > > > >long press of power button. > > > > > > dumb question - is'nt this a userspace responsibility as far as power > > > button is concerned? what is the benefit of providing repeat events > > > like a generic keypad for the power button? > > > > In our case userspace needs this to track the continuous button press > > of power button. > thanks for your explanation, but a follow on dumb question: > include/linux/input.h > #define KEY_POWER 116 /* SC System Power Down */ > > in twl-powerbutton.c, I see: > input_report_key(pwr, KEY_POWER, value & PWR_PWRON_IRQ); > where value is the value from the register status, should'nt we get > two events? one on press and one on release after say 10 mins(assuming > person keeps it pressed for 10 mins? > > Is there different behavior we intend to implement in userspace which > differentiates 1 KEY_POWER event Vs 10 KEY_POWER event? No, but due to specifics of userspace sw components involved it seems not to be possible to reliably save the state for power button to detect long keypresses. I thought that this change if implemented as optional feature and localized to scpecific devices/boards would not hurt. twl-keypad.c implements exactly same behavior for keypad keys, why not to do this for the power key ? Denis -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html