linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Alexander Stein <alexander.stein@informatik.tu-chemnitz.de>
Cc: linux-input@vger.kernel.org
Subject: Re: [PATCH] input: generic driver for slide switches
Date: Tue, 5 Apr 2011 11:36:52 -0700	[thread overview]
Message-ID: <20110405183651.GD13086@core.coreip.homeip.net> (raw)
In-Reply-To: <201104031021.26509.alexander.stein@informatik.tu-chemnitz.de>

Hi Alexander,

On Sun, Apr 03, 2011 at 10:21:26AM +0200, Alexander Stein wrote:
> Hello Dimitry,
> 
> On Sunday 03 April 2011 06:23:05 Dmitry Torokhov wrote:
> > On Sat, Apr 02, 2011 at 10:31:53AM +0200, Alexander Stein wrote:
> > > Hello Dimitry,
> > > 
> > > On Wednesday 16 March 2011 07:36:18 Dmitry Torokhov wrote:
> > > > On Tue, Mar 15, 2011 at 02:13:49PM +0100, Alexander Stein wrote:
> > > > > On Friday 25 February 2011, 14:29:18 Alexander Stein wrote:
> > > > > > This patch adds a generic driver for slide switches connected to
> > > > > > GPIO pins of a system. It requires gpiolib and generic hardware
> > > > > > irqs.
> > > > 
> > > > Hm, can't it be merged with gpio_keys? Just add the 'value' to the
> > > > gpio_keys_button structure that would be valid for EV_ABS (or even
> > > > EV_REL) types. Debouncing should filter out jittery events...
> > > 
> > > Sorry, for no answer long time.
> > > I just tried merging both. The problem i noticed is that the PGIO
> > > interrupts are independable and each GPIO will generate an event, which
> > > is wrong. Assume the switch state change from position 2 to 1 it will
> > > actually generate lots of interrupts: e.g. 2, 1, 2, 1.
> > > Depending from the order of such interrupts the last event shows a
> > > possible wrong position.
> > 
> > However at some point the output should stabilize. Does not setting
> > appropriate debouncing interval help here?
> 
> Well, a debounce interval will prevent to get events for position 2, 1, 2, 1 
> (from the example above). You will get only 2 and 1.

No, if the switch settles in position 2 then we will report only 2. I.e.
if you set debounce interval for 200 msecs for all gpios at the end of
this period gpio representing "1" position will not be active so you
will not send any event for it. The gpio representing "2" will still be
active and thus you will send ABS_whatever/2.

> The debounce will only decrease the amount of events for _each_ GPIO 
> interrupt. It will not prevent GPIO interrupts from different pins while moving 
> the switch one position.

It will not prevent interrupts but should prevent unstable events. It
might be beneficial if you posted the code you tried and we'd see why
debouncing does not work for you.

Thanks.

-- 
Dmitry

  reply	other threads:[~2011-04-05 18:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-25 13:29 [PATCH] input: generic driver for slide switches Alexander Stein
2011-03-15 13:13 ` Alexander Stein
2011-03-16  6:36   ` Dmitry Torokhov
2011-04-02  8:31     ` Alexander Stein
2011-04-03  4:23       ` Dmitry Torokhov
2011-04-03  8:21         ` Alexander Stein
2011-04-05 18:36           ` Dmitry Torokhov [this message]
2011-04-07 17:45             ` Alexander Stein
2011-04-10  0:10               ` Dmitry Torokhov

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=20110405183651.GD13086@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=alexander.stein@informatik.tu-chemnitz.de \
    --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).