linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] HID: Fix reporting of nonexistent HWheel for Elecom BM084 (bluetooth mouse).
@ 2010-06-28 11:45 Richard Nauber
  2010-06-28 16:34 ` Dmitry Torokhov
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Nauber @ 2010-06-28 11:45 UTC (permalink / raw)
  To: Dmitry Torokhov, linux-input

Hi,
my last patch was missing the blacklist entry in hid-core.c.
Now I think it is complete. It would be nice if you could review 
it and add it to the input-tree, in case it is ready...

Greetings,
Richard

--snip--

HID: Fix reporting of nonexistent HWheel for Elecom BM084 (bluetooth mouse).

This patch removes the annoying feature of Elecoms BM084 to constantly scroll to the right.
The device can be found at:
http://www.dealextreme.com/details.dx/sku.15402

Signed-off-by:  Richard Nauber <Richard.Nauber@gmail.com>
---
 drivers/hid/Kconfig      |    6 +++++
 drivers/hid/Makefile     |    1 +
 drivers/hid/hid-core.c   |    1 +
 drivers/hid/hid-elecom.c |   57 ++++++++++++++++++++++++++++++++++++++++++++++
 drivers/hid/hid-ids.h    |    3 ++
 5 files changed, 68 insertions(+), 0 deletions(-)
 create mode 100644 drivers/hid/hid-elecom.c

diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
index 132278f..0eac193 100644
--- a/drivers/hid/Kconfig
+++ b/drivers/hid/Kconfig
@@ -148,6 +148,12 @@ config HID_EGALAX
 	---help---
 	Support for the eGalax dual-touch panel.

+config HID_ELECOM
+	tristate "ELECOM"
+	depends on USB_HID
+	---help---
+	Support for the ELECOM BM084 (bluetooth mouse).
+
 config HID_EZKEY
 	tristate "Ezkey" if EMBEDDED
 	depends on USB_HID
diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile
index 987fa06..2ec042f 100644
--- a/drivers/hid/Makefile
+++ b/drivers/hid/Makefile
@@ -32,6 +32,7 @@ obj-$(CONFIG_HID_CHICONY)	+= hid-chicony.o
 obj-$(CONFIG_HID_CYPRESS)	+= hid-cypress.o
 obj-$(CONFIG_HID_DRAGONRISE)	+= hid-drff.o
 obj-$(CONFIG_HID_EGALAX)	+= hid-egalax.o
+obj-$(CONFIG_HID_ELECOM)	+= hid-elecom.o
 obj-$(CONFIG_HID_EZKEY)		+= hid-ezkey.o
 obj-$(CONFIG_HID_GYRATION)	+= hid-gyration.o
 obj-$(CONFIG_HID_KENSINGTON)	+= hid-kensington.o
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index aa0f7dc..59ea24e 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1294,6 +1294,7 @@ static const struct hid_device_id hid_blacklist[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_MOUSE) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_DRAGONRISE, 0x0006) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH) },
+	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_EZKEY, USB_DEVICE_ID_BTC_8193) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_GAMERON, USB_DEVICE_ID_GAMERON_DUAL_PSX_ADAPTOR) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_GAMERON, USB_DEVICE_ID_GAMERON_DUAL_PCS_ADAPTOR) },
diff --git a/drivers/hid/hid-elecom.c b/drivers/hid/hid-elecom.c
new file mode 100644
index 0000000..7a40878
--- /dev/null
+++ b/drivers/hid/hid-elecom.c
@@ -0,0 +1,57 @@
+/*
+ *  HID driver for Elecom BM084 (bluetooth mouse).
+ *  Removes a non-existing horizontal wheel from
+ *  the HID descriptor.
+ *  (This module is based on "hid-ortek".)
+ *
+ *  Copyright (c) 2010 Richard Nauber <Richard.Nauber@gmail.com>
+ */
+
+/*
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ */
+
+#include <linux/device.h>
+#include <linux/hid.h>
+#include <linux/module.h>
+
+#include "hid-ids.h"
+
+static void elecom_report_fixup(struct hid_device *hdev, __u8 *rdesc,
+		unsigned int rsize)
+{
+	if (rsize >= 48 && rdesc[46] == 0x05 && rdesc[47] == 0x0c) {
+		dev_info(&hdev->dev, "Fixing up Elecom BM084 "
+				"report descriptor.\n");
+		rdesc[47] = 0x00;
+	}
+}
+
+static const struct hid_device_id elecom_devices[] = {
+	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084)},
+	{ }
+};
+MODULE_DEVICE_TABLE(hid, elecom_devices);
+
+static struct hid_driver elecom_driver = {
+	.name = "elecom",
+	.id_table = elecom_devices,
+	.report_fixup = elecom_report_fixup
+};
+
+static int __init elecom_init(void)
+{
+	return hid_register_driver(&elecom_driver);
+}
+
+static void __exit elecom_exit(void)
+{
+	hid_unregister_driver(&elecom_driver);
+}
+
+module_init(elecom_init);
+module_exit(elecom_exit);
+MODULE_LICENSE("GPL");
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 6af77ed..55cecb7 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -186,6 +186,9 @@
 #define USB_DEVICE_ID_EGALAX_TOUCHCONTROLLER	0x0001
 #define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH	0x480d

+#define USB_VENDOR_ID_ELECOM		0x056e
+#define USB_DEVICE_ID_ELECOM_BM084	0x0061
+
 #define USB_VENDOR_ID_ELO		0x04E7
 #define USB_DEVICE_ID_ELO_TS2700	0x0020

-- 
1.6.4.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] HID: Fix reporting of nonexistent HWheel for Elecom BM084 (bluetooth mouse).
  2010-06-28 11:45 [PATCH v2] HID: Fix reporting of nonexistent HWheel for Elecom BM084 (bluetooth mouse) Richard Nauber
@ 2010-06-28 16:34 ` Dmitry Torokhov
  2010-06-28 16:39   ` Jiri Kosina
  0 siblings, 1 reply; 6+ messages in thread
From: Dmitry Torokhov @ 2010-06-28 16:34 UTC (permalink / raw)
  To: Richard Nauber; +Cc: linux-input, Jiri Kosina

Hi Richard,

HID changes shoudl go toJiri (CCed).

Thanks.

On Mon, Jun 28, 2010 at 01:45:27PM +0200, Richard Nauber wrote:
> Hi,
> my last patch was missing the blacklist entry in hid-core.c.
> Now I think it is complete. It would be nice if you could review 
> it and add it to the input-tree, in case it is ready...
> 
> Greetings,
> Richard
> 
> --snip--
> 
> HID: Fix reporting of nonexistent HWheel for Elecom BM084 (bluetooth mouse).
> 
> This patch removes the annoying feature of Elecoms BM084 to constantly scroll to the right.
> The device can be found at:
> http://www.dealextreme.com/details.dx/sku.15402
> 
> Signed-off-by:  Richard Nauber <Richard.Nauber@gmail.com>
> ---
>  drivers/hid/Kconfig      |    6 +++++
>  drivers/hid/Makefile     |    1 +
>  drivers/hid/hid-core.c   |    1 +
>  drivers/hid/hid-elecom.c |   57 ++++++++++++++++++++++++++++++++++++++++++++++
>  drivers/hid/hid-ids.h    |    3 ++
>  5 files changed, 68 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/hid/hid-elecom.c
> 
> diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
> index 132278f..0eac193 100644
> --- a/drivers/hid/Kconfig
> +++ b/drivers/hid/Kconfig
> @@ -148,6 +148,12 @@ config HID_EGALAX
>  	---help---
>  	Support for the eGalax dual-touch panel.
> 
> +config HID_ELECOM
> +	tristate "ELECOM"
> +	depends on USB_HID
> +	---help---
> +	Support for the ELECOM BM084 (bluetooth mouse).
> +
>  config HID_EZKEY
>  	tristate "Ezkey" if EMBEDDED
>  	depends on USB_HID
> diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile
> index 987fa06..2ec042f 100644
> --- a/drivers/hid/Makefile
> +++ b/drivers/hid/Makefile
> @@ -32,6 +32,7 @@ obj-$(CONFIG_HID_CHICONY)	+= hid-chicony.o
>  obj-$(CONFIG_HID_CYPRESS)	+= hid-cypress.o
>  obj-$(CONFIG_HID_DRAGONRISE)	+= hid-drff.o
>  obj-$(CONFIG_HID_EGALAX)	+= hid-egalax.o
> +obj-$(CONFIG_HID_ELECOM)	+= hid-elecom.o
>  obj-$(CONFIG_HID_EZKEY)		+= hid-ezkey.o
>  obj-$(CONFIG_HID_GYRATION)	+= hid-gyration.o
>  obj-$(CONFIG_HID_KENSINGTON)	+= hid-kensington.o
> diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
> index aa0f7dc..59ea24e 100644
> --- a/drivers/hid/hid-core.c
> +++ b/drivers/hid/hid-core.c
> @@ -1294,6 +1294,7 @@ static const struct hid_device_id hid_blacklist[] = {
>  	{ HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_MOUSE) },
>  	{ HID_USB_DEVICE(USB_VENDOR_ID_DRAGONRISE, 0x0006) },
>  	{ HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH) },
> +	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084) },
>  	{ HID_USB_DEVICE(USB_VENDOR_ID_EZKEY, USB_DEVICE_ID_BTC_8193) },
>  	{ HID_USB_DEVICE(USB_VENDOR_ID_GAMERON, USB_DEVICE_ID_GAMERON_DUAL_PSX_ADAPTOR) },
>  	{ HID_USB_DEVICE(USB_VENDOR_ID_GAMERON, USB_DEVICE_ID_GAMERON_DUAL_PCS_ADAPTOR) },
> diff --git a/drivers/hid/hid-elecom.c b/drivers/hid/hid-elecom.c
> new file mode 100644
> index 0000000..7a40878
> --- /dev/null
> +++ b/drivers/hid/hid-elecom.c
> @@ -0,0 +1,57 @@
> +/*
> + *  HID driver for Elecom BM084 (bluetooth mouse).
> + *  Removes a non-existing horizontal wheel from
> + *  the HID descriptor.
> + *  (This module is based on "hid-ortek".)
> + *
> + *  Copyright (c) 2010 Richard Nauber <Richard.Nauber@gmail.com>
> + */
> +
> +/*
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License as published by the Free
> + * Software Foundation; either version 2 of the License, or (at your option)
> + * any later version.
> + */
> +
> +#include <linux/device.h>
> +#include <linux/hid.h>
> +#include <linux/module.h>
> +
> +#include "hid-ids.h"
> +
> +static void elecom_report_fixup(struct hid_device *hdev, __u8 *rdesc,
> +		unsigned int rsize)
> +{
> +	if (rsize >= 48 && rdesc[46] == 0x05 && rdesc[47] == 0x0c) {
> +		dev_info(&hdev->dev, "Fixing up Elecom BM084 "
> +				"report descriptor.\n");
> +		rdesc[47] = 0x00;
> +	}
> +}
> +
> +static const struct hid_device_id elecom_devices[] = {
> +	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084)},
> +	{ }
> +};
> +MODULE_DEVICE_TABLE(hid, elecom_devices);
> +
> +static struct hid_driver elecom_driver = {
> +	.name = "elecom",
> +	.id_table = elecom_devices,
> +	.report_fixup = elecom_report_fixup
> +};
> +
> +static int __init elecom_init(void)
> +{
> +	return hid_register_driver(&elecom_driver);
> +}
> +
> +static void __exit elecom_exit(void)
> +{
> +	hid_unregister_driver(&elecom_driver);
> +}
> +
> +module_init(elecom_init);
> +module_exit(elecom_exit);
> +MODULE_LICENSE("GPL");
> diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
> index 6af77ed..55cecb7 100644
> --- a/drivers/hid/hid-ids.h
> +++ b/drivers/hid/hid-ids.h
> @@ -186,6 +186,9 @@
>  #define USB_DEVICE_ID_EGALAX_TOUCHCONTROLLER	0x0001
>  #define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH	0x480d
> 
> +#define USB_VENDOR_ID_ELECOM		0x056e
> +#define USB_DEVICE_ID_ELECOM_BM084	0x0061
> +
>  #define USB_VENDOR_ID_ELO		0x04E7
>  #define USB_DEVICE_ID_ELO_TS2700	0x0020
> 
> -- 
> 1.6.4.2
> 

-- 
Dmitry

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] HID: Fix reporting of nonexistent HWheel for Elecom BM084 (bluetooth mouse).
  2010-06-28 16:34 ` Dmitry Torokhov
