aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2007-03-29 04:20:25 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-29 11:22:24 -0400
commitcb3fecc2f29056e89658e7eb371e7f9be66cda6d (patch)
tree0a524506bae0897fea6b865db88d9c5c7ccaf379 /net
parente6d1fc3d83317678a57db1c1deb2fc0bede73aaf (diff)
[PATCH] bluetooth hid quirks: mightymouse quirk
I have a bugreport that scrollwheel of bluetooth version of apple mightymouse doesn't work. The USB version of mightymouse works, as there is a quirk for handling scrollwheel in hid/usbhid for it. Now that bluetooth git tree is hooked to generic hid layer, it could easily use the quirks which are already present in generic hid parser, hid-input, etc. Below is a simple patch against bluetooth git tree, which adds quirk handling to current bluetooth hidp code, and sets quirk flags for device 0x05ac/0x030c, which is the bluetooth version of the apple mightymouse. Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/hidp/core.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
index ecfe8da1ce6b..d342e89b8bdd 100644
--- a/net/bluetooth/hidp/core.c
+++ b/net/bluetooth/hidp/core.c
@@ -679,6 +679,27 @@ static void hidp_close(struct hid_device *hid)
679{ 679{
680} 680}
681 681
682static const struct {
683 __u16 idVendor;
684 __u16 idProduct;
685 unsigned quirks;
686} hidp_blacklist[] = {
687 /* Apple wireless Mighty Mouse */
688 { 0x05ac, 0x030c, HID_QUIRK_MIGHTYMOUSE | HID_QUIRK_INVERT_HWHEEL },
689
690 { } /* Terminating entry */
691};
692
693static void hidp_setup_quirks(struct hid_device *hid)
694{
695 unsigned int n;
696
697 for (n = 0; hidp_blacklist[n].idVendor; n++)
698 if (hidp_blacklist[n].idVendor == le16_to_cpu(hid->vendor) &&
699 hidp_blacklist[n].idProduct == le16_to_cpu(hid->product))
700 hid->quirks = hidp_blacklist[n].quirks;
701}
702
682static inline void hidp_setup_hid(struct hidp_session *session, struct hidp_connadd_req *req) 703static inline void hidp_setup_hid(struct hidp_session *session, struct hidp_connadd_req *req)
683{ 704{
684 struct hid_device *hid = session->hid; 705 struct hid_device *hid = session->hid;
@@ -708,6 +729,8 @@ static inline void hidp_setup_hid(struct hidp_session *session, struct hidp_conn
708 729
709 hid->hidinput_input_event = hidp_hidinput_event; 730 hid->hidinput_input_event = hidp_hidinput_event;
710 731
732 hidp_setup_quirks(hid);
733
711 list_for_each_entry(report, &hid->report_enum[HID_INPUT_REPORT].report_list, list) 734 list_for_each_entry(report, &hid->report_enum[HID_INPUT_REPORT].report_list, list)
712 hidp_send_report(session, report); 735 hidp_send_report(session, report);
713 736