public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Jiri Slaby <jirislaby@gmail.com>
Cc: Jiri Kosina <jkosina@suse.cz>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	anssi.hannula@gmail.com, akpm@linux-foundation.org,
	Jiri Slaby <jslaby@suse.cz>
Subject: Re: [PATCH 8/9] HID: move apple quirks
Date: Mon, 12 May 2008 01:15:59 +0200	[thread overview]
Message-ID: <1210547759.16390.34.camel@violet.holtmann.net> (raw)
In-Reply-To: <1210536043-19812-8-git-send-email-jirislaby@gmail.com>

Hi Jiri,

> Move them from core code to separate driver.

<snip>

> +#if defined(CONFIG_BT_HIDP) || defined(CONFIG_BT_HIDP_MODULE)
> +	/* Apple wireless Mighty Mouse */
> +	{ HID_BT_DEVICE(USB_VENDOR_ID_APPLE, 0x030c),
> +		.driver_data = APPLE_MIGHTYMOUSE | APPLE_INVERT_HWHEEL },
> +#endif

why do we have to have this within #ifdefs. The HID_BLUETOOTH_DEVICE
should work even without Bluetooth compiled. It depends only on having
the BUS_BLUETOOTH present. In theory we could have a different Bluetooth
stack providing BUS_BLUETOOTH devices (like through uinput).

<snip>

> +static const struct hid_device_id hid_bt_blacklist[] = {
> +	{ HID_BT_DEVICE(USB_VENDOR_ID_APPLE, 0x030c) },
>  	{ }
>  };
>  
>  static const struct hid_device_id *hid_blacklist[] = {
>  	[BUS_USB] = hid_usb_blacklist,
> -	[BUS_BLUETOOTH] = NULL,
> +	[BUS_BLUETOOTH] = hid_bt_blacklist,
>  };

no shortcut please. Use hid_bluetooth_blacklist. And why do we need two
separate blacklists anyway. We use HID_USB_DEVICE and
HID_BLUETOOTH_DEVICE. Both carry the bus information with them.

<snip>

> diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
> index e85ff38..1e9b0d1 100644
> --- a/net/bluetooth/hidp/core.c
> +++ b/net/bluetooth/hidp/core.c
> @@ -677,27 +677,6 @@ static void hidp_close(struct hid_device *hid)
>  {
>  }
>  
> -static const struct {
> -	__u16 idVendor;
> -	__u16 idProduct;
> -	unsigned quirks;
> -} hidp_blacklist[] = {
> -	/* Apple wireless Mighty Mouse */
> -	{ 0x05ac, 0x030c, HID_QUIRK_MIGHTYMOUSE | HID_QUIRK_INVERT_HWHEEL },
> -
> -	{ }	/* Terminating entry */
> -};
> -
> -static void hidp_setup_quirks(struct hid_device *hid)
> -{
> -	unsigned int n;
> -
> -	for (n = 0; hidp_blacklist[n].idVendor; n++)
> -		if (hidp_blacklist[n].idVendor == le16_to_cpu(hid->vendor) &&
> -				hidp_blacklist[n].idProduct == le16_to_cpu(hid->product))
> -			hid->quirks = hidp_blacklist[n].quirks;
> -}
> -
>  static int hidp_parse(struct hid_device *hid)
>  {
>  	struct hidp_session *session = hid->driver_data;
> @@ -723,7 +702,6 @@ static int hidp_parse(struct hid_device *hid)
>  
>  	session->req = NULL;
>  
> -	hidp_setup_quirks(hid);
>  	return 0;
>  }

I really like to see this go away :)

Acked-by: Marcel Holtmann <marcel@holtmann.org>

Regards

Marcel



  parent reply	other threads:[~2008-05-11 23:16 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-11 20:00 [PATCH 1/9] modpost: add support for hid Jiri Slaby
2008-05-11 20:00 ` [PATCH 2/9] HID: make a bus from hid code Jiri Slaby
2008-05-11 20:00   ` [PATCH 3/9] HID: hid, make parsing event driven Jiri Slaby
2008-05-11 20:00     ` [PATCH 4/9] HID: move ids into separate file Jiri Slaby
2008-05-11 20:00       ` [PATCH 5/9] HID: move usage input mapping to hid.h Jiri Slaby
2008-05-11 20:00         ` [PATCH 6/9] HID: move logitech report quirks Jiri Slaby
2008-05-11 20:00           ` [PATCH 7/9] HID: move ignore quirks Jiri Slaby
2008-05-11 20:00             ` [PATCH 8/9] HID: move apple quirks Jiri Slaby
2008-05-11 20:00               ` [PATCH 9/9] HID: add compat support Jiri Slaby
2008-05-11 20:48                 ` Sam Ravnborg
2008-05-11 21:07                   ` Jiri Slaby
2008-05-11 21:18                     ` Sam Ravnborg
2008-05-12  7:19                       ` Jiri Slaby
2008-05-11 23:18                 ` Marcel Holtmann
2008-05-11 23:15               ` Marcel Holtmann [this message]
2008-05-11 23:20     ` [PATCH 3/9] HID: hid, make parsing event driven Marcel Holtmann
2008-05-14  9:34       ` Jiri Slaby
2008-05-14 12:08         ` Jiri Kosina
2008-05-11 23:05   ` [PATCH 2/9] HID: make a bus from hid code Marcel Holtmann
2008-05-14  9:30     ` Jiri Slaby
2008-05-15  9:11       ` Marcel Holtmann

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=1210547759.16390.34.camel@violet.holtmann.net \
    --to=marcel@holtmann.org \
    --cc=akpm@linux-foundation.org \
    --cc=anssi.hannula@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jirislaby@gmail.com \
    --cc=jkosina@suse.cz \
    --cc=jslaby@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@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