@ 2010-06-28 16:39   ` Jiri Kosina
  2010-06-28 16:54     ` Richard Nauber
  0 siblings, 1 reply; 6+ messages in thread
From: Jiri Kosina @ 2010-06-28 16:39 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Richard Nauber, linux-input

On Mon, 28 Jun 2010, Dmitry Torokhov wrote:

> Hi Richard,
> 
> HID changes shoudl go toJiri (CCed).

Thanks.

> > HID: Fix reporting of nonexistent HWheel for Elecom BM084 (bluetooth mouse).
> > 
> > This patch removes the annoying feature of Elecoms BM084 to constantly scroll to the right.
> > The device can be found at:
> > http://www.dealextreme.com/details.dx/sku.15402
> > 
> > Signed-off-by:  Richard Nauber <Richard.Nauber@gmail.com>
> > ---
> >  drivers/hid/Kconfig      |    6 +++++
> >  drivers/hid/Makefile     |    1 +
> >  drivers/hid/hid-core.c   |    1 +
> >  drivers/hid/hid-elecom.c |   57 ++++++++++++++++++++++++++++++++++++++++++++++
> >  drivers/hid/hid-ids.h    |    3 ++
> >  5 files changed, 68 insertions(+), 0 deletions(-)
> >  create mode 100644 drivers/hid/hid-elecom.c
> > 
> > diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
> > index 132278f..0eac193 100644
> > --- a/drivers/hid/Kconfig
> > +++ b/drivers/hid/Kconfig
> > @@ -148,6 +148,12 @@ config HID_EGALAX
> >  	---help---
> >  	Support for the eGalax dual-touch panel.
> > 
> > +config HID_ELECOM
> > +	tristate "ELECOM"
> > +	depends on USB_HID

