diff options
author | Dmitry Torokhov <dtor_core@ameritech.net> | 2006-06-26 01:31:38 -0400 |
---|---|---|
committer | Dmitry Torokhov <dtor_core@ameritech.net> | 2006-06-26 01:31:38 -0400 |
commit | 4854c7b27f0975a2b629f35ea3996d2968eb7c4f (patch) | |
tree | 4102bdb70289764a2058aff0f907b13d7cf0e0d1 /drivers/usb/input | |
parent | 3cbd5b32cb625f5c0f1b1476d154fac873dd49ce (diff) | |
parent | fcc18e83e1f6fd9fa6b333735bf0fcd530655511 (diff) | |
download | op-kernel-dev-4854c7b27f0975a2b629f35ea3996d2968eb7c4f.zip op-kernel-dev-4854c7b27f0975a2b629f35ea3996d2968eb7c4f.tar.gz |
Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'drivers/usb/input')
-rw-r--r-- | drivers/usb/input/acecad.c | 4 | ||||
-rw-r--r-- | drivers/usb/input/aiptek.c | 4 | ||||
-rw-r--r-- | drivers/usb/input/appletouch.c | 117 | ||||
-rw-r--r-- | drivers/usb/input/ati_remote.c | 4 | ||||
-rw-r--r-- | drivers/usb/input/ati_remote2.c | 2 | ||||
-rw-r--r-- | drivers/usb/input/hid-core.c | 83 | ||||
-rw-r--r-- | drivers/usb/input/hid-input.c | 36 | ||||
-rw-r--r-- | drivers/usb/input/hid.h | 11 | ||||
-rw-r--r-- | drivers/usb/input/itmtouch.c | 4 | ||||
-rw-r--r-- | drivers/usb/input/kbtab.c | 5 | ||||
-rw-r--r-- | drivers/usb/input/keyspan_remote.c | 4 | ||||
-rw-r--r-- | drivers/usb/input/mtouchusb.c | 4 | ||||
-rw-r--r-- | drivers/usb/input/powermate.c | 4 | ||||
-rw-r--r-- | drivers/usb/input/touchkitusb.c | 4 | ||||
-rw-r--r-- | drivers/usb/input/usbkbd.c | 4 | ||||
-rw-r--r-- | drivers/usb/input/usbmouse.c | 4 | ||||
-rw-r--r-- | drivers/usb/input/usbtouchscreen.c | 2 | ||||
-rw-r--r-- | drivers/usb/input/wacom.c | 5 | ||||
-rw-r--r-- | drivers/usb/input/xpad.c | 4 | ||||
-rw-r--r-- | drivers/usb/input/yealink.c | 4 |
20 files changed, 205 insertions, 104 deletions
diff --git a/drivers/usb/input/acecad.c b/drivers/usb/input/acecad.c index df29b80..18c10e1 100644 --- a/drivers/usb/input/acecad.c +++ b/drivers/usb/input/acecad.c @@ -27,11 +27,9 @@ #include <linux/kernel.h> #include <linux/slab.h> -#include <linux/input.h> #include <linux/module.h> #include <linux/init.h> -#include <linux/usb.h> -#include <linux/usb_input.h> +#include <linux/usb/input.h> /* * Version Information diff --git a/drivers/usb/input/aiptek.c b/drivers/usb/input/aiptek.c index a6693b0..b138dae 100644 --- a/drivers/usb/input/aiptek.c +++ b/drivers/usb/input/aiptek.c @@ -73,11 +73,9 @@ #include <linux/jiffies.h> #include <linux/kernel.h> #include <linux/slab.h> -#include <linux/input.h> #include <linux/module.h> #include <linux/init.h> -#include <linux/usb.h> -#include <linux/usb_input.h> +#include <linux/usb/input.h> #include <linux/sched.h> #include <asm/uaccess.h> #include <asm/unaligned.h> diff --git a/drivers/usb/input/appletouch.c b/drivers/usb/input/appletouch.c index c222ed1..3685506 100644 --- a/drivers/usb/input/appletouch.c +++ b/drivers/usb/input/appletouch.c @@ -1,5 +1,5 @@ /* - * Apple USB Touchpad (for post-February 2005 PowerBooks) driver + * Apple USB Touchpad (for post-February 2005 PowerBooks and MacBooks) driver * * Copyright (C) 2001-2004 Greg Kroah-Hartman (greg@kroah.com) * Copyright (C) 2005 Johannes Berg (johannes@sipsolutions.net) @@ -7,6 +7,7 @@ * Copyright (C) 2005 Frank Arnold (frank@scirocco-5v-turbo.de) * Copyright (C) 2005 Peter Osterlund (petero2@telia.com) * Copyright (C) 2005 Michael Hanselmann (linux-kernel@hansmi.ch) + * Copyright (C) 2006 Nicolas Boichat (nicolas@boichat.ch) * * Thanks to Alex Harper <basilisk@foobox.net> for his inputs. * @@ -32,9 +33,7 @@ #include <linux/init.h> #include <linux/slab.h> #include <linux/module.h> -#include <linux/usb.h> -#include <linux/input.h> -#include <linux/usb_input.h> +#include <linux/usb/input.h> /* Apple has powerbooks which have the keyboard with different Product IDs */ #define APPLE_VENDOR_ID 0x05AC @@ -44,6 +43,11 @@ #define GEYSER_ISO_PRODUCT_ID 0x0215 #define GEYSER_JIS_PRODUCT_ID 0x0216 +/* MacBook devices */ +#define GEYSER3_ANSI_PRODUCT_ID 0x0217 +#define GEYSER3_ISO_PRODUCT_ID 0x0218 +#define GEYSER3_JIS_PRODUCT_ID 0x0219 + #define ATP_DEVICE(prod) \ .match_flags = USB_DEVICE_ID_MATCH_DEVICE | \ USB_DEVICE_ID_MATCH_INT_CLASS | \ @@ -65,6 +69,10 @@ static struct usb_device_id atp_table [] = { { ATP_DEVICE(GEYSER_ISO_PRODUCT_ID) }, { ATP_DEVICE(GEYSER_JIS_PRODUCT_ID) }, + { ATP_DEVICE(GEYSER3_ANSI_PRODUCT_ID) }, + { ATP_DEVICE(GEYSER3_ISO_PRODUCT_ID) }, + { ATP_DEVICE(GEYSER3_JIS_PRODUCT_ID) }, + /* Terminating entry */ { } }; @@ -101,6 +109,13 @@ MODULE_DEVICE_TABLE (usb, atp_table); */ #define ATP_THRESHOLD 5 +/* MacBook Pro (Geyser 3) initialization constants */ +#define ATP_GEYSER3_MODE_READ_REQUEST_ID 1 +#define ATP_GEYSER3_MODE_WRITE_REQUEST_ID 9 +#define ATP_GEYSER3_MODE_REQUEST_VALUE 0x300 +#define ATP_GEYSER3_MODE_REQUEST_INDEX 0 +#define ATP_GEYSER3_MODE_VENDOR_VALUE 0x04 + /* Structure to hold all of our device specific stuff */ struct atp { char phys[64]; @@ -147,13 +162,22 @@ MODULE_PARM_DESC(debug, "Activate debugging output"); /* Checks if the device a Geyser 2 (ANSI, ISO, JIS) */ static inline int atp_is_geyser_2(struct atp *dev) { - int16_t productId = le16_to_cpu(dev->udev->descriptor.idProduct); + u16 productId = le16_to_cpu(dev->udev->descriptor.idProduct); return (productId == GEYSER_ANSI_PRODUCT_ID) || (productId == GEYSER_ISO_PRODUCT_ID) || (productId == GEYSER_JIS_PRODUCT_ID); } +static inline int atp_is_geyser_3(struct atp *dev) +{ + u16 productId = le16_to_cpu(dev->udev->descriptor.idProduct); + + return (productId == GEYSER3_ANSI_PRODUCT_ID) || + (productId == GEYSER3_ISO_PRODUCT_ID) || + (productId == GEYSER3_JIS_PRODUCT_ID); +} + static int atp_calculate_abs(int *xy_sensors, int nb_sensors, int fact, int *z, int *fingers) { @@ -219,12 +243,33 @@ static void atp_complete(struct urb* urb, struct pt_regs* regs) /* drop incomplete datasets */ if (dev->urb->actual_length != dev->datalen) { - dprintk("appletouch: incomplete data package.\n"); + dprintk("appletouch: incomplete data package" + " (first byte: %d, length: %d).\n", + dev->data[0], dev->urb->actual_length); goto exit; } /* reorder the sensors values */ - if (atp_is_geyser_2(dev)) { + if (atp_is_geyser_3(dev)) { + memset(dev->xy_cur, 0, sizeof(dev->xy_cur)); + + /* + * The values are laid out like this: + * -, Y1, Y2, -, Y3, Y4, -, ..., -, X1, X2, -, X3, X4, ... + * '-' is an unused value. + */ + + /* read X values */ + for (i = 0, j = 19; i < 20; i += 2, j += 3) { + dev->xy_cur[i] = dev->data[j + 1]; + dev->xy_cur[i + 1] = dev->data[j + 2]; + } + /* read Y values */ + for (i = 0, j = 1; i < 9; i += 2, j += 3) { + dev->xy_cur[ATP_XSENSORS + i] = dev->data[j + 1]; + dev->xy_cur[ATP_XSENSORS + i + 1] = dev->data[j + 2]; + } + } else if (atp_is_geyser_2(dev)) { memset(dev->xy_cur, 0, sizeof(dev->xy_cur)); /* @@ -267,6 +312,9 @@ static void atp_complete(struct urb* urb, struct pt_regs* regs) dev->x_old = dev->y_old = -1; memcpy(dev->xy_old, dev->xy_cur, sizeof(dev->xy_old)); + if (atp_is_geyser_3(dev)) /* No 17" Macbooks (yet) */ + goto exit; + /* 17" Powerbooks have extra X sensors */ for (i = (atp_is_geyser_2(dev)?15:16); i < ATP_XSENSORS; i++) { if (!dev->xy_cur[i]) continue; @@ -414,7 +462,50 @@ static int atp_probe(struct usb_interface *iface, const struct usb_device_id *id dev->udev = udev; dev->input = input_dev; dev->overflowwarn = 0; - dev->datalen = (atp_is_geyser_2(dev)?64:81); + if (atp_is_geyser_3(dev)) + dev->datalen = 64; + else if (atp_is_geyser_2(dev)) + dev->datalen = 64; + else + dev->datalen = 81; + + if (atp_is_geyser_3(dev)) { + /* + * By default Geyser 3 device sends standard USB HID mouse + * packets (Report ID 2). This code changes device mode, so it + * sends raw sensor reports (Report ID 5). + */ + char data[8]; + int size; + + size = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), + ATP_GEYSER3_MODE_READ_REQUEST_ID, + USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE, + ATP_GEYSER3_MODE_REQUEST_VALUE, + ATP_GEYSER3_MODE_REQUEST_INDEX, &data, 8, 5000); + + if (size != 8) { + err("Could not do mode read request from device" + " (Geyser 3 mode)"); + goto err_free_devs; + } + + /* Apply the mode switch */ + data[0] = ATP_GEYSER3_MODE_VENDOR_VALUE; + + size = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), + ATP_GEYSER3_MODE_WRITE_REQUEST_ID, + USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE, + ATP_GEYSER3_MODE_REQUEST_VALUE, + ATP_GEYSER3_MODE_REQUEST_INDEX, &data, 8, 5000); + + if (size != 8) { + err("Could not do mode write request to device" + " (Geyser 3 mode)"); + goto err_free_devs; + } + printk("appletouch Geyser 3 inited.\n"); + } dev->urb = usb_alloc_urb(0, GFP_KERNEL); if (!dev->urb) { @@ -447,7 +538,15 @@ static int atp_probe(struct usb_interface *iface, const struct usb_device_id *id set_bit(EV_ABS, input_dev->evbit); - if (atp_is_geyser_2(dev)) { + if (atp_is_geyser_3(dev)) { + /* + * MacBook have 20 X sensors, 10 Y sensors + */ + input_set_abs_params(input_dev, ABS_X, 0, + ((20 - 1) * ATP_XFACT) - 1, ATP_FUZZ, 0); + input_set_abs_params(input_dev, ABS_Y, 0, + ((10 - 1) * ATP_YFACT) - 1, ATP_FUZZ, 0); + } else if (atp_is_geyser_2(dev)) { /* * Oct 2005 15" PowerBooks have 15 X sensors, 17" are detected * later. diff --git a/drivers/usb/input/ati_remote.c b/drivers/usb/input/ati_remote.c index 99f986c..07c8c0e 100644 --- a/drivers/usb/input/ati_remote.c +++ b/drivers/usb/input/ati_remote.c @@ -92,9 +92,7 @@ #include <linux/slab.h> #include <linux/module.h> #include <linux/moduleparam.h> -#include <linux/input.h> -#include <linux/usb.h> -#include <linux/usb_input.h> +#include <linux/usb/input.h> #include <linux/wait.h> #include <linux/jiffies.h> diff --git a/drivers/usb/input/ati_remote2.c b/drivers/usb/input/ati_remote2.c index ab1a1ae..ea71de8 100644 --- a/drivers/usb/input/ati_remote2.c +++ b/drivers/usb/input/ati_remote2.c @@ -8,7 +8,7 @@ * as published by the Free Software Foundation. */ -#include <linux/usb_input.h> +#include <linux/usb/input.h> #define DRIVER_DESC "ATI/Philips USB RF remote driver" #define DRIVER_VERSION "0.1" diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c index 435273e..b9fb968 100644 --- a/drivers/usb/input/hid-core.c +++ b/drivers/usb/input/hid-core.c @@ -944,21 +944,28 @@ static void hid_reset(void *_hid) dev_dbg(&hid->intf->dev, "resetting device\n"); rc = rc_lock = usb_lock_device_for_reset(hid->dev, hid->intf); if (rc_lock >= 0) { - rc = usb_reset_device(hid->dev); + rc = usb_reset_composite_device(hid->dev, hid->intf); if (rc_lock) usb_unlock_device(hid->dev); } clear_bit(HID_RESET_PENDING, &hid->iofl); - if (rc == 0) { - hid->retry_delay = 0; - if (hid_start_in(hid)) + switch (rc) { + case 0: + if (!test_bit(HID_IN_RUNNING, &hid->iofl)) hid_io_error(hid); - } else if (!(rc == -ENODEV || rc == -EHOSTUNREACH || rc == -EINTR)) + break; + default: err("can't reset device, %s-%s/input%d, status %d", hid->dev->bus->bus_name, hid->dev->devpath, hid->ifnum, rc); + /* FALLTHROUGH */ + case -EHOSTUNREACH: + case -ENODEV: + case -EINTR: + break; + } } /* Main I/O error handler */ @@ -1374,9 +1381,6 @@ void hid_close(struct hid_device *hid) #define USB_VENDOR_ID_PANJIT 0x134c -#define USB_VENDOR_ID_SILVERCREST 0x062a -#define USB_DEVICE_ID_SILVERCREST_KB 0x0201 - /* * Initialize all reports */ @@ -1461,9 +1465,6 @@ void hid_init_reports(struct hid_device *hid) #define USB_VENDOR_ID_ONTRAK 0x0a07 #define USB_DEVICE_ID_ONTRAK_ADU100 0x0064 -#define USB_VENDOR_ID_TANGTOP 0x0d3d -#define USB_DEVICE_ID_TANGTOP_USBPS2 0x0001 - #define USB_VENDOR_ID_ESSENTIAL_REALITY 0x0d7f #define USB_DEVICE_ID_ESSENTIAL_REALITY_P5 0x0100 @@ -1520,12 +1521,6 @@ void hid_init_reports(struct hid_device *hid) #define USB_DEVICE_ID_MCC_PMD1024LS 0x0076 #define USB_DEVICE_ID_MCC_PMD1208LS 0x007a -#define USB_VENDOR_ID_CHICONY 0x04f2 -#define USB_DEVICE_ID_CHICONY_USBHUB_KB 0x0100 - -#define USB_VENDOR_ID_BTC 0x046e -#define USB_DEVICE_ID_BTC_KEYBOARD 0x5303 - #define USB_VENDOR_ID_VERNIER 0x08f7 #define USB_DEVICE_ID_VERNIER_LABPRO 0x0001 #define USB_DEVICE_ID_VERNIER_GOTEMP 0x0002 @@ -1549,20 +1544,13 @@ void hid_init_reports(struct hid_device *hid) #define USB_DEVICE_ID_LD_MACHINETEST 0x2040 #define USB_VENDOR_ID_APPLE 0x05ac -#define USB_DEVICE_ID_APPLE_POWERMOUSE 0x0304 +#define USB_DEVICE_ID_APPLE_MIGHTYMOUSE 0x0304 #define USB_VENDOR_ID_CHERRY 0x046a #define USB_DEVICE_ID_CHERRY_CYMOTION 0x0023 -#define USB_VENDOR_ID_HP 0x03f0 -#define USB_DEVICE_ID_HP_USBHUB_KB 0x020c - -#define USB_VENDOR_ID_IBM 0x04b3 -#define USB_DEVICE_ID_IBM_USBHUB_KB 0x3005 - -#define USB_VENDOR_ID_CREATIVELABS 0x062a -#define USB_DEVICE_ID_CREATIVELABS_SILVERCREST 0x0201 - +#define USB_VENDOR_ID_YEALINK 0x6993 +#define USB_DEVICE_ID_YEALINK_P1K_P4K_B2K 0xb001 /* * Alphabetically sorted blacklist by quirk type. */ @@ -1671,6 +1659,7 @@ static const struct hid_blacklist { { USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_DTF + 3, HID_QUIRK_IGNORE }, { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_4_PHIDGETSERVO_20, HID_QUIRK_IGNORE }, { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_1_PHIDGETSERVO_20, HID_QUIRK_IGNORE }, + { USB_VENDOR_ID_YEALINK, USB_DEVICE_ID_YEALINK_P1K_P4K_B2K, HID_QUIRK_IGNORE }, { USB_VENDOR_ID_ACECAD, USB_DEVICE_ID_ACECAD_FLAIR, HID_QUIRK_IGNORE }, { USB_VENDOR_ID_ACECAD, USB_DEVICE_ID_ACECAD_302, HID_QUIRK_IGNORE }, @@ -1680,16 +1669,9 @@ static const struct hid_blacklist { { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_2PORTKVM, HID_QUIRK_NOGET }, { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVM, HID_QUIRK_NOGET }, { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVMC, HID_QUIRK_NOGET }, - { USB_VENDOR_ID_BTC, USB_DEVICE_ID_BTC_KEYBOARD, HID_QUIRK_NOGET}, - { USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_USBHUB_KB, HID_QUIRK_NOGET}, - { USB_VENDOR_ID_CREATIVELABS, USB_DEVICE_ID_CREATIVELABS_SILVERCREST, HID_QUIRK_NOGET }, - { USB_VENDOR_ID_HP, USB_DEVICE_ID_HP_USBHUB_KB, HID_QUIRK_NOGET }, - { USB_VENDOR_ID_IBM, USB_DEVICE_ID_IBM_USBHUB_KB, HID_QUIRK_NOGET }, - { USB_VENDOR_ID_TANGTOP, USB_DEVICE_ID_TANGTOP_USBPS2, HID_QUIRK_NOGET }, { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_DUAL_USB_JOYPAD, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT }, - { USB_VENDOR_ID_SILVERCREST, USB_DEVICE_ID_SILVERCREST_KB, HID_QUIRK_NOGET }, - { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_POWERMOUSE, HID_QUIRK_2WHEEL_POWERMOUSE }, + { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MIGHTYMOUSE, HID_QUIRK_MIGHTYMOUSE | HID_QUIRK_INVERT_HWHEEL }, { USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU, HID_QUIRK_2WHEEL_MOUSE_HACK_7 }, { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_MOUSE, HID_QUIRK_2WHEEL_MOUSE_HACK_5 }, @@ -1711,6 +1693,9 @@ static const struct hid_blacklist { { USB_VENDOR_ID_APPLE, 0x0214, HID_QUIRK_POWERBOOK_HAS_FN }, { USB_VENDOR_ID_APPLE, 0x0215, HID_QUIRK_POWERBOOK_HAS_FN }, { USB_VENDOR_ID_APPLE, 0x0216, HID_QUIRK_POWERBOOK_HAS_FN }, + { USB_VENDOR_ID_APPLE, 0x0217, HID_QUIRK_POWERBOOK_HAS_FN }, + { USB_VENDOR_ID_APPLE, 0x0218, HID_QUIRK_POWERBOOK_HAS_FN }, + { USB_VENDOR_ID_APPLE, 0x0219, HID_QUIRK_POWERBOOK_HAS_FN }, { USB_VENDOR_ID_APPLE, 0x030A, HID_QUIRK_POWERBOOK_HAS_FN }, { USB_VENDOR_ID_APPLE, 0x030B, HID_QUIRK_POWERBOOK_HAS_FN }, @@ -1794,6 +1779,14 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf) (hid_blacklist[n].idProduct == le16_to_cpu(dev->descriptor.idProduct))) quirks = hid_blacklist[n].quirks; + /* Many keyboards and mice don't like to be polled for reports, + * so we will always set the HID_QUIRK_NOGET flag for them. */ + if (interface->desc.bInterfaceSubClass == USB_INTERFACE_SUBCLASS_BOOT) { + if (interface->desc.bInterfaceProtocol == USB_INTERFACE_PROTOCOL_KEYBOARD || + interface->desc.bInterfaceProtocol == USB_INTERFACE_PROTOCOL_MOUSE) + quirks |= HID_QUIRK_NOGET; + } + if (quirks & HID_QUIRK_IGNORE) return NULL; @@ -2080,11 +2073,29 @@ static int hid_resume(struct usb_interface *intf) int status; clear_bit(HID_SUSPENDED, &hid->iofl); + hid->retry_delay = 0; status = hid_start_in(hid); dev_dbg(&intf->dev, "resume status %d\n", status); return status; } +/* Treat USB reset pretty much the same as suspend/resume */ +static void hid_pre_reset(struct usb_interface *intf) +{ + /* FIXME: What if the interface is already suspended? */ + hid_suspend(intf, PMSG_ON); +} + +static void hid_post_reset(struct usb_interface *intf) +{ + struct usb_device *dev = interface_to_usbdev (intf); + + hid_set_idle(dev, intf->cur_altsetting->desc.bInterfaceNumber, 0, 0); + /* FIXME: Any more reinitialization needed? */ + + hid_resume(intf); +} + static struct usb_device_id hid_usb_ids [] = { { .match_flags = USB_DEVICE_ID_MATCH_INT_CLASS, .bInterfaceClass = USB_INTERFACE_CLASS_HID }, @@ -2099,6 +2110,8 @@ static struct usb_driver hid_driver = { .disconnect = hid_disconnect, .suspend = hid_suspend, .resume = hid_resume, + .pre_reset = hid_pre_reset, + .post_reset = hid_post_reset, .id_table = hid_usb_ids, }; diff --git a/drivers/usb/input/hid-input.c b/drivers/usb/input/hid-input.c index 25bc85f..028e1ad 100644 --- a/drivers/usb/input/hid-input.c +++ b/drivers/usb/input/hid-input.c @@ -29,9 +29,7 @@ #include <linux/module.h> #include <linux/slab.h> #include <linux/kernel.h> -#include <linux/input.h> -#include <linux/usb.h> -#include <linux/usb_input.h> +#include <linux/usb/input.h> #undef DEBUG @@ -567,16 +565,14 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel break; } - set_bit(usage->type, input->evbit); - - while (usage->code <= max && test_and_set_bit(usage->code, bit)) - usage->code = find_next_zero_bit(bit, max + 1, usage->code); - - if (usage->code > max) - goto ignore; - - if (((device->quirks & (HID_QUIRK_2WHEEL_POWERMOUSE)) && (usage->hid == 0x00010032))) - map_rel(REL_HWHEEL); + if (device->quirks & HID_QUIRK_MIGHTYMOUSE) { + if (usage->hid == HID_GD_Z) + map_rel(REL_HWHEEL); + else if (usage->code == BTN_1) + map_key(BTN_2); + else if (usage->code == BTN_2) + map_key(BTN_1); + } if ((device->quirks & (HID_QUIRK_2WHEEL_MOUSE_HACK_7 | HID_QUIRK_2WHEEL_MOUSE_HACK_5)) && (usage->type == EV_REL) && (usage->code == REL_WHEEL)) @@ -586,6 +582,15 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel || ((device->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_7) && (usage->hid == 0x00090007))) goto ignore; + set_bit(usage->type, input->evbit); + + while (usage->code <= max && test_and_set_bit(usage->code, bit)) + usage->code = find_next_zero_bit(bit, max + 1, usage->code); + + if (usage->code > max) + goto ignore; + + if (usage->type == EV_ABS) { int a = field->logical_minimum; @@ -647,6 +652,11 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct return; } + if ((hid->quirks & HID_QUIRK_INVERT_HWHEEL) && (usage->code == REL_HWHEEL)) { + input_event(input, usage->type, usage->code, -value); + return; + } + if ((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_ON) && (usage->code == REL_WHEEL)) { input_event(input, usage->type, REL_HWHEEL, value); return; diff --git a/drivers/usb/input/hid.h b/drivers/usb/input/hid.h index 9c62837..778e575 100644 --- a/drivers/usb/input/hid.h +++ b/drivers/usb/input/hid.h @@ -41,6 +41,14 @@ #define USB_INTERFACE_CLASS_HID 3 /* + * USB HID interface subclass and protocol codes + */ + +#define USB_INTERFACE_SUBCLASS_BOOT 1 +#define USB_INTERFACE_PROTOCOL_KEYBOARD 1 +#define USB_INTERFACE_PROTOCOL_MOUSE 2 + +/* * HID class requests */ @@ -247,10 +255,11 @@ struct hid_item { #define HID_QUIRK_2WHEEL_MOUSE_HACK_7 0x00000080 #define HID_QUIRK_2WHEEL_MOUSE_HACK_5 0x00000100 #define HID_QUIRK_2WHEEL_MOUSE_HACK_ON 0x00000200 -#define HID_QUIRK_2WHEEL_POWERMOUSE 0x00000400 +#define HID_QUIRK_MIGHTYMOUSE 0x00000400 #define HID_QUIRK_CYMOTION 0x00000800 #define HID_QUIRK_POWERBOOK_HAS_FN 0x00001000 #define HID_QUIRK_POWERBOOK_FN_ON 0x00002000 +#define HID_QUIRK_INVERT_HWHEEL 0x00004000 /* * This is the global environment of the parser. This information is diff --git a/drivers/usb/input/itmtouch.c b/drivers/usb/input/itmtouch.c index 7618ae5..5c570cc 100644 --- a/drivers/usb/input/itmtouch.c +++ b/drivers/usb/input/itmtouch.c @@ -42,11 +42,9 @@ #include <linux/config.h> #include <linux/kernel.h> #include <linux/slab.h> -#include <linux/input.h> #include <linux/module.h> #include <linux/init.h> -#include <linux/usb.h> -#include <linux/usb_input.h> +#include <linux/usb/input.h> /* only an 8 byte buffer necessary for a single packet */ #define ITM_BUFSIZE 8 diff --git a/drivers/usb/input/kbtab.c b/drivers/usb/input/kbtab.c index f6d5cea..604ade3 100644 --- a/drivers/usb/input/kbtab.c +++ b/drivers/usb/input/kbtab.c @@ -1,12 +1,9 @@ #include <linux/kernel.h> #include <linux/slab.h> -#include <linux/input.h> #include <linux/module.h> #include <linux/init.h> -#include <linux/usb.h> -#include <linux/usb_input.h> +#include <linux/usb/input.h> #include <asm/unaligned.h> -#include <asm/byteorder.h> /* * Version Information diff --git a/drivers/usb/input/keyspan_remote.c b/drivers/usb/input/keyspan_remote.c index 3d91197..70af985 100644 --- a/drivers/usb/input/keyspan_remote.c +++ b/drivers/usb/input/keyspan_remote.c @@ -18,9 +18,7 @@ #include <linux/slab.h> #include <linux/module.h> #include <linux/moduleparam.h> -#include <linux/input.h> -#include <linux/usb.h> -#include <linux/usb_input.h> +#include <linux/usb/input.h> #define DRIVER_VERSION "v0.1" #define DRIVER_AUTHOR "Michael Downey <downey@zymeta.com>" diff --git a/drivers/usb/input/mtouchusb.c b/drivers/usb/input/mtouchusb.c index f018953..4fdee4d 100644 --- a/drivers/usb/input/mtouchusb.c +++ b/drivers/usb/input/mtouchusb.c @@ -42,11 +42,9 @@ #include <linux/config.h> #include <linux/kernel.h> #include <linux/slab.h> -#include <linux/input.h> #include <linux/module.h> #include <linux/init.h> -#include <linux/usb.h> -#include <linux/usb_input.h> +#include <linux/usb/input.h> #define MTOUCHUSB_MIN_XC 0x0 #define MTOUCHUSB_MAX_RAW_XC 0x4000 diff --git a/drivers/usb/input/powermate.c b/drivers/usb/input/powermate.c index fdf0f78..b3c0d0c 100644 --- a/drivers/usb/input/powermate.c +++ b/drivers/usb/input/powermate.c @@ -30,12 +30,10 @@ #include <linux/kernel.h> #include <linux/slab.h> -#include <linux/input.h> #include <linux/module.h> #include <linux/init.h> #include <linux/spinlock.h> -#include <linux/usb.h> -#include <linux/usb_input.h> +#include <linux/usb/input.h> #define POWERMATE_VENDOR 0x077d /* Griffin Technology, Inc. */ #define POWERMATE_PRODUCT_NEW 0x0410 /* Griffin PowerMate */ diff --git a/drivers/usb/input/touchkitusb.c b/drivers/usb/input/touchkitusb.c index 697c5e5..da7b0bf 100644 --- a/drivers/usb/input/touchkitusb.c +++ b/drivers/usb/input/touchkitusb.c @@ -27,11 +27,9 @@ #include <linux/config.h> #include <linux/kernel.h> #include <linux/slab.h> -#include <linux/input.h> #include <linux/module.h> #include <linux/init.h> -#include <linux/usb.h> -#include <linux/usb_input.h> +#include <linux/usb/input.h> #define TOUCHKIT_MIN_XC 0x0 #define TOUCHKIT_MAX_XC 0x07ff diff --git a/drivers/usb/input/usbkbd.c b/drivers/usb/input/usbkbd.c index 2f3edc2..5067a6a 100644 --- a/drivers/usb/input/usbkbd.c +++ b/drivers/usb/input/usbkbd.c @@ -29,10 +29,8 @@ #include <linux/kernel.h> #include <linux/slab.h> #include <linux/module.h> -#include <linux/input.h> #include <linux/init.h> -#include <linux/usb.h> -#include <linux/usb_input.h> +#include <linux/usb/input.h> /* * Version Information diff --git a/drivers/usb/input/usbmouse.c b/drivers/usb/input/usbmouse.c index af52613..446935b 100644 --- a/drivers/usb/input/usbmouse.c +++ b/drivers/usb/input/usbmouse.c @@ -28,11 +28,9 @@ #include <linux/kernel.h> #include <linux/slab.h> -#include <linux/input.h> #include <linux/module.h> #include <linux/init.h> -#include <linux/usb.h> -#include <linux/usb_input.h> +#include <linux/usb/input.h> /* * Version Information diff --git a/drivers/usb/input/usbtouchscreen.c b/drivers/usb/input/usbtouchscreen.c index e9a07c1..3b175aa 100644 --- a/drivers/usb/input/usbtouchscreen.c +++ b/drivers/usb/input/usbtouchscreen.c @@ -39,7 +39,7 @@ #include <linux/module.h> #include <linux/init.h> #include <linux/usb.h> -#include <linux/usb_input.h> +#include <linux/usb/input.h> #define DRIVER_VERSION "v0.3" diff --git a/drivers/usb/input/wacom.c b/drivers/usb/input/wacom.c index cf84c60..369461a 100644 --- a/drivers/usb/input/wacom.c +++ b/drivers/usb/input/wacom.c @@ -69,13 +69,10 @@ #include <linux/kernel.h> #include <linux/slab.h> -#include <linux/input.h> #include <linux/module.h> #include <linux/init.h> -#include <linux/usb.h> -#include <linux/usb_input.h> +#include <linux/usb/input.h> #include <asm/unaligned.h> -#include <asm/byteorder.h> /* * Version Information diff --git a/drivers/usb/input/xpad.c b/drivers/usb/input/xpad.c index e278489..cfd4a4e 100644 --- a/drivers/usb/input/xpad.c +++ b/drivers/usb/input/xpad.c @@ -56,13 +56,11 @@ #include <linux/config.h> #include <linux/kernel.h> -#include <linux/input.h> #include <linux/init.h> #include <linux/slab.h> #include <linux/module.h> #include <linux/smp_lock.h> -#include <linux/usb.h> -#include <linux/usb_input.h> +#include <linux/usb/input.h> #define DRIVER_VERSION "v0.0.5" #define DRIVER_AUTHOR "Marko Friedemann <mfr@bmx-chemnitz.de>" diff --git a/drivers/usb/input/yealink.c b/drivers/usb/input/yealink.c index 37d2f0b..24aedbb 100644 --- a/drivers/usb/input/yealink.c +++ b/drivers/usb/input/yealink.c @@ -48,13 +48,11 @@ #include <linux/config.h> #include <linux/kernel.h> -#include <linux/input.h> #include <linux/init.h> #include <linux/slab.h> #include <linux/module.h> #include <linux/rwsem.h> -#include <linux/usb.h> -#include <linux/usb_input.h> +#include <linux/usb/input.h> #include "map_to_7segment.h" #include "yealink.h" |