All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Kosina <jkosina@suse.cz>
To: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Cc: Goffredo Baroncelli <kreijack@libero.it>,
	linux-input <linux-input@vger.kernel.org>,
	Antonio Ospite <ao2@ao2.it>,
	Nestor Lopez Casado <nlopezcasad@logitech.com>,
	Dario Righelli <drighelli@gmail.com>,
	Goffredo Baroncelli <kreijack@inwind.it>
Subject: Re: [PATCH] Add driver for mouse logitech M560
Date: Fri, 29 May 2015 16:44:29 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LNX.2.00.1505291642540.26271@pobox.suse.cz> (raw)
In-Reply-To: <CAN+gG=FXiLQYuwP1cFMP6yySUHUOxi2v-x==zYoHNUypEgW5Kg@mail.gmail.com>

On Fri, 29 May 2015, Benjamin Tissoires wrote:

> >> +static u32 hidpp_extract(u8 *report, unsigned offset, unsigned n)
> >> +{
> >> +     u64 x;
> >> +
> >> +     report += offset >> 3;  /* adjust byte index */
> >> +     offset &= 7;            /* now only need bit offset into one byte */
> >> +     x = get_unaligned_le64(report);
> >> +     x = (x >> offset) & ((1ULL << n) - 1);  /* extract bit field */
> >> +     return (u32)x;
> >> +}
> >
> > I hate such code duplication. How about we rename it to
> > hid_field_extract() and make its linkage external?
> 
> works for me

Thanks. So I'd prefer this patch to be resent as a two-patch series, first 
one bringing hid_field_extract(), and the second being the driver making 
use of it.

> > [ ... snip ... ]
> >> @@ -1301,6 +1532,10 @@ static const struct hid_device_id hidpp_devices[] = {
> >>               USB_VENDOR_ID_LOGITECH, 0x4102),
> >>         .driver_data = HIDPP_QUIRK_DELAYED_INIT | HIDPP_QUIRK_MULTI_INPUT |
> >>                        HIDPP_QUIRK_CLASS_WTP },
> >> +     { /* Mouse logitech M560 */
> >> +       HID_DEVICE(BUS_USB, HID_GROUP_LOGITECH_DJ_DEVICE,
> >> +             USB_VENDOR_ID_LOGITECH, 0x402d),
> >> +       .driver_data = HIDPP_QUIRK_DELAYED_INIT | HIDPP_QUIRK_CLASS_M560 },
> >
> > Seems like you forgot to add the device id to hid_have_special_driver[]?
> 
> nope, the device is tagged with HID_GROUP_LOGITECH_DJ_DEVICE, so
> hid-generic ignores it by default.

Gah, I keep forgetting about HID_GROUP_LOGITECH_DJ_DEVICE again and again.

Thanks,

-- 
Jiri Kosina
SUSE Labs

  reply	other threads:[~2015-05-29 14:44 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-10 16:49 [PATCH V5] Add support for mouse logitech m560 Goffredo Baroncelli
2015-05-10 16:49 ` [PATCH] Add driver for mouse logitech M560 Goffredo Baroncelli
2015-05-11 15:28   ` Benjamin Tissoires
     [not found]     ` <555D839F.5030304@libero.it>
2015-05-21 13:58       ` Benjamin Tissoires
2015-05-29 14:38   ` Jiri Kosina
2015-05-29 14:41     ` Benjamin Tissoires
2015-05-29 14:44       ` Jiri Kosina [this message]
2015-05-29 16:52         ` Goffredo Baroncelli
  -- strict thread matches above, loose matches on Subject: below --
2015-05-01  8:43 Goffredo Baroncelli
2015-05-05 15:36 ` Antonio Ospite
2015-05-06  6:48   ` Antonio Ospite
2015-05-06  7:35     ` Antonio Ospite
2015-05-06 13:27       ` Benjamin Tissoires
2015-04-29 18:24 [PATCH V3] Add support for mouse logitech m560 Goffredo Baroncelli
2015-04-29 18:24 ` [PATCH] Add driver for mouse logitech M560 Goffredo Baroncelli
2015-04-29 19:31   ` Benjamin Tissoires
2015-04-29 21:47   ` Antonio Ospite
2015-04-29 18:17 Goffredo Baroncelli

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.1505291642540.26271@pobox.suse.cz \
    --to=jkosina@suse.cz \
    --cc=ao2@ao2.it \
    --cc=benjamin.tissoires@gmail.com \
    --cc=drighelli@gmail.com \
    --cc=kreijack@inwind.it \
    --cc=kreijack@libero.it \
    --cc=linux-input@vger.kernel.org \
    --cc=nlopezcasad@logitech.com \
    /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.