As this is apparently Bluetooth HID device, BT_HIDP would be the correct 
dependency here, right?

> > +	---help---
> > +	Support for the ELECOM BM084 (bluetooth mouse).
> > +
> >  config HID_EZKEY
> >  	tristate "Ezkey" if EMBEDDED
> >  	depends on USB_HID
> > diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile
> > index 987fa06..2ec042f 100644
> > --- a/drivers/hid/Makefile
> > +++ b/drivers/hid/Makefile
> > @@ -32,6 +32,7 @@ obj-$(CONFIG_HID_CHICONY)	+= hid-chicony.o
> >  obj-$(CONFIG_HID_CYPRESS)	+= hid-cypress.o
> >  obj-$(CONFIG_HID_DRAGONRISE)	+= hid-drff.o
> >  obj-$(CONFIG_HID_EGALAX)	+= hid-egalax.o
> > +obj-$(CONFIG_HID_ELECOM)	+= hid-elecom.o
> >  obj-$(CONFIG_HID_EZKEY)		+= hid-ezkey.o
> >  obj-$(CONFIG_HID_GYRATION)	+= hid-gyration.o
> >  obj-$(CONFIG_HID_KENSINGTON)	+= hid-kensington.o
> > diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
> > index aa0f7dc..59ea24e 100644
> > --- a/drivers/hid/hid-core.c
> > +++ b/drivers/hid/hid-core.c
> > @@ -1294,6 +1294,7 @@ static const struct hid_device_id hid_blacklist[] = {
> >  	{ HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_MOUSE) },
> >  	{ HID_USB_DEVICE(USB_VENDOR_ID_DRAGONRISE, 0x0006) },
> >  	{ HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH) },
> > +	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084) },
> >  	{ HID_USB_DEVICE(USB_VENDOR_ID_EZKEY, USB_DEVICE_ID_BTC_8193) },
> >  	{ HID_USB_DEVICE(USB_VENDOR_ID_GAMERON, USB_DEVICE_ID_GAMERON_DUAL_PSX_ADAPTOR) },
> >  	{ HID_USB_DEVICE(USB_VENDOR_ID_GAMERON, USB_DEVICE_ID_GAMERON_DUAL_PCS_ADAPTOR) },
> > diff --git a/drivers/hid/hid-elecom.c b/drivers/hid/hid-elecom.c
> > new file mode 100644
> > index 0000000..7a40878
> > --- /dev/null
> > +++ b/drivers/hid/hid-elecom.c
> > @@ -0,0 +1,57 @@
> > +/*
> > + *  HID driver for Elecom BM084 (bluetooth mouse).
> > + *  Removes a non-existing horizontal wheel from
> > + *  the HID descriptor.
> > + *  (This module is based on "hid-ortek".)
> > + *
> > + *  Copyright (c) 2010 Richard Nauber <Richard.Nauber@gmail.com>
> > + */
> > +
> > +/*
> > + * This program is free software; you can redistribute it and/or modify it
> > + * under the terms of the GNU General Public License as published by the Free
> > + * Software Foundation; either version 2 of the License, or (at your option)
> > + * any later version.
> > + */
> > +
> > +#include <linux/device.h>
> > +#include <linux/hid.h>
> > +#include <linux/module.h>
> > +
> > +#include "hid-ids.h"
> > +
> > +static void elecom_report_fixup(struct hid_device *hdev, __u8 *rdesc,
> > +		unsigned int rsize)
> > +{
> > +	if (rsize >= 48 && rdesc[46] == 0x05 && rdesc[47] == 0x0c) {
> > +		dev_info(&hdev->dev, "Fixing up Elecom BM084 "
> > +				"report descriptor.\n");
> > +		rdesc[47] = 0x00;
> > +	}
> > +}
> > +
> > +static const struct hid_device_id elecom_devices[] = {
> > +	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084)},
> > +	{ }
> > +};
> > +MODULE_DEVICE_TABLE(hid, elecom_devices);
> > +
> > +static struct hid_driver elecom_driver = {
> > +	.name = "elecom",
> > +	.id_table = elecom_devices,
> > +	.report_fixup = elecom_report_fixup
> > +};
> > +
> > +static int __init elecom_init(void)
> > +{
> > +	return hid_register_driver(&elecom_driver);
> > +}
> > +
> > +static void __exit elecom_exit(void)
> > +{
> > +	hid_unregister_driver(&elecom_driver);
> > +}
> > +
> > +module_init(elecom_init);
> > +module_exit(elecom_exit);
> > +MODULE_LICENSE("GPL");
> > diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
> > index 6af77ed..55cecb7 100644
> > --- a/drivers/hid/hid-ids.h
> > +++ b/drivers/hid/hid-ids.h
> > @@ -186,6 +186,9 @@
> >  #define USB_DEVICE_ID_EGALAX_TOUCHCONTROLLER	0x0001
> >  #define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH	0x480d
> > 
> > +#define USB_VENDOR_ID_ELECOM		0x056e
> > +#define USB_DEVICE_ID_ELECOM_BM084	0x0061
> > +
> >  #define USB_VENDOR_ID_ELO		0x04E7
> >  #define USB_DEVICE_ID_ELO_TS2700	0x0020

