From: Artem Bityutskiy <dedekind1@gmail.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Mika Westerberg <mika.westerberg@iki.fi>,
"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>
Subject: Re: [RFC PATCH 1/1] Input: gpio-keys: export gpio key information through sysfs
Date: Wed, 11 Nov 2009 12:26:32 +0200 [thread overview]
Message-ID: <1257935192.21596.1004.camel@localhost> (raw)
In-Reply-To: <20091111095956.GB3654@core.coreip.homeip.net>
On Wed, 2009-11-11 at 01:59 -0800, Dmitry Torokhov wrote:
> On Wed, Nov 11, 2009 at 10:52:53AM +0200, Artem Bityutskiy wrote:
> > Sorry Dmitry, I'm new to the input subsystem, may be this is why I still
> > do not see any problem with introducing a nice and useful ioctl?
I do not insist on ioctl, if you can show a nice way to use sysfs. So
far you did suggest this way, and I also do not see any nice way.
Really, we are happy to use sysfs, just show us how.
> There are several reasons:
>
> - ioctls are not useful from scripts
Not valid point. There are tons of ioctls all over the place. And no one
prevents us from creating a userspace program which the scripts can use.
And your sysfs proposal is unusable for both the scripts and the C
programs. It is not any better.
> - 32/64 bit comapt issues
Invalid point. Real compat issues exist only for ioctls which pass
pointers. We are not going to do this at all.
> - currently there islimited number of ioctls in input core, they are all
> concentrated in joydev and evdev, almost all of them work on all
> devices, verifying locking is easy
OK, but this does not look like a blocker for introducing one more
ioctl.
> > On Wed, 2009-11-11 at 00:19 -0800, Dmitry Torokhov wrote:
> > > > > I understand the appeal of working with the keycodes but what you are
> > > > > asking is not simply ignoring certain keypresses (that is easy, just
> > > > > ignore corresponding events in userspace), you want to prevent system
> > > > > from waking up. In other words you want to "control PM layer through
> > > > > input layer" and I believe this is wrong.
> > > >
> > > > Err, this is really about disabling keys.
> > >
> > > If you want to stop delivery of certain keycodes to userspace then OK,
> > > an option to subscrbe to certain events only instead of getting all
> > > events from the device. But again, it will only work for that particular
> > > user only, not everyone.
> >
> > Yes, this will work for some particular input devices only, those which
> > support the keys masking. What is wrong with this? We have the '-ENOTTY'
> > error code, which for ioctl's means "ioctl is not supported".
> >
> > But no one prevents us from making this work for _every_ input device by
> > implementing a default ioctl handler in evdev.c, if needed. This handler
> > can mask certain keys in SW.
> >
> > IOW:
> > 1. if my HW supports HW key masking, the evdev ioctl calls my
> > handler, which is implemented in my driver.
> > 2. if my HW does not support this, the evdev ioctl masks the keys in
> > SW.
> >
> > We are interested in 1. And if later someone needs 2., he/she can very
> > easily implement that. But for now we can just return -ENOTTY (or
> > -EINVAL, which seems to be used in the input subsystem).
>
> And #2 is what I think input layer should provide. Something that
> works for all devices and is isolated (one client does not affect
> others).
We can do this, if you believe it normal if we implement code we do not
use and thus, we cannot really test. I do not think it is normal, but if
you insist, we can try doing.
> > > > If we think about this in an
> > > > abstract way, you have an input device with many keys. And the device's
> > > > HW allows you to disable any of it's keys. When you disable the key, the
> > > > input device ignores it and does not generate any interrupt for it.
> > >
> > > And the reason you want to stop interrupts?
> >
> > The reason is that I want simply mute certain keys. This is the only
> > reason.
> >
> > Now the question is _how_ I want to mute the key. My HW supports muting,
> > so I want to mute it in HW level, just because it is much better and
> > more efficient. Just because in this case I will not have any interrupt
> > and my device will wake up less.
>
> And the reason you care about number of wake ups is not saving power by
> any chance?
Yes it is. But there could be many other reasons as well. E.g., we may
want to achieve smaller latency by lessening amount of interrupts.
Really, you can look at this as we simply want to disable specific keys.
For exampe, for power savings. Or for smaller latency because of less
interrupts. Whatever.
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
--
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
next prev parent reply other threads:[~2009-11-11 10:26 UTC|newest]
Thread overview: 76+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-23 12:15 [RFC PATCH 0/1] Enabling/disabling separate gpio-keys buttons Mika Westerberg
2009-10-23 12:15 ` [RFC PATCH 1/1] Input: gpio-keys: export gpio key information through sysfs Mika Westerberg
2009-10-28 5:43 ` Dmitry Torokhov
2009-10-28 10:50 ` Mika Westerberg
2009-11-04 9:06 ` Mika Westerberg
2009-11-04 9:25 ` Artem Bityutskiy
2009-11-06 7:52 ` Dmitry Torokhov
2009-11-09 15:09 ` Artem Bityutskiy
2009-11-09 17:18 ` Dmitry Torokhov
2009-11-10 11:04 ` Artem Bityutskiy
2009-11-10 17:19 ` Dmitry Torokhov
2009-11-11 6:50 ` Artem Bityutskiy
2009-11-11 8:19 ` Dmitry Torokhov
2009-11-11 8:52 ` Artem Bityutskiy
2009-11-11 9:59 ` Dmitry Torokhov
2009-11-11 10:26 ` Artem Bityutskiy [this message]
2009-11-11 10:30 ` Artem Bityutskiy
2009-11-11 17:40 ` Dmitry Torokhov
2009-11-12 5:31 ` Artem Bityutskiy
2009-11-19 7:23 ` [PATCH 0/2] Input: gpio-keys: support for disabling GPIOs Mika Westerberg
2009-11-19 7:23 ` [PATCH 1/2] Input: gpio-keys: allow drivers to specify whether IRQ can be shared Mika Westerberg
2009-11-19 7:23 ` [PATCH 2/2] Input: gpio-keys: added support for disabling gpios through sysfs Mika Westerberg
2009-11-20 8:40 ` Dmitry Torokhov
2009-11-20 12:17 ` Mika Westerberg
2009-11-23 12:39 ` [PATCH v2 0/2] Input: gpio-keys: support for disabling GPIOs Mika Westerberg
2009-11-23 12:39 ` [PATCH v2 1/2] Input: gpio-keys - allow platform to specify exact irq flags Mika Westerberg
2009-11-23 12:39 ` [PATCH v2 2/2] Input: gpio-keys - added support for disabling gpios through sysfs Mika Westerberg
2009-11-23 16:42 ` [PATCH v2 1/2] Input: gpio-keys - allow platform to specify exact irq flags Ferenc Wagner
2009-11-23 17:24 ` Dmitry Torokhov
2009-11-23 18:50 ` Ferenc Wagner
2009-11-24 6:37 ` Mika Westerberg
2009-11-24 11:05 ` Ferenc Wagner
2009-11-24 17:02 ` Mika Westerberg
2009-11-24 18:39 ` Ferenc Wagner
2009-11-26 6:35 ` Dmitry Torokhov
2009-11-27 10:54 ` Mika Westerberg
2009-11-28 12:16 ` Ferenc Wagner
2009-11-28 13:27 ` Mika Westerberg
2009-11-29 12:26 ` Ferenc Wagner
2009-11-29 16:04 ` [linux-pm] " Alan Stern
2009-11-29 22:58 ` Ferenc Wagner
2009-11-30 8:27 ` Mika Westerberg
2009-11-30 9:14 ` Dmitry Torokhov
2009-11-30 9:37 ` Mika Westerberg
2009-12-01 0:07 ` Ferenc Wagner
2009-11-30 20:59 ` Ferenc Wagner
2009-12-01 0:37 ` Dmitry Torokhov
2009-12-01 1:05 ` Ferenc Wagner
2009-11-30 9:16 ` Dmitry Torokhov
2009-11-30 15:00 ` Alan Stern
2009-11-30 19:05 ` Ferenc Wagner
2009-11-30 19:30 ` Alan Stern
2009-11-30 20:51 ` Ferenc Wagner
2009-11-30 21:59 ` Alan Stern
2009-12-01 10:08 ` Ferenc Wagner
2009-12-01 15:11 ` Alan Stern
2009-12-06 8:47 ` Pavel Machek
2009-12-08 4:22 ` Dmitry Torokhov
2009-12-08 13:03 ` Artem Bityutskiy
2009-12-08 17:42 ` Dmitry Torokhov
2009-12-09 7:31 ` Artem Bityutskiy
2009-12-09 18:03 ` Dmitry Torokhov
2009-12-09 21:08 ` Pavel Machek
2009-12-09 21:48 ` Dmitry Torokhov
2009-12-10 10:13 ` Pavel Machek
2009-12-10 9:19 ` Artem Bityutskiy
2009-12-06 8:46 ` Pavel Machek
2009-11-20 8:38 ` [PATCH 1/2] Input: gpio-keys: allow drivers to specify whether IRQ can be shared Dmitry Torokhov
2009-11-20 10:08 ` Ferenc Wagner
2009-11-11 10:36 ` [RFC PATCH 0/2] Input: adding new ioctl()s for enabling/disabling events Mika Westerberg
2009-11-11 10:36 ` [RFC PATCH 1/2] Input: added 2 new ioctl()s for setting/getting event state Mika Westerberg
2009-11-11 10:36 ` [RFC PATCH 2/2] Input: gpio-keys: implemented support for enabling/disabling gpios Mika Westerberg
2009-11-11 14:37 ` Ferenc Wagner
2009-11-11 14:52 ` Mika Westerberg
2009-11-11 17:08 ` Dmitry Torokhov
2009-11-12 6:23 ` Mika Westerberg
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=1257935192.21596.1004.camel@localhost \
--to=dedekind1@gmail.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=mika.westerberg@iki.fi \
/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).