linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] Generic implementation for Input enable disable methods
@ 2010-01-20  6:28 Onkalo Samu
  2010-01-22  6:28 ` Onkalo Samu
  0 siblings, 1 reply; 6+ messages in thread
From: Onkalo Samu @ 2010-01-20  6:28 UTC (permalink / raw)
  To: ext Dmitry Torokhov; +Cc: linux-input


Hi

Some time ago, there were two parallel implementation proposals for
disabling input devices. See following email:
http://www.spinics.net/lists/linux-input/msg05984.html

It was asked to combine these two to have generic interface.
I'm proposing following sysfs interface:

../input0/disable/avail_xx
../input0/disable/disable_xx

So, new directory for disable control entries. Own entries for each
of the events or event group. Implementation is using bitmap format:

Examples

See what event groups can be disabled. Disable and enable all the groups
# cat avail_ev
0-1,4,20
# echo "0-1,4,20" > disable_ev
# cat disable_ev
0-1,4,20
# echo -e "\0" > disable_ev
# cat disable_ev
 
See what individual events can be disabled. Disable and enable one of
them:
# cat avail_key
528
# echo "528" > disable_key
# cat disable_key
528
# echo -e "\0" -> disable_key
# cat disable_key

Input core just provides sysfs entries and call call-back functions. 
Actual work is done in the drivers like gpio-keys.

Does this interface sound acceptable solution?
If it is, I'll finalize my implentation and send it for review.
This interface is tested to work with twl4030_keypad driver and
gpio-keys. It should also work fine with touch screen input drivers.

This is more or less small embedded device feature. Should it be behind
configuration flags similar to CONFIG_PM? Of course this would introduce
some compilation flags to the input-core.

Regard,
Samu




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC] Generic implementation for Input enable disable methods
  2010-01-20  6:28 [RFC] Generic implementation for Input enable disable methods Onkalo Samu
@ 2010-01-22  6:28 ` Onkalo Samu
  2010-02-01  8:59   ` Dmitry Torokhov
  0 siblings, 1 reply; 6+ messages in thread
From: Onkalo Samu @ 2010-01-22  6:28 UTC (permalink / raw)
  To: ext Dmitry Torokhov; +Cc: linux-input, Westerberg Mika.1, Nikula Jani.1

On Wed, 2010-01-20 at 07:28 +0100, Onkalo Samu.P (Nokia-D/Tampere)
wrote:
> Hi
> 
> Some time ago, there were two parallel implementation proposals for
> disabling input devices. See following email:
> http://www.spinics.net/lists/linux-input/msg05984.html
> 
> It was asked to combine these two to have generic interface.
> I'm proposing following sysfs interface:
> 
> ../input0/disable/avail_xx
> ../input0/disable/disable_xx
> 
> So, new directory for disable control entries. Own entries for each
> of the events or event group. Implementation is using bitmap format:
> 
> Examples
> 
> See what event groups can be disabled. Disable and enable all the groups
> # cat avail_ev
> 0-1,4,20
> # echo "0-1,4,20" > disable_ev
> # cat disable_ev
> 0-1,4,20
> # echo -e "\0" > disable_ev
> # cat disable_ev
>  
> See what individual events can be disabled. Disable and enable one of
> them:
> # cat avail_key
> 528
> # echo "528" > disable_key
> # cat disable_key
> 528
> # echo -e "\0" -> disable_key
> # cat disable_key
> 

After some playing with this interface it is quite clear that this is
not very user friendly. To have better usability, I'll change my
proposal to following one:

Entries are changed to this format:
.../inputx/disable/enable_xx
.../inputx/disable/disable_xx
(no avail_xx anymore)

Use:
echo "1,2" > disable_xx  disable events 1 and 2
echo "" > disable_xx   do nothing
cat disable_xx   list of currently disabled entries

echo "4-5" > enable_xx enable events 4,5,6
echo "" > enable_xx  do nothing
cat enable_xx   list of currenty enabled entries

Read operation returns only events which can be controlled via this
interface.

Enable all currently disabled events:
cat disable_xx > enable_xx

Disable all currently enabled events:
cat enable_xx > disable_XX

This way it is much easier to control individual events.

> Input core just provides sysfs entries and call call-back functions. 
> Actual work is done in the drivers like gpio-keys.
> 
> Does this interface sound acceptable solution?
> If it is, I'll finalize my implentation and send it for review.
> This interface is tested to work with twl4030_keypad driver and
> gpio-keys. It should also work fine with touch screen input drivers.
> 
> This is more or less small embedded device feature. Should it be behind
> configuration flags similar to CONFIG_PM? Of course this would introduce
> some compilation flags to the input-core.
> 
> Regard,
> Samu
> 
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-input" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC] Generic implementation for Input enable disable methods
  2010-01-22  6:28 ` Onkalo Samu