Thanks,

-- 
Jiri Kosina
SUSE Labs, Novell Inc.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] HID: Fix reporting of nonexistent HWheel for Elecom BM084 (bluetooth mouse).
  2010-06-28 16:39   ` Jiri Kosina
@ 2010-06-28 16:54     ` Richard Nauber
  2010-06-28 17:01       ` Jiri Kosina
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Nauber @ 2010-06-28 16:54 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: linux-input, Dmitry Torokhov

Ok, how about this:

-snip-

This patch removes the annoying feature of Elecoms BM084 to constantly scroll to the right.
The device can be found at:
http://www.dealextreme.com/details.dx/sku.15402

Signed-off-by:  Richard Nauber <Richard.Nauber@gmail.com>
---
 drivers/hid/Kconfig      |    6 +++++
 drivers/hid/Makefile     |    1 +
 drivers/hid/hid-core.c   |    1 +
 drivers/hid/hid-elecom.c |   57 ++++++++++++++++++++++++++++++++++++++++++++++
 drivers/hid/hid-ids.h    |    3 ++
 5 files changed, 68 insertions(+), 0 deletions(-)
 create mode 100644 drivers/hid/hid-elecom.c

diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
index 132278f..0eac193 100644
--- a/drivers/hid/Kconfig
+++ b/drivers/hid/Kconfig
@@ -148,6 +148,12 @@ config HID_EGALAX
 	---help---
 	Support for the eGalax dual-touch panel.
 
+config HID_ELECOM
+	tristate "ELECOM"
+	depends on BT_HIDP
+	---help---
+	Support for the ELECOM BM084 (bluetooth mouse).
+
 config HID_EZKEY
 	tristate "Ezkey" if EMBEDDED
 	depends on USB_HID
diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile
index 987fa06..2ec042f 100644
--- a/drivers/hid/Makefile
+++ b/drivers/hid/Makefile
@@ -32,6 +32,7 @@ obj-$(CONFIG_HID_CHICONY)	+= hid-chicony.o
 obj-$(CONFIG_HID_CYPRESS)	+= hid-cypress.o
 obj-$(CONFIG_HID_DRAGONRISE)	+= hid-drff.o
 obj-$(CONFIG_HID_EGALAX)	+= hid-egalax.o
+obj-$(CONFIG_HID_ELECOM)	+= hid-elecom.o
 obj-$(CONFIG_HID_EZKEY)		+= hid-ezkey.o
 obj-$(CONFIG_HID_GYRATION)	+= hid-gyration.o
 obj-$(CONFIG_HID_KENSINGTON)	+= hid-kensington.o
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index aa0f7dc..59ea24e 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1294,6 +1294,7 @@ static const struct hid_device_id hid_blacklist[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_MOUSE) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_DRAGONRISE, 0x0006) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH) },
+	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_EZKEY, USB_DEVICE_ID_BTC_8193) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_GAMERON, USB_DEVICE_ID_GAMERON_DUAL_PSX_ADAPTOR) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_GAMERON, USB_DEVICE_ID_GAMERON_DUAL_PCS_ADAPTOR) },
diff --git a/drivers/hid/hid-elecom.c b/drivers/hid/hid-elecom.c
new file mode 100644
index 0000000..7a40878
--- /dev/null
+++ b/drivers/hid/hid-elecom.c
@@ -0,0 +1,57 @@
+/*
+ *  HID driver for Elecom BM084 (bluetooth mouse).
+ *  Removes a non-existing horizontal wheel from
+ *  the HID descriptor.
+ *  (This module is based on "hid-ortek".)
+ *
+ *  Copyright (c) 2010 Richard Nauber <Richard.Nauber@gmail.com>
+ */
+
+/*
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ */
+
+#include <linux/device.h>
+#include <linux/hid.h>
+#include <linux/module.h>
+
+#include "hid-ids.h"
+
+static void elecom_report_fixup(struct hid_device *hdev, __u8 *rdesc,
+		unsigned int rsize)
+{
+	if (rsize >= 48 && rdesc[46] == 0x05 && rdesc[47] == 0x0c) {
+		dev_info(&hdev->dev, "Fixing up Elecom BM084 "
+				"report descriptor.\n");
+		rdesc[47] = 0x00;
+	}
+}
+
+static const struct hid_device_id elecom_devices[] = {
+	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084)},
+	{ } heads up and
+};
+MODULE_DEVICE_TABLE(hid, elecom_devices);
+
+static struct hid_driver elecom_driver = {
+	.name = "elecom",
+	.id_table = elecom_devices,
+	.report_fixup = elecom_report_fixup
+};
+
+static int __init elecom_init(void)
+{
+	return hid_register_driver(&elecom_driver);
+}
+
+static void __exit elecom_exit(void)
+{
+	hid_unregister_driver(&elecom_driver);
+}
+
+module_init(elecom_init);
+module_exit(elecom_exit);
+MODULE_LICENSE("GPL");
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 6af77ed..55cecb7 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -186,6 +186,9 @@
 #define USB_DEVICE_ID_EGALAX_TOUCHCONTROLLER	0x0001
 #define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH	0x480d
 
+#define USB_VENDOR_ID_ELECOM		0x056e
+#define USB_DEVICE_ID_ELECOM_BM084	0x0061
+
 #define USB_VENDOR_ID_ELO		0x04E7
 #define USB_DEVICE_ID_ELO_TS2700	0x0020
 
-- 
1.6.4.2



Thanks for the review (and to Dmitry for pointing me into the right direction, spacibo!)
Richard



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] HID: Fix reporting of nonexistent HWheel for Elecom BM084 (bluetooth mouse).
  2010-06-28 16:54     ` Richard Nauber
