linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Goffredo Baroncelli <kreijack@libero.it>
To: Jiri Kosina <jkosina@suse.cz>,
	Benjamin Tissoires <benjamin.tissoires@gmail.com>
Cc: 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 18:52:36 +0200	[thread overview]
Message-ID: <55689954.9090303@libero.it> (raw)
In-Reply-To: <alpine.LNX.2.00.1505291642540.26271@pobox.suse.cz>

Hi Jiri,
On 2015-05-29 16:44, Jiri Kosina wrote:
> 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.

I will update the patch on the basis of your request



> 
>>> [ ... 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,
> 


-- 
gpg @keyserver.linux.it: Goffredo Baroncelli <kreijackATinwind.it>
Key fingerprint BBF5 1610 0B64 DAC6 5F7D  17B2 0EDA 9B37 8B82 E0B5

  reply	other threads:[~2015-05-29 16:52 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
2015-05-29 16:52         ` Goffredo Baroncelli [this message]
  -- 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=55689954.9090303@libero.it \
    --to=kreijack@libero.it \
    --cc=ao2@ao2.it \
    --cc=benjamin.tissoires@gmail.com \
    --cc=drighelli@gmail.com \
    --cc=jkosina@suse.cz \
    --cc=kreijack@inwind.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 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).