From: Guenter Roeck <groeck-dsl@sbcglobal.net>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Guenter Roeck <linux@roeck-us.net>,
linux-kernel@vger.kernel.org,
Grant Likely <grant.likely@secretlab.ca>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>
Subject: Re: [PATCH] gpio: export 'debounce' attribute if supported by the gpio chip
Date: Fri, 7 Dec 2012 06:59:55 -0800 [thread overview]
Message-ID: <20121207145955.GA28704@roeck-us.net> (raw)
In-Reply-To: <CACRpkdYDLJDwv97Z0agZBbzCtEdeb5Y-83K2HkZRtLP1Cz_QiA@mail.gmail.com>
On Fri, Dec 07, 2012 at 09:07:28AM +0100, Linus Walleij wrote:
> On Thu, Dec 6, 2012 at 7:32 AM, Guenter Roeck <linux@roeck-us.net> wrote:
>
> > Create a 'debounce' attribute if debounce is supported by the gpio
> > chip and a gpio pin is exported.
> >
> > Signed-off-by: Guenter Roeck <linux@roeck-us.net>
>
> Can you describe the usecase for this?
>
> I have this problem when working as a back-up GPIO maintainer that
> I don't really understand the userspace apps doing this.
>
> I would guess something like a userspace app reading a GPIO switch
> and needing to set this to avoid key bounces, but it'd be nice to know
> if this is really the case.
>
Yes, that is one if the use cases. Button pressed on the chassis/board
requesting user space action. Another is board presence detect pins which
require rebounce support and are handled in user space. Yes, the later should be
handled in the kernel, and most of them are, but there are some which don't need
immediate kernel activity and are handled completely by applications.
There may be other use cases - there are hundreds of gpio pins in the system I
am working on, and I have not looked into all of them.
> If this is the usecase I am slightly concerned why these are not used:
> drivers/input/keyboard/gpio_keys_polled.c
> drivers/input/keyboard/gpio_keys.c
>
> The latter even uses the in-kernel debounce interface.
>
> I'd agree if this is not user input at all but something like a switch
> in a factory production line.
>
I could imagine declaring the activity request buttons to be "input", but for
presence detects it is a bit far fetched and would add too much complexity.
Thanks,
Guenter
next prev parent reply other threads:[~2012-12-07 14:59 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-06 6:32 [PATCH] gpio: export 'debounce' attribute if supported by the gpio chip Guenter Roeck
2012-12-07 8:07 ` Linus Walleij
2012-12-07 14:59 ` Guenter Roeck [this message]
2012-12-07 16:20 ` Guenter Roeck
2012-12-07 16:49 ` Alan Cox
2012-12-09 9:58 ` anish kumar
2012-12-09 11:03 ` Alan Cox
2012-12-09 17:07 ` Guenter Roeck
2012-12-09 22:36 ` Grant Likely
2012-12-10 10:11 ` Linus Walleij
2012-12-10 10:04 ` Linus Walleij
2012-12-10 18:48 ` Guenter Roeck
2012-12-10 19:37 ` anish singh
2012-12-13 17:08 ` Guenter Roeck
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=20121207145955.GA28704@roeck-us.net \
--to=groeck-dsl@sbcglobal.net \
--cc=dmitry.torokhov@gmail.com \
--cc=grant.likely@secretlab.ca \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
/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).