linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Onkalo Samu <samu.p.onkalo@nokia.com>
To: ext Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: "linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
	"Westerberg Mika.1" <ext-mika.1.westerberg@nokia.com>,
	"Nikula Jani.1" <ext-jani.1.nikula@nokia.com>
Subject: Re: [RFC] Generic implementation for Input enable disable methods
Date: Fri, 22 Jan 2010 08:28:20 +0200	[thread overview]
Message-ID: <1264141700.2889.14.camel@4fid08082> (raw)
In-Reply-To: <1263968920.18053.24.camel@4fid08082>

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


  reply	other threads:[~2010-01-22  6:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-20  6:28 [RFC] Generic implementation for Input enable disable methods Onkalo Samu
2010-01-22  6:28 ` Onkalo Samu [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1264141700.2889.14.camel@4fid08082 \
    --to=samu.p.onkalo@nokia.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=ext-jani.1.nikula@nokia.com \
    --cc=ext-mika.1.westerberg@nokia.com \
    --cc=linux-input@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).