@ 2010-02-01  8:59   ` Dmitry Torokhov
  2010-02-05  7:38     ` samu.p.onkalo
  0 siblings, 1 reply; 6+ messages in thread
From: Dmitry Torokhov @ 2010-02-01  8:59 UTC (permalink / raw)
  To: Onkalo Samu; +Cc: linux-input, Westerberg Mika.1, Nikula Jani.1

On Fri, Jan 22, 2010 at 08:28:20AM +0200, Onkalo Samu wrote:
> On Wed, 2010-01-20 at 07:28 +0100, Onkalo Samu.P (Nokia-D/Tampere)
> wrote:
> > Hi
> > 
> > Some time ago, there were two parallel implementation proposals for
> > disabling input devices. See following email:
> > http://www.spinics.net/lists/linux-input/msg05984.html
> > 
> > It was asked to combine these two to have generic interface.
> > I'm proposing following sysfs interface:
> > 
> > ../input0/disable/avail_xx
> > ../input0/disable/disable_xx
> > 
> > So, new directory for disable control entries. Own entries for each
> > of the events or event group. Implementation is using bitmap format:
> > 
> > Examples
> > 
> > See what event groups can be disabled. Disable and enable all the groups
> > # cat avail_ev
> > 0-1,4,20
> > # echo "0-1,4,20" > disable_ev
> > # cat disable_ev
> > 0-1,4,20
> > # echo -e "\0" > disable_ev
> > # cat disable_ev
> >  
> > See what individual events can be disabled. Disable and enable one of
> > them:
> > # cat avail_key
> > 528
> > # echo "528" > disable_key
> > # cat disable_key
> > 528
> > # echo -e "\0" -> disable_key
> > # cat disable_key
> > 
> 
> After some playing with this interface it is quite clear that this is
> not very user friendly. To have better usability, I'll change my
> proposal to following one:
> 
> Entries are changed to this format:
> .../inputx/disable/enable_xx
> .../inputx/disable/disable_xx
> (no avail_xx anymore)
> 
> Use:
> echo "1,2" > disable_xx  disable events 1 and 2
> echo "" > disable_xx   do nothing
> cat disable_xx   list of currently disabled entries
> 
> echo "4-5" > enable_xx enable events 4,5,6
> echo "" > enable_xx  do nothing
> cat enable_xx   list of currenty enabled entries
> 
> Read operation returns only events which can be controlled via this
> interface.
> 
> Enable all currently disabled events:
> cat disable_xx > enable_xx
> 
> Disable all currently enabled events:
> cat enable_xx > disable_XX
> 

Hi Samu,

I still believe that the only thing we need (apart of special plumbing in
gpio-keys) is a way for userspace clients to subsribe on unsubscribe
from certain events rather than device-wide configuration. This way we
can avoid waking up processes that are not interested in some of the
events.

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [RFC] Generic implementation for Input enable disable methods
  2010-02-01  8:59   ` Dmitry Torokhov
@ 2010-02-05  7:38     ` samu.p.onkalo
  2010-02-05  8:10       ` Dmitry Torokhov
  0 siblings, 1 reply; 6+ messages in thread
From: samu.p.onkalo @ 2010-02-05  7:38 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: linux-input, ext-mika.1.westerberg, ext-jani.1.nikula

>-----Original Message-----
>From: ext Dmitry Torokhov [mailto:dmitry.torokhov@gmail.com]
>
>Hi Samu,
>
>I still believe that the only thing we need (apart of special plumbing
>in
>gpio-keys) is a way for userspace clients to subsribe on unsubscribe
>from certain events rather than device-wide configuration. This way we
>can avoid waking up processes that are not interested in some of the
>events.
>

Hi Dmitry,

I just noticed that control interface for gpio was applied to input-tree.
We still have a need to disable hw in certain cases. It is probably better
to forget generic implementation to input core and make control interface
as specific to each driver like proposed some months ago for example
for tel4030-keypad driver. Or what do you think?

Sw filtering which avoids to wakeup some processes is not proper solution
to embedded devices. We need to avoid waking up the processor itself.

Br,
Samu





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC] Generic implementation for Input enable disable methods
  2010-02-05  7:38     ` samu.p.onkalo
@ 2010-02-05  8:10       ` Dmitry Torokhov
  2010-02-05  8:46         ` samu.p.onkalo
  0 siblings, 1 reply; 6+ messages in thread