@ 2010-06-28 17:01       ` Jiri Kosina
  2010-06-28 17:11         ` Richard Nauber
  0 siblings, 1 reply; 6+ messages in thread
From: Jiri Kosina @ 2010-06-28 17:01 UTC (permalink / raw)
  To: Richard Nauber; +Cc: linux-input, Dmitry Torokhov

On Mon, 28 Jun 2010, Richard Nauber wrote:

> Ok, how about this:
[ ... snip ... ]
> +static void elecom_report_fixup(struct hid_device *hdev, __u8 *rdesc,
> +		unsigned int rsize)
> +{
> +	if (rsize >= 48 && rdesc[46] == 0x05 && rdesc[47] == 0x0c) {
> +		dev_info(&hdev->dev, "Fixing up Elecom BM084 "
> +				"report descriptor.\n");
> +		rdesc[47] = 0x00;
> +	}
> +}
> +
> +static const struct hid_device_id elecom_devices[] = {
> +	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084)},
> +	{ } heads up and

What is this? :)

I will fix that mess up and apply to my tree.

Thanks for the driver!

-- 
Jiri Kosina
SUSE Labs, Novell Inc.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] HID: Fix reporting of nonexistent HWheel for Elecom BM084 (bluetooth mouse).
  2010-06-28 17:01       ` Jiri Kosina
@ 2010-06-28 17:11         ` Richard Nauber
  0 siblings, 0 replies; 6+ messages in thread
