linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Kosina <jkosina@suse.cz>
To: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Cc: Henrik Rydberg <rydberg@euromail.se>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Stephane Chatty <chatty@enac.fr>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC 3/5] hid: Parse the device before adding it
Date: Tue, 3 Apr 2012 06:06:36 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LNX.2.00.1204030603550.9041@pobox.suse.cz> (raw)
In-Reply-To: <CAN+gG=G9KSjSFmWpxpPLzMzz14ePAhQKTJZjQBsPeq2iztZ17A@mail.gmail.com>

On Tue, 3 Apr 2012, Benjamin Tissoires wrote:

> > The hid bus is populated by devices created by the usb and bluetooth
> > subsystems. The hid device is then broadcast to userland via uevents.
> > Currently, the parsing of the hid reports is done during probe of
> > the hid device, after the device has been broadcast. In order to
> > allow for the report descriptors to influence the device properties,
> > it is desirable to parse the device _before_ it is broadcast to
> > userland. In actuality, the parsing depends only accidentally on
> > the driver being present, so it can be trivially achieved.
> >
> > Something also needs to be done for the report_fixup handler, which
> > seems to be the only hard device-driver coupling in the code.
> >
> > Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
> > ---
> >  drivers/hid/hid-core.c        |    2 +-
> >  drivers/hid/usbhid/hid-core.c |    5 +++++
> >  2 files changed, 6 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
> > index 35ba9d9..8a7b59e 100644
> > --- a/drivers/hid/hid-core.c
> > +++ b/drivers/hid/hid-core.c
> > @@ -658,7 +658,7 @@ int hid_parse_report(struct hid_device *device, __u8 *start,
> >                hid_parser_reserved
> >        };
> >
> > -       if (device->driver->report_fixup)
> > +       if (device->driver && device->driver->report_fixup)
> >                start = device->driver->report_fixup(device, start, &size);
> 
> Well, this is not a good solution for the following drivers:
> hid-zydacron
> hid-prodikeys
> hid-uclogic
> hid-samsung
> hid-sony, etc...
> 
> they all use report_fixup and as the parse is made only once, they
> won't be able to work properly.

For completness -- please see a discussion that's a little bit related to 
this (and namely the patch I have proposed yesterday) here:

	http://www.spinics.net/lists/linux-input/msg20061.html

-- 
Jiri Kosina
SUSE Labs

  reply	other threads:[~2012-04-03 13:06 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-03  7:05 [RFC 0/5] hid: Extending the device-driver matching mechanism Henrik Rydberg
2012-04-03  7:05 ` [RFC 1/5] hid: Remove multitouch quirk Henrik Rydberg
2012-04-08 23:56   ` Jiri Kosina
2012-04-03  7:05 ` [RFC 2/5] hid-multitouch: Prepare driver for new device ids Henrik Rydberg
2012-04-03  7:05 ` [RFC 3/5] hid: Parse the device before adding it Henrik Rydberg
2012-04-03  8:41   ` Benjamin Tissoires
2012-04-03 13:06     ` Jiri Kosina [this message]
2012-04-03  7:05 ` [RFC 4/5] hid: Add idtags to modalias Henrik Rydberg
2012-04-03  8:45   ` Benjamin Tissoires
2012-04-03 10:57     ` Henrik Rydberg
2012-04-03  7:05 ` [RFC 5/5] hid: Remove multitouch devices from blacklist Henrik Rydberg
2012-04-03  8:46   ` Benjamin Tissoires
2012-04-03  8:38 ` [RFC 0/5] hid: Extending the device-driver matching mechanism Benjamin Tissoires
2012-04-03 10:55   ` Henrik Rydberg
2012-04-08 23:53     ` Jiri Kosina

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=alpine.LNX.2.00.1204030603550.9041@pobox.suse.cz \
    --to=jkosina@suse.cz \
    --cc=benjamin.tissoires@gmail.com \
    --cc=chatty@enac.fr \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rydberg@euromail.se \
    /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).