From: Dmitry Torokhov @ 2010-02-05  8:10 UTC (permalink / raw)
  To: samu.p.onkalo; +Cc: linux-input, ext-mika.1.westerberg, ext-jani.1.nikula

On Thursday 04 February 2010 11:38:41 pm samu.p.onkalo@nokia.com wrote:
> >-----Original Message-----
> >From: ext Dmitry Torokhov [mailto:dmitry.torokhov@gmail.com]
> >
> >Hi Samu,
> >
> >I still believe that the only thing we need (apart of special plumbing
> >in
> >gpio-keys) is a way for userspace clients to subsribe on unsubscribe
> >from certain events rather than device-wide configuration. This way we
> >can avoid waking up processes that are not interested in some of the
> >events.
> 
> Hi Dmitry,
> 
> I just noticed that control interface for gpio was applied to input-tree.
> We still have a need to disable hw in certain cases. It is probably better
> to forget generic implementation to input core and make control interface
> as specific to each driver like proposed some months ago for example
> for tel4030-keypad driver. Or what do you think?
> 
> Sw filtering which avoids to wakeup some processes is not proper solution
> to embedded devices. We need to avoid waking up the processor itself.

I see. I think that such facility should not be limited to input devices
(with the exception of gpio-keys which is a special case since it works
with multiple interrupts). We need a way to allow userspace initiate
putting an arbitrary device to "sleep" and this should be generic
infrastructure.

So you need to talk to PM people again and design such facility with them
since IIRC there wasn't anything like that last time you tried asking that
question.

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [RFC] Generic implementation for Input enable disable methods
  2010-02-05  8:10       ` Dmitry Torokhov
@ 2010-02-05  8:46         ` samu.p.onkalo
  0 siblings, 0 replies; 6+ messages in thread
From: samu.p.onkalo @ 2010-02-05  8:46 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: linux-input, ext-mika.1.westerberg, ext-jani.1.nikula

>From: linux-input-owner@vger.kernel.org [mailto:linux-input-
>owner@vger.kernel.org] On Behalf Of ext Dmitry Torokhov
>Sent: 05 February, 2010 10:11
>To: Onkalo Samu.P (Nokia-D/Tampere)
>Cc: linux-input@vger.kernel.org; Westerberg Mika.1 (EXT-Nixu/Helsinki);
>Nikula Jani.1 (EXT-Nixu/Helsinki)
>Subject: Re: [RFC] Generic implementation for Input enable disable
>methods
>
>On Thursday 04 February 2010 11:38:41 pm samu.p.onkalo@nokia.com wrote:
>> >-----Original Message-----
>> >From: ext Dmitry Torokhov [mailto:dmitry.torokhov@gmail.com]
>> >
>> >Hi Samu,
>> >
>> >I still believe that the only thing we need (apart of special
>plumbing
>> >in
>> >gpio-keys) is a way for userspace clients to subsribe on unsubscribe
>> >from certain events rather than device-wide configuration. This way
>we
>> >can avoid waking up processes that are not interested in some of the
>> >events.
>>
>> Hi Dmitry,
>>
>> I just noticed that control interface for gpio was applied to input-
>tree.
>> We still have a need to disable hw in certain cases. It is probably
>better
>> to forget generic implementation to input core and make control
>interface
>> as specific to each driver like proposed some months ago for example
>> for tel4030-keypad driver. Or what do you think?
>>
>> Sw filtering which avoids to wakeup some processes is not proper
>solution
>> to embedded devices. We need to avoid waking up the processor itself.
>
>I see. I think that such facility should not be limited to input devices
>(with the exception of gpio-keys which is a special case since it works
>with multiple interrupts). We need a way to allow userspace initiate
>putting an arbitrary device to "sleep" and this should be generic
>infrastructure.

I a way yes, generic interface would make sense. However, input devices
may have needs to partially shut down the HW based on the certain events
(similar to gpio key case).

>
>So you need to talk to PM people again and design such facility with
>them
>since IIRC there wasn't anything like that last time you tried asking
>that
>question.

Originally implementation for twl4030-keypad was about the HW activity control.
It is true that this latest discussion is only about the interface.
I'm sorry about the confusion.

br
Samu





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-02-05  8:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-20  6:28 [RFC] Generic implementation for Input enable disable methods Onkalo Samu
2010-01-22  6:28 ` Onkalo Samu
2010-02-01  8:59   ` Dmitry Torokhov
2010-02-05  7:38     ` samu.p.onkalo
2010-02-05  8:10       ` Dmitry Torokhov
2010-02-05  8:46         ` samu.p.onkalo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).