From: Richard Nauber @ 2010-06-28 17:11 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: linux-input

On 06/28/2010 07:01 PM, Jiri Kosina wrote:
> On Mon, 28 Jun 2010, Richard Nauber wrote:
> 
>> Ok, how about this:
> [ ... snip ... ]
>> +static void elecom_report_fixup(struct hid_device *hdev, __u8 *rdesc,
>> +		unsigned int rsize)
>> +{
>> +	if (rsize >= 48 && rdesc[46] == 0x05 && rdesc[47] == 0x0c) {
>> +		dev_info(&hdev->dev, "Fixing up Elecom BM084 "
>> +				"report descriptor.\n");
>> +		rdesc[47] = 0x00;
>> +	}
>> +}
>> +
>> +static const struct hid_device_id elecom_devices[] = {
>> +	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084)},
>> +	{ } heads up and

> What is this? :)

Whops, I was looking for that phrase. It is probably missing in an other message :)
 
> I will fix that mess up and apply to my tree.

Thanks for that,
Richard

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-06-28 17:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-28 11:45 [PATCH v2] HID: Fix reporting of nonexistent HWheel for Elecom BM084 (bluetooth mouse) Richard Nauber
2010-06-28 16:34 ` Dmitry Torokhov
2010-06-28 16:39   ` Jiri Kosina
2010-06-28 16:54     ` Richard Nauber
2010-06-28 17:01       ` Jiri Kosina
2010-06-28 17:11         ` Richard Nauber

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).