From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Oliver Neukum <oliver@neukum.org>
Cc: Bastien Nocera <hadess@hadess.net>,
linux-input <linux-input@vger.kernel.org>,
Jiri Kosina <jkosina@suse.cz>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [RESEND] [PATCH] Input: add appleir USB driver
Date: Mon, 4 Oct 2010 23:08:22 -0700 [thread overview]
Message-ID: <20101005060822.GD15355@core.coreip.homeip.net> (raw)
In-Reply-To: <201010050802.14271.oliver@neukum.org>
On Tue, Oct 05, 2010 at 08:02:14AM +0200, Oliver Neukum wrote:
> Am Dienstag, 5. Oktober 2010, 06:45:20 schrieb Dmitry Torokhov:
> > > > +{
> > > > + struct appleir *appleir = input_get_drvdata(dev);
> > > > +
> > > > + mutex_lock(&appleir_mutex);
> > > > +
> > > > + if (!(appleir->flags & APPLEIR_SUSPENDED)) {
> > > > + usb_kill_urb(appleir->urb);
> > > > + del_timer_sync(&appleir->key_up_timer);
> > >
> > > You can close with a key unreleased.
> >
> > I think this is handled by input core. We forcibly send release events
> > when device is disconnected; this takes care of surprise disconnect case.
> > OTOH if input_dev->close() is called that means that there are no more
> > listeners for the events so the fact that a key is still pressed is not
> > interesting to anyone.
>
> But what about the next opener? He'll get a completely spurious
> key release event, as the next key is pressed.
How does the opening of a device handle relate to a device state?
Userspace should expect to see releases without presses (in case they
weren't the first client that opened the device).
But I guess we should reset the "last key" here, just in case.
>
> > > > + usb_kill_urb(appleir->urb);
> > >
> > > If the system goes to sleep you'd better report a pressed key
> > > as released here and kill the timer.
> >
> > Input core sends "release" events upon resume so we should be OK.
>
> I see. OK, this is covered.
Might be a good idea to reset "last key" here as well. No need to send
2nd release event later on.
--
Dmitry
next prev parent reply other threads:[~2010-10-05 6:08 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-30 10:57 [RESEND] [PATCH] Input: add appleir USB driver Bastien Nocera
2010-09-30 15:47 ` Dmitry Torokhov
2010-09-30 15:51 ` Bastien Nocera
2010-10-08 0:39 ` Jarod Wilson
2010-11-18 4:18 ` Bastien Nocera
2010-11-19 18:07 ` Jarod Wilson
2010-10-04 19:17 ` Oliver Neukum
2010-10-05 4:45 ` Dmitry Torokhov
2010-10-05 6:02 ` Oliver Neukum
2010-10-05 6:08 ` Dmitry Torokhov [this message]
2010-10-05 6:18 ` Oliver Neukum
2010-10-05 15:55 ` Dmitry Torokhov
2010-10-05 16:07 ` Oliver Neukum
2010-10-05 16:18 ` 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=20101005060822.GD15355@core.coreip.homeip.net \
--to=dmitry.torokhov@gmail.com \
--cc=hadess@hadess.net \
--cc=jkosina@suse.cz \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oliver@neukum.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.