]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
HID: Merge branch 'master' into for-3.10/hid-driver-transport-cleanups
authorJiri Kosina <jkosina@suse.cz>
Sat, 9 Mar 2013 09:58:13 +0000 (10:58 +0100)
committerJiri Kosina <jkosina@suse.cz>
Sat, 9 Mar 2013 10:01:06 +0000 (11:01 +0100)
Sync with Linus' tree. This is necessary to resolve build conflict
caused by dcd9006b1b053c7b ("HID: logitech-dj: do not directly call
hid_output_raw_report() during probe") which issues direct call to
usbhid_submit_report(), but that is gone in this branch and
hid_hw_request() has to be used instead.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
41 files changed:
drivers/hid/Kconfig
drivers/hid/hid-apple.c
drivers/hid/hid-axff.c
drivers/hid/hid-core.c
drivers/hid/hid-dr.c
drivers/hid/hid-emsff.c
drivers/hid/hid-gaff.c
drivers/hid/hid-holtekff.c
drivers/hid/hid-kye.c
drivers/hid/hid-lenovo-tpkbd.c
drivers/hid/hid-lg2ff.c
drivers/hid/hid-lg3ff.c
drivers/hid/hid-lg4ff.c
drivers/hid/hid-lgff.c
drivers/hid/hid-logitech-dj.c
drivers/hid/hid-magicmouse.c
drivers/hid/hid-multitouch.c
drivers/hid/hid-ntrig.c
drivers/hid/hid-picolcd.h
drivers/hid/hid-picolcd_backlight.c
drivers/hid/hid-picolcd_cir.c
drivers/hid/hid-picolcd_core.c
drivers/hid/hid-picolcd_debugfs.c
drivers/hid/hid-picolcd_fb.c
drivers/hid/hid-picolcd_lcd.c
drivers/hid/hid-picolcd_leds.c
drivers/hid/hid-pl.c
drivers/hid/hid-prodikeys.c
drivers/hid/hid-sensor-hub.c
drivers/hid/hid-sjoy.c
drivers/hid/hid-speedlink.c
drivers/hid/hid-steelseries.c
drivers/hid/hid-thingm.c
drivers/hid/hid-tmff.c
drivers/hid/hid-zpff.c
drivers/hid/i2c-hid/i2c-hid.c
drivers/hid/usbhid/hid-core.c
drivers/hid/usbhid/hid-pidff.c
drivers/hid/usbhid/hiddev.c
drivers/hid/usbhid/usbhid.h
include/linux/hid.h

index 5f07d85c4189fc4e0aa41ad5c3bf63e7d77b2ae8..d1dcfc78bed2273a7f64e0d87c61a469639d6fc1 100644 (file)
@@ -92,14 +92,14 @@ menu "Special HID drivers"
 
 config HID_A4TECH
        tristate "A4 tech mice" if EXPERT
-       depends on USB_HID
+       depends on HID
        default !EXPERT
        ---help---
        Support for A4 tech X5 and WOP-35 / Trust 450L mice.
 
 config HID_ACRUX
        tristate "ACRUX game controller support"
-       depends on USB_HID
+       depends on HID
        ---help---
        Say Y here if you want to enable support for ACRUX game controllers.
 
@@ -113,7 +113,7 @@ config HID_ACRUX_FF
 
 config HID_APPLE
        tristate "Apple {i,Power,Mac}Books" if EXPERT
-       depends on (USB_HID || BT_HIDP)
+       depends on HID
        default !EXPERT
        ---help---
        Support for some Apple devices which less or more break
@@ -124,34 +124,34 @@ config HID_APPLE
 
 config HID_AUREAL
        tristate "Aureal"
-       depends on USB_HID
+       depends on HID
        ---help---
        Support for Aureal Cy se W-01RN Remote Controller and other Aureal derived remotes.
 
 config HID_BELKIN
        tristate "Belkin Flip KVM and Wireless keyboard" if EXPERT
-       depends on USB_HID
+       depends on HID
        default !EXPERT
        ---help---
        Support for Belkin Flip KVM and Wireless keyboard.
 
 config HID_CHERRY
        tristate "Cherry Cymotion keyboard" if EXPERT
-       depends on USB_HID
+       depends on HID
        default !EXPERT
        ---help---
        Support for Cherry Cymotion keyboard.
 
 config HID_CHICONY
        tristate "Chicony Tactical pad" if EXPERT
-       depends on USB_HID
+       depends on HID
        default !EXPERT
        ---help---
        Support for Chicony Tactical pad.
 
 config HID_PRODIKEYS
        tristate "Prodikeys PC-MIDI Keyboard support"
-       depends on USB_HID && SND
+       depends on HID && SND
        select SND_RAWMIDI
        ---help---
        Support for Prodikeys PC-MIDI Keyboard device support.
@@ -166,14 +166,14 @@ config HID_PRODIKEYS
 
 config HID_CYPRESS
        tristate "Cypress mouse and barcode readers" if EXPERT
-       depends on USB_HID
+       depends on HID
        default !EXPERT
        ---help---
        Support for cypress mouse and barcode readers.
 
 config HID_DRAGONRISE
        tristate "DragonRise Inc. game controller"
-       depends on USB_HID
+       depends on HID
        ---help---
        Say Y here if you have DragonRise Inc. game controllers.
        These might be branded as:
@@ -192,7 +192,7 @@ config DRAGONRISE_FF
 
 config HID_EMS_FF
        tristate "EMS Production Inc. force feedback support"
-       depends on USB_HID
+       depends on HID
        select INPUT_FF_MEMLESS
        ---help---
        Say Y here if you want to enable force feedback support for devices by
@@ -202,13 +202,13 @@ config HID_EMS_FF
 
 config HID_ELECOM
        tristate "ELECOM BM084 bluetooth mouse"
-       depends on BT_HIDP
+       depends on HID
        ---help---
        Support for the ELECOM BM084 (bluetooth mouse).
 
 config HID_EZKEY
        tristate "Ezkey BTC 8193 keyboard" if EXPERT
-       depends on USB_HID
+       depends on HID
        default !EXPERT
        ---help---
        Support for Ezkey BTC 8193 keyboard.
@@ -231,7 +231,7 @@ config HOLTEK_FF
 
 config HID_KEYTOUCH
        tristate "Keytouch HID devices"
-       depends on USB_HID
+       depends on HID
        ---help---
        Support for Keytouch HID devices not fully compliant with
        the specification. Currently supported:
@@ -239,7 +239,7 @@ config HID_KEYTOUCH
 
 config HID_KYE
        tristate "KYE/Genius devices"
-       depends on USB_HID
+       depends on HID
        ---help---
        Support for KYE/Genius devices not fully compliant with HID standard:
        - Ergo Mouse
@@ -249,25 +249,25 @@ config HID_KYE
 
 config HID_UCLOGIC
        tristate "UC-Logic"
-       depends on USB_HID
+       depends on HID
        ---help---
        Support for UC-Logic tablets.
 
 config HID_WALTOP
        tristate "Waltop"
-       depends on USB_HID
+       depends on HID
        ---help---
        Support for Waltop tablets.
 
 config HID_GYRATION
        tristate "Gyration remote control"
-       depends on USB_HID
+       depends on HID
        ---help---
        Support for Gyration remote control.
 
 config HID_ICADE
        tristate "ION iCade arcade controller"
-       depends on BT_HIDP
+       depends on HID
        ---help---
        Support for the ION iCade arcade controller to work as a joystick.
 
@@ -276,20 +276,20 @@ config HID_ICADE
 
 config HID_TWINHAN
        tristate "Twinhan IR remote control"
-       depends on USB_HID
+       depends on HID
        ---help---
        Support for Twinhan IR remote control.
 
 config HID_KENSINGTON
        tristate "Kensington Slimblade Trackball" if EXPERT
-       depends on USB_HID
+       depends on HID
        default !EXPERT
        ---help---
        Support for Kensington Slimblade Trackball.
 
 config HID_LCPOWER
        tristate "LC-Power"
-       depends on USB_HID
+       depends on HID
        ---help---
        Support for LC-Power RC1000MCE RF remote control.
 
@@ -308,7 +308,7 @@ config HID_LENOVO_TPKBD
 
 config HID_LOGITECH
        tristate "Logitech devices" if EXPERT
-       depends on USB_HID
+       depends on HID
        default !EXPERT
        ---help---
        Support for Logitech devices that are not fully compliant with HID standard.
@@ -374,7 +374,7 @@ config LOGIWHEELS_FF
 
 config HID_MAGICMOUSE
        tristate "Apple MagicMouse multi-touch support"
-       depends on BT_HIDP
+       depends on HID
        ---help---
        Support for the Apple Magic Mouse multi-touch.
 
@@ -383,21 +383,21 @@ config HID_MAGICMOUSE
 
 config HID_MICROSOFT
        tristate "Microsoft non-fully HID-compliant devices" if EXPERT
-       depends on USB_HID
+       depends on HID
        default !EXPERT
        ---help---
        Support for Microsoft devices that are not fully compliant with HID standard.
 
 config HID_MONTEREY
        tristate "Monterey Genius KB29E keyboard" if EXPERT
-       depends on USB_HID
+       depends on HID
        default !EXPERT
        ---help---
        Support for Monterey Genius KB29E.
 
 config HID_MULTITOUCH
        tristate "HID Multitouch panels"
-       depends on USB_HID
+       depends on HID
        ---help---
          Generic support for HID multitouch panels.
 
@@ -445,7 +445,7 @@ config HID_NTRIG
 
 config HID_ORTEK
        tristate "Ortek PKB-1700/WKB-2000/Skycable wireless keyboard and mouse trackpad"
-       depends on USB_HID
+       depends on HID
        ---help---
        There are certain devices which have LogicalMaximum wrong in the keyboard
        usage page of their report descriptor. The most prevailing ones so far
@@ -458,7 +458,7 @@ config HID_ORTEK
 
 config HID_PANTHERLORD
        tristate "Pantherlord/GreenAsia game controller"
-       depends on USB_HID
+       depends on HID
        ---help---
          Say Y here if you have a PantherLord/GreenAsia based game controller
          or adapter.
@@ -473,13 +473,13 @@ config PANTHERLORD_FF
 
 config HID_PETALYNX
        tristate "Petalynx Maxter remote control"
-       depends on USB_HID
+       depends on HID
        ---help---
        Support for Petalynx Maxter remote control.
 
 config HID_PICOLCD
        tristate "PicoLCD (graphic version)"
-       depends on USB_HID
+       depends on HID
        ---help---
          This provides support for Minibox PicoLCD devices, currently
          only the graphical ones are supported.
@@ -545,14 +545,14 @@ config HID_PICOLCD_CIR
 
 config HID_PRIMAX
        tristate "Primax non-fully HID-compliant devices"
-       depends on USB_HID
+       depends on HID
        ---help---
        Support for Primax devices that are not fully compliant with the
        HID standard.
 
 config HID_PS3REMOTE
        tristate "Sony PS3 BD Remote Control"
-       depends on BT_HIDP
+       depends on HID
        ---help---
        Support for the Sony PS3 Blue-ray Disk Remote Control and Logitech
        Harmony Adapter for PS3, which connect over Bluetooth.
@@ -569,7 +569,7 @@ config HID_ROCCAT
 
 config HID_SAITEK
        tristate "Saitek non-fully HID-compliant devices"
-       depends on USB_HID
+       depends on HID
        ---help---
        Support for Saitek devices that are not fully compliant with the
        HID standard.
@@ -578,7 +578,7 @@ config HID_SAITEK
 
 config HID_SAMSUNG
        tristate "Samsung InfraRed remote control or keyboards"
-       depends on USB_HID
+       depends on HID
        ---help---
        Support for Samsung InfraRed remote control or keyboards.
 
@@ -592,25 +592,25 @@ config HID_SONY
 
 config HID_SPEEDLINK
        tristate "Speedlink VAD Cezanne mouse support"
-       depends on USB_HID
+       depends on HID
        ---help---
        Support for Speedlink Vicious and Divine Cezanne mouse.
 
 config HID_STEELSERIES
        tristate "Steelseries SRW-S1 steering wheel support"
-       depends on USB_HID
+       depends on HID
        ---help---
        Support for Steelseries SRW-S1 steering wheel
 
 config HID_SUNPLUS
        tristate "Sunplus wireless desktop"
-       depends on USB_HID
+       depends on HID
        ---help---
        Support for Sunplus wireless desktop.
 
 config HID_GREENASIA
        tristate "GreenAsia (Product ID 0x12) game controller support"
-       depends on USB_HID
+       depends on HID
        ---help---
          Say Y here if you have a GreenAsia (Product ID 0x12) based game
          controller or adapter.
@@ -632,7 +632,7 @@ config HID_HYPERV_MOUSE
 
 config HID_SMARTJOYPLUS
        tristate "SmartJoy PLUS PS2/USB adapter support"
-       depends on USB_HID
+       depends on HID
        ---help---
        Support for SmartJoy PLUS PS2/USB adapter, Super Dual Box,
        Super Joy Box 3 Pro, Super Dual Box Pro, and Super Joy Box 5 Pro.
@@ -650,20 +650,20 @@ config SMARTJOYPLUS_FF
 
 config HID_TIVO
        tristate "TiVo Slide Bluetooth remote control support"
-       depends on (USB_HID || BT_HIDP)
+       depends on HID
        ---help---
        Say Y if you have a TiVo Slide Bluetooth remote control.
 
 config HID_TOPSEED
        tristate "TopSeed Cyberlink, BTC Emprex, Conceptronic remote control support"
-       depends on USB_HID
+       depends on HID
        ---help---
        Say Y if you have a TopSeed Cyberlink or BTC Emprex or Conceptronic
        CLLRCMCE remote control.
 
 config HID_THINGM
        tristate "ThingM blink(1) USB RGB LED"
-       depends on USB_HID
+       depends on HID
        depends on LEDS_CLASS
        ---help---
        Support for the ThingM blink(1) USB RGB LED. This driver registers a
@@ -673,7 +673,7 @@ config HID_THINGM
 
 config HID_THRUSTMASTER
        tristate "ThrustMaster devices support"
-       depends on USB_HID
+       depends on HID
        ---help---
          Say Y here if you have a THRUSTMASTER FireStore Dual Power 2 or
          a THRUSTMASTER Ferrari GT Rumble Wheel.
@@ -689,7 +689,7 @@ config THRUSTMASTER_FF
 
 config HID_WACOM
        tristate "Wacom Bluetooth devices support"
-       depends on BT_HIDP
+       depends on HID
        depends on LEDS_CLASS
        select POWER_SUPPLY
        ---help---
@@ -697,7 +697,7 @@ config HID_WACOM
 
 config HID_WIIMOTE
        tristate "Nintendo Wii Remote support"
-       depends on BT_HIDP
+       depends on HID
        depends on LEDS_CLASS
        select POWER_SUPPLY
        select INPUT_FF_MEMLESS
@@ -715,7 +715,7 @@ config HID_WIIMOTE_EXT
 
 config HID_ZEROPLUS
        tristate "Zeroplus based game controller support"
-       depends on USB_HID
+       depends on HID
        ---help---
          Say Y here if you have a Zeroplus based game controller.
 
@@ -729,13 +729,13 @@ config ZEROPLUS_FF
 
 config HID_ZYDACRON
        tristate "Zydacron remote control support"
-       depends on USB_HID
+       depends on HID
        ---help---
        Support for Zydacron remote control.
 
 config HID_SENSOR_HUB
        tristate "HID Sensors framework support"
-       depends on USB_HID && GENERIC_HARDIRQS
+       depends on HID && GENERIC_HARDIRQS
        select MFD_CORE
        default n
        -- help---
index 320a958d4139ce57fc386087a93bffa23054d13f..9e0c4fbbb840a6b788da7dffecd31db844fde939 100644 (file)
@@ -21,7 +21,6 @@
 #include <linux/hid.h>
 #include <linux/module.h>
 #include <linux/slab.h>
-#include <linux/usb.h>
 
 #include "hid-ids.h"
 
index 62f0cee032bada140bdcfcd84418c366c54c6015..64ab94a55aa796515958206986a991003a750069 100644 (file)
 
 #include <linux/input.h>
 #include <linux/slab.h>
-#include <linux/usb.h>
 #include <linux/hid.h>
 #include <linux/module.h>
 
 #include "hid-ids.h"
 
 #ifdef CONFIG_HID_ACRUX_FF
-#include "usbhid/usbhid.h"
 
 struct axff_device {
        struct hid_report *report;
@@ -68,7 +66,7 @@ static int axff_play(struct input_dev *dev, void *data, struct ff_effect *effect
        }
 
        dbg_hid("running with 0x%02x 0x%02x", left, right);
-       usbhid_submit_report(hid, axff->report, USB_DIR_OUT);
+       hid_hw_request(hid, axff->report, HID_REQ_SET_REPORT);
 
        return 0;
 }
@@ -114,7 +112,7 @@ static int axff_init(struct hid_device *hid)
                goto err_free_mem;
 
        axff->report = report;
-       usbhid_submit_report(hid, axff->report, USB_DIR_OUT);
+       hid_hw_request(hid, axff->report, HID_REQ_SET_REPORT);
 
        hid_info(hid, "Force Feedback for ACRUX game controllers by Sergei Kolzun <x0r@dv-life.ru>\n");
 
index 512b01c04ea7610bcb6466208255a9d83a36cb1d..b76eb9eb6ff177e3216051674ee3fbe8cf863fce 100644 (file)
@@ -728,8 +728,7 @@ static int hid_scan_report(struct hid_device *hid)
                } else if (page == HID_UP_SENSOR &&
                        item.type == HID_ITEM_TYPE_MAIN &&
                        item.tag == HID_MAIN_ITEM_TAG_BEGIN_COLLECTION &&
-                       (item_udata(&item) & 0xff) == HID_COLLECTION_PHYSICAL &&
-                       (hid->bus == BUS_USB || hid->bus == BUS_I2C))
+                       (item_udata(&item) & 0xff) == HID_COLLECTION_PHYSICAL)
                        hid->group = HID_GROUP_SENSOR_HUB;
        }
 
index 0fe8f65ef01a64c7d68155946498a28acbeaf63e..ce0644424f587707e68023f066eefecc50048d6b 100644 (file)
 
 #include <linux/input.h>
 #include <linux/slab.h>
-#include <linux/usb.h>
 #include <linux/hid.h>
 #include <linux/module.h>
 
 #include "hid-ids.h"
 
 #ifdef CONFIG_DRAGONRISE_FF
-#include "usbhid/usbhid.h"
 
 struct drff_device {
        struct hid_report *report;
@@ -68,7 +66,7 @@ static int drff_play(struct input_dev *dev, void *data,
                drff->report->field[0]->value[1] = 0x00;
                drff->report->field[0]->value[2] = weak;
                drff->report->field[0]->value[4] = strong;
-               usbhid_submit_report(hid, drff->report, USB_DIR_OUT);
+               hid_hw_request(hid, drff->report, HID_REQ_SET_REPORT);
 
                drff->report->field[0]->value[0] = 0xfa;
                drff->report->field[0]->value[1] = 0xfe;
@@ -80,7 +78,7 @@ static int drff_play(struct input_dev *dev, void *data,
        drff->report->field[0]->value[2] = 0x00;
        drff->report->field[0]->value[4] = 0x00;
        dbg_hid("running with 0x%02x 0x%02x", strong, weak);
-       usbhid_submit_report(hid, drff->report, USB_DIR_OUT);
+       hid_hw_request(hid, drff->report, HID_REQ_SET_REPORT);
 
        return 0;
 }
@@ -132,7 +130,7 @@ static int drff_init(struct hid_device *hid)
        drff->report->field[0]->value[4] = 0x00;
        drff->report->field[0]->value[5] = 0x00;
        drff->report->field[0]->value[6] = 0x00;
-       usbhid_submit_report(hid, drff->report, USB_DIR_OUT);
+       hid_hw_request(hid, drff->report, HID_REQ_SET_REPORT);
 
        hid_info(hid, "Force Feedback for DragonRise Inc. "
                 "game controllers by Richard Walmsley <richwalm@gmail.com>\n");
index 2e093ab99b435885c1f4d0ba5c6511ffe64993b9..d82d75bb11f78b591483233bc294aaf3a5939a72 100644 (file)
 
 #include <linux/hid.h>
 #include <linux/input.h>
-#include <linux/usb.h>
 #include <linux/module.h>
 
 #include "hid-ids.h"
-#include "usbhid/usbhid.h"
 
 struct emsff_device {
        struct hid_report *report;
@@ -52,7 +50,7 @@ static int emsff_play(struct input_dev *dev, void *data,
        emsff->report->field[0]->value[2] = strong;
 
        dbg_hid("running with 0x%02x 0x%02x\n", strong, weak);
-       usbhid_submit_report(hid, emsff->report, USB_DIR_OUT);
+       hid_hw_request(hid, emsff->report, HID_REQ_SET_REPORT);
 
        return 0;
 }
@@ -104,7 +102,7 @@ static int emsff_init(struct hid_device *hid)
        emsff->report->field[0]->value[4] = 0x00;
        emsff->report->field[0]->value[5] = 0x00;
        emsff->report->field[0]->value[6] = 0x00;
-       usbhid_submit_report(hid, emsff->report, USB_DIR_OUT);
+       hid_hw_request(hid, emsff->report, HID_REQ_SET_REPORT);
 
        hid_info(hid, "force feedback for EMS based devices by Ignaz Forster <ignaz.forster@gmx.de>\n");
 
index 04d2e6aca77841983ba16bce0d1b312f2fb2e1bc..2d8cead3adcaadf68e30ea9a4f37c7fc21452d50 100644 (file)
 
 #include <linux/input.h>
 #include <linux/slab.h>
-#include <linux/usb.h>
 #include <linux/hid.h>
 #include <linux/module.h>
 #include "hid-ids.h"
 
 #ifdef CONFIG_GREENASIA_FF
-#include "usbhid/usbhid.h"
 
 struct gaff_device {
        struct hid_report *report;
@@ -63,14 +61,14 @@ static int hid_gaff_play(struct input_dev *dev, void *data,
        gaff->report->field[0]->value[4] = left;
        gaff->report->field[0]->value[5] = 0;
        dbg_hid("running with 0x%02x 0x%02x", left, right);
-       usbhid_submit_report(hid, gaff->report, USB_DIR_OUT);
+       hid_hw_request(hid, gaff->report, HID_REQ_SET_REPORT);
 
        gaff->report->field[0]->value[0] = 0xfa;
        gaff->report->field[0]->value[1] = 0xfe;
        gaff->report->field[0]->value[2] = 0x0;
        gaff->report->field[0]->value[4] = 0x0;
 
-       usbhid_submit_report(hid, gaff->report, USB_DIR_OUT);
+       hid_hw_request(hid, gaff->report, HID_REQ_SET_REPORT);
 
        return 0;
 }
@@ -122,12 +120,12 @@ static int gaff_init(struct hid_device *hid)
        gaff->report->field[0]->value[1] = 0x00;
        gaff->report->field[0]->value[2] = 0x00;
        gaff->report->field[0]->value[3] = 0x00;
-       usbhid_submit_report(hid, gaff->report, USB_DIR_OUT);
+       hid_hw_request(hid, gaff->report, HID_REQ_SET_REPORT);
 
        gaff->report->field[0]->value[0] = 0xfa;
        gaff->report->field[0]->value[1] = 0xfe;
 
-       usbhid_submit_report(hid, gaff->report, USB_DIR_OUT);
+       hid_hw_request(hid, gaff->report, HID_REQ_SET_REPORT);
 
        hid_info(hid, "Force Feedback for GreenAsia 0x12 devices by Lukasz Lubojanski <lukasz@lubojanski.info>\n");
 
index f34d1186a3e1b16b4604c5f057ab411cff1bcc2f..9a8f051245258973f53ad84f8debef8b2f6db7e9 100644 (file)
 #include <linux/input.h>
 #include <linux/module.h>
 #include <linux/slab.h>
-#include <linux/usb.h>
 
 #include "hid-ids.h"
 
 #ifdef CONFIG_HOLTEK_FF
-#include "usbhid/usbhid.h"
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Anssi Hannula <anssi.hannula@iki.fi>");
@@ -102,7 +100,7 @@ static void holtekff_send(struct holtekff_device *holtekff,
 
        dbg_hid("sending %*ph\n", 7, data);
 
-       usbhid_submit_report(hid, holtekff->field->report, USB_DIR_OUT);
+       hid_hw_request(hid, holtekff->field->report, HID_REQ_SET_REPORT);
 }
 
 static int holtekff_play(struct input_dev *dev, void *data,
index ef72daecfa16337aa66b2a712d6c64457d4db777..6af90dbdc3d45e1295db182588c6a8bbae2978ca 100644 (file)
@@ -16,8 +16,6 @@
 #include <linux/device.h>
 #include <linux/hid.h>
 #include <linux/module.h>
-#include <linux/usb.h>
-#include "usbhid/usbhid.h"
 
 #include "hid-ids.h"
 
@@ -361,7 +359,7 @@ static int kye_tablet_enable(struct hid_device *hdev)
        value[4] = 0x00;
        value[5] = 0x00;
        value[6] = 0x00;
-       usbhid_submit_report(hdev, report, USB_DIR_OUT);
+       hid_hw_request(hdev, report, HID_REQ_SET_REPORT);
 
        return 0;
 }
index 956c3b135f64fe61e4a4636e2e81e911ad3ee141..a0535fd7a7987409e830bb120fe8f70df4a6fbcf 100644 (file)
@@ -68,7 +68,7 @@ static int tpkbd_features_set(struct hid_device *hdev)
        report->field[2]->value[0] = data_pointer->sensitivity;
        report->field[3]->value[0] = data_pointer->press_speed;
 
-       usbhid_submit_report(hdev, report, USB_DIR_OUT);
+       hid_hw_request(hdev, report, HID_REQ_SET_REPORT);
        return 0;
 }
 
@@ -332,7 +332,7 @@ static void tpkbd_led_brightness_set(struct led_classdev *led_cdev,
        report = hdev->report_enum[HID_OUTPUT_REPORT].report_id_hash[3];
        report->field[0]->value[0] = (data_pointer->led_state >> 0) & 1;
        report->field[0]->value[1] = (data_pointer->led_state >> 1) & 1;
-       usbhid_submit_report(hdev, report, USB_DIR_OUT);
+       hid_hw_request(hdev, report, HID_REQ_SET_REPORT);
 }
 
 static int tpkbd_probe_tp(struct hid_device *hdev)
index 3c31bc650e5d6e8b957618fb9d9dd306f677c22f..b3cd1507dda2eab0eb09c0c48e006505eabac153 100644 (file)
 
 #include <linux/input.h>
 #include <linux/slab.h>
-#include <linux/usb.h>
 #include <linux/hid.h>
 
-#include "usbhid/usbhid.h"
 #include "hid-lg.h"
 
 struct lg2ff_device {
@@ -56,7 +54,7 @@ static int play_effect(struct input_dev *dev, void *data,
                lg2ff->report->field[0]->value[4] = 0x00;
        }
 
-       usbhid_submit_report(hid, lg2ff->report, USB_DIR_OUT);
+       hid_hw_request(hid, lg2ff->report, HID_REQ_SET_REPORT);
        return 0;
 }
 
@@ -108,7 +106,7 @@ int lg2ff_init(struct hid_device *hid)
        report->field[0]->value[5] = 0x00;
        report->field[0]->value[6] = 0x00;
 
-       usbhid_submit_report(hid, report, USB_DIR_OUT);
+       hid_hw_request(hid, report, HID_REQ_SET_REPORT);
 
        hid_info(hid, "Force feedback for Logitech RumblePad/Rumblepad 2 by Anssi Hannula <anssi.hannula@gmail.com>\n");
 
index f98644c26c1dfc2ccc181a23fee0d94b6c6e03ef..e52f181f6aa14dd4fd8229ce2ecb379ccf80533c 100644 (file)
 
 
 #include <linux/input.h>
-#include <linux/usb.h>
 #include <linux/hid.h>
 
-#include "usbhid/usbhid.h"
 #include "hid-lg.h"
 
 /*
@@ -92,7 +90,7 @@ static int hid_lg3ff_play(struct input_dev *dev, void *data,
                report->field[0]->value[1] = (unsigned char)(-x);
                report->field[0]->value[31] = (unsigned char)(-y);
 
-               usbhid_submit_report(hid, report, USB_DIR_OUT);
+               hid_hw_request(hid, report, HID_REQ_SET_REPORT);
                break;
        }
        return 0;
@@ -118,7 +116,7 @@ static void hid_lg3ff_set_autocenter(struct input_dev *dev, u16 magnitude)
        report->field[0]->value[33] = 0x7F;
        report->field[0]->value[34] = 0x7F;
 
-       usbhid_submit_report(hid, report, USB_DIR_OUT);
+       hid_hw_request(hid, report, HID_REQ_SET_REPORT);
 }
 
 
index 65a6ec8d37421343d597f2a42234a84532205ae0..7da40a1797cd83b6675ab1fe8998ebba7d30202e 100644 (file)
@@ -202,7 +202,7 @@ static int hid_lg4ff_play(struct input_dev *dev, void *data, struct ff_effect *e
                value[5] = 0x00;
                value[6] = 0x00;
 
-               usbhid_submit_report(hid, report, USB_DIR_OUT);
+               hid_hw_request(hid, report, HID_REQ_SET_REPORT);
                break;
        }
        return 0;
@@ -225,7 +225,7 @@ static void hid_lg4ff_set_autocenter_default(struct input_dev *dev, u16 magnitud
        value[5] = 0x00;
        value[6] = 0x00;
 
-       usbhid_submit_report(hid, report, USB_DIR_OUT);
+       hid_hw_request(hid, report, HID_REQ_SET_REPORT);
 }
 
 /* Sends autocentering command compatible with Formula Force EX */
@@ -245,7 +245,7 @@ static void hid_lg4ff_set_autocenter_ffex(struct input_dev *dev, u16 magnitude)
        value[5] = 0x00;
        value[6] = 0x00;
 
-       usbhid_submit_report(hid, report, USB_DIR_OUT);
+       hid_hw_request(hid, report, HID_REQ_SET_REPORT);
 }
 
 /* Sends command to set range compatible with G25/G27/Driving Force GT */
@@ -265,7 +265,7 @@ static void hid_lg4ff_set_range_g25(struct hid_device *hid, u16 range)
        value[5] = 0x00;
        value[6] = 0x00;
 
-       usbhid_submit_report(hid, report, USB_DIR_OUT);
+       hid_hw_request(hid, report, HID_REQ_SET_REPORT);
 }
 
 /* Sends commands to set range compatible with Driving Force Pro wheel */
@@ -294,7 +294,7 @@ static void hid_lg4ff_set_range_dfp(struct hid_device *hid, __u16 range)
                report->field[0]->value[1] = 0x02;
                full_range = 200;
        }
-       usbhid_submit_report(hid, report, USB_DIR_OUT);
+       hid_hw_request(hid, report, HID_REQ_SET_REPORT);
 
        /* Prepare "fine" limit command */
        value[0] = 0x81;
@@ -306,7 +306,7 @@ static void hid_lg4ff_set_range_dfp(struct hid_device *hid, __u16 range)
        value[6] = 0x00;
 
        if (range == 200 || range == 900) {     /* Do not apply any fine limit */
-               usbhid_submit_report(hid, report, USB_DIR_OUT);
+               hid_hw_request(hid, report, HID_REQ_SET_REPORT);
                return;
        }
 
@@ -320,7 +320,7 @@ static void hid_lg4ff_set_range_dfp(struct hid_device *hid, __u16 range)
        value[5] = (start_right & 0xe) << 4 | (start_left & 0xe);
        value[6] = 0xff;
 
-       usbhid_submit_report(hid, report, USB_DIR_OUT);
+       hid_hw_request(hid, report, HID_REQ_SET_REPORT);
 }
 
 static void hid_lg4ff_switch_native(struct hid_device *hid, const struct lg4ff_native_cmd *cmd)
@@ -334,7 +334,7 @@ static void hid_lg4ff_switch_native(struct hid_device *hid, const struct lg4ff_n
                for (i = 0; i < 7; i++)
                        report->field[0]->value[i] = cmd->cmd[j++];
 
-               usbhid_submit_report(hid, report, USB_DIR_OUT);
+               hid_hw_request(hid, report, HID_REQ_SET_REPORT);
        }
 }
 
@@ -410,7 +410,7 @@ static void lg4ff_set_leds(struct hid_device *hid, __u8 leds)
        value[4] = 0x00;
        value[5] = 0x00;
        value[6] = 0x00;
-       usbhid_submit_report(hid, report, USB_DIR_OUT);
+       hid_hw_request(hid, report, HID_REQ_SET_REPORT);
 }
 
 static void lg4ff_led_set_brightness(struct led_classdev *led_cdev,
index 27bc54f92f4484d7efc0ef687d70082c725b337f..d7ea8c845b4038ec2a943baa6f169ade22e82e3d 100644 (file)
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
 #include <linux/input.h>
-#include <linux/usb.h>
 #include <linux/hid.h>
 
-#include "usbhid/usbhid.h"
 #include "hid-lg.h"
 
 struct dev_type {
@@ -89,7 +87,7 @@ static int hid_lgff_play(struct input_dev *dev, void *data, struct ff_effect *ef
                report->field[0]->value[2] = x;
                report->field[0]->value[3] = y;
                dbg_hid("(x, y)=(%04x, %04x)\n", x, y);
-               usbhid_submit_report(hid, report, USB_DIR_OUT);
+               hid_hw_request(hid, report, HID_REQ_SET_REPORT);
                break;
 
        case FF_RUMBLE:
@@ -104,7 +102,7 @@ static int hid_lgff_play(struct input_dev *dev, void *data, struct ff_effect *ef
                report->field[0]->value[2] = left;
                report->field[0]->value[3] = right;
                dbg_hid("(left, right)=(%04x, %04x)\n", left, right);
-               usbhid_submit_report(hid, report, USB_DIR_OUT);
+               hid_hw_request(hid, report, HID_REQ_SET_REPORT);
                break;
        }
        return 0;
@@ -124,7 +122,7 @@ static void hid_lgff_set_autocenter(struct input_dev *dev, u16 magnitude)
        *value++ = 0x80;
        *value++ = 0x00;
        *value = 0x00;
-       usbhid_submit_report(hid, report, USB_DIR_OUT);
+       hid_hw_request(hid, report, HID_REQ_SET_REPORT);
 }
 
 int lgff_init(struct hid_device* hid)
index 8758f38c948c2022b45da342f15025228ea6b22d..d9043434ddb32f1e62129e4596a42d72043e6791 100644 (file)
@@ -27,7 +27,6 @@
 #include <linux/module.h>
 #include <linux/usb.h>
 #include <asm/unaligned.h>
-#include "usbhid/usbhid.h"
 #include "hid-ids.h"
 #include "hid-logitech-dj.h"
 
@@ -475,7 +474,7 @@ static int logi_dj_recv_send_report(struct dj_receiver_dev *djrcv_dev,
        for (i = 0; i < report->field[0]->report_count; i++)
                report->field[0]->value[i] = data[i];
 
-       usbhid_submit_report(hdev, report, USB_DIR_OUT);
+       hid_hw_request(hdev, report, HID_REQ_SET_REPORT);
 
        return 0;
 }
@@ -644,7 +643,7 @@ static int logi_dj_ll_input_event(struct input_dev *dev, unsigned int type,
        hid_set_field(report->field[0], 1, REPORT_TYPE_LEDS);
        hid_set_field(report->field[0], 2, data[1]);
 
-       usbhid_submit_report(dj_rcv_hiddev, report, USB_DIR_OUT);
+       hid_hw_request(dj_rcv_hiddev, report, HID_REQ_SET_REPORT);
 
        return 0;
 
index f7f113ba083eb43fb1073d189a4979f7d4d6d724..ef89573d65fcb5cdcbf1d103e0a46f2a95c00f61 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/input/mt.h>
 #include <linux/module.h>
 #include <linux/slab.h>
-#include <linux/usb.h>
 
 #include "hid-ids.h"
 
index 7a1ebb867cf499596e9c4fe5b1a43860b86d4351..f712772437cb631ee616ecca5594d12bc60b02f5 100644 (file)
@@ -2,8 +2,9 @@
  *  HID driver for multitouch panels
  *
  *  Copyright (c) 2010-2012 Stephane Chatty <chatty@enac.fr>
- *  Copyright (c) 2010-2012 Benjamin Tissoires <benjamin.tissoires@gmail.com>
+ *  Copyright (c) 2010-2013 Benjamin Tissoires <benjamin.tissoires@gmail.com>
  *  Copyright (c) 2010-2012 Ecole Nationale de l'Aviation Civile, France
+ *  Copyright (c) 2012-2013 Red Hat, Inc
  *
  *  This code is partly based on hid-egalax.c:
  *
  * any later version.
  */
 
+/*
+ * This driver is regularly tested thanks to the tool hid-test[1].
+ * This tool relies on hid-replay[2] and a database of hid devices[3].
+ * Please run these regression tests before patching this module so that
+ * your patch won't break existing known devices.
+ *
+ * [1] https://github.com/bentiss/hid-test
+ * [2] https://github.com/bentiss/hid-replay
+ * [3] https://github.com/bentiss/hid-devices
+ */
+
 #include <linux/device.h>
 #include <linux/hid.h>
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/usb.h>
 #include <linux/input/mt.h>
-#include "usbhid/usbhid.h"
 
 
 MODULE_AUTHOR("Stephane Chatty <chatty@enac.fr>");
@@ -736,7 +747,7 @@ static void mt_set_input_mode(struct hid_device *hdev)
        r = re->report_id_hash[td->inputmode];
        if (r) {
                r->field[0]->value[td->inputmode_index] = 0x02;
-               usbhid_submit_report(hdev, r, USB_DIR_OUT);
+               hid_hw_request(hdev, r, HID_REQ_SET_REPORT);
        }
 }
 
@@ -761,7 +772,7 @@ static void mt_set_maxcontacts(struct hid_device *hdev)
                max = min(fieldmax, max);
                if (r->field[0]->value[0] != max) {
                        r->field[0]->value[0] = max;
-                       usbhid_submit_report(hdev, r, USB_DIR_OUT);
+                       hid_hw_request(hdev, r, HID_REQ_SET_REPORT);
                }
        }
 }
@@ -898,26 +909,11 @@ static int mt_reset_resume(struct hid_device *hdev)
 
 static int mt_resume(struct hid_device *hdev)
 {
-       struct usb_interface *intf;
-       struct usb_host_interface *interface;
-       struct usb_device *dev;
-
-       if (hdev->bus != BUS_USB)
-               return 0;
-
-       intf = to_usb_interface(hdev->dev.parent);
-       interface = intf->cur_altsetting;
-       dev = hid_to_usb_dev(hdev);
-
        /* Some Elan legacy devices require SET_IDLE to be set on resume.
         * It should be safe to send it to other devices too.
         * Tested on 3M, Stantum, Cypress, Zytronic, eGalax, and Elan panels. */
 
-       usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
-                       HID_REQ_SET_IDLE,
-                       USB_TYPE_CLASS | USB_RECIP_INTERFACE,
-                       0, interface->desc.bInterfaceNumber,
-                       NULL, 0, USB_CTRL_SET_TIMEOUT);
+       hid_hw_idle(hdev, 0, 0, HID_REQ_SET_IDLE);
 
        return 0;
 }
index 7757e82416e7f2270a1ebba2ef44070161424985..ef95102515e4d499143dd02a831481902d674b1e 100644 (file)
@@ -118,8 +118,8 @@ static inline int ntrig_get_mode(struct hid_device *hdev)
        if (!report)
                return -EINVAL;
 
-       usbhid_submit_report(hdev, report, USB_DIR_IN);
-       usbhid_wait_io(hdev);
+       hid_hw_request(hdev, report, HID_REQ_GET_REPORT);
+       hid_hw_wait(hdev);
        return (int)report->field[0]->value[0];
 }
 
@@ -137,7 +137,7 @@ static inline void ntrig_set_mode(struct hid_device *hdev, const int mode)
        if (!report)
                return;
 
-       usbhid_submit_report(hdev, report, USB_DIR_IN);
+       hid_hw_request(hdev, report, HID_REQ_GET_REPORT);
 }
 
 static void ntrig_report_version(struct hid_device *hdev)
@@ -937,8 +937,8 @@ static int ntrig_probe(struct hid_device *hdev, const struct hid_device_id *id)
        if (report) {
                /* Let the device settle to ensure the wakeup message gets
                 * through */
-               usbhid_wait_io(hdev);
-               usbhid_submit_report(hdev, report, USB_DIR_IN);
+               hid_hw_wait(hdev);
+               hid_hw_request(hdev, report, HID_REQ_GET_REPORT);
 
                /*
                 * Sanity check: if the current mode is invalid reset it to
index 020cef69f6a13e07df8d8f9911b4c060b0773461..2941891ecac2747616258beabbb932acad31f793 100644 (file)
@@ -142,10 +142,10 @@ struct hid_report *picolcd_report(int id, struct hid_device *hdev, int dir);
 #ifdef CONFIG_DEBUG_FS
 void picolcd_debug_out_report(struct picolcd_data *data,
                struct hid_device *hdev, struct hid_report *report);
-#define usbhid_submit_report(a, b, c) \
+#define hid_hw_request(a, b, c) \
        do { \
                picolcd_debug_out_report(hid_get_drvdata(a), a, b); \
-               usbhid_submit_report(a, b, c); \
+               hid_hw_request(a, b, c); \
        } while (0)
 
 void picolcd_debug_raw_event(struct picolcd_data *data,
index b91f30945f9c8eb6a6c10da73186040895d5eb3e..a32c5f86b0b3f667466b921f1ed4581ad1857b1e 100644 (file)
@@ -18,8 +18,6 @@
  ***************************************************************************/
 
 #include <linux/hid.h>
-#include "usbhid/usbhid.h"
-#include <linux/usb.h>
 
 #include <linux/fb.h>
 #include <linux/backlight.h>
@@ -46,7 +44,7 @@ static int picolcd_set_brightness(struct backlight_device *bdev)
        spin_lock_irqsave(&data->lock, flags);
        hid_set_field(report->field[0], 0, data->lcd_power == FB_BLANK_UNBLANK ? data->lcd_brightness : 0);
        if (!(data->status & PICOLCD_FAILED))
-               usbhid_submit_report(data->hdev, report, USB_DIR_OUT);
+               hid_hw_request(data->hdev, report, HID_REQ_SET_REPORT);
        spin_unlock_irqrestore(&data->lock, flags);
        return 0;
 }
index a79e95bb9fb69db2803a9f5c4ee8abccfbfc7f4b..e346038f0f111eaf1b47571552df952d10537760 100644 (file)
@@ -21,8 +21,6 @@
 #include <linux/hid-debug.h>
 #include <linux/input.h>
 #include "hid-ids.h"
-#include "usbhid/usbhid.h"
-#include <linux/usb.h>
 
 #include <linux/fb.h>
 #include <linux/vmalloc.h>
index 31cd93fc3d4bff26fb0275d102c90270483289e7..b48092d0e1394a73f4c4ef66a21bc490f4b686f0 100644 (file)
@@ -21,8 +21,6 @@
 #include <linux/hid-debug.h>
 #include <linux/input.h>
 #include "hid-ids.h"
-#include "usbhid/usbhid.h"
-#include <linux/usb.h>
 
 #include <linux/fb.h>
 #include <linux/vmalloc.h>
@@ -110,7 +108,7 @@ struct picolcd_pending *picolcd_send_and_wait(struct hid_device *hdev,
                work = NULL;
        } else {
                data->pending = work;
-               usbhid_submit_report(data->hdev, report, USB_DIR_OUT);
+               hid_hw_request(data->hdev, report, HID_REQ_SET_REPORT);
                spin_unlock_irqrestore(&data->lock, flags);
                wait_for_completion_interruptible_timeout(&work->ready, HZ*2);
                spin_lock_irqsave(&data->lock, flags);
@@ -244,7 +242,7 @@ int picolcd_reset(struct hid_device *hdev)
                spin_unlock_irqrestore(&data->lock, flags);
                return -ENODEV;
        }
-       usbhid_submit_report(hdev, report, USB_DIR_OUT);
+       hid_hw_request(hdev, report, HID_REQ_SET_REPORT);
        spin_unlock_irqrestore(&data->lock, flags);
 
        error = picolcd_check_version(hdev);
@@ -303,7 +301,7 @@ static ssize_t picolcd_operation_mode_store(struct device *dev,
        spin_lock_irqsave(&data->lock, flags);
        hid_set_field(report->field[0], 0, timeout & 0xff);
        hid_set_field(report->field[0], 1, (timeout >> 8) & 0xff);
-       usbhid_submit_report(data->hdev, report, USB_DIR_OUT);
+       hid_hw_request(data->hdev, report, HID_REQ_SET_REPORT);
        spin_unlock_irqrestore(&data->lock, flags);
        return count;
 }
index 4809aa1bdb9c7551161cee1160c75d15131aca3e..59ab8e157e6b249d025ea26d4bd0ba4b2bb7f227 100644 (file)
@@ -19,8 +19,6 @@
 
 #include <linux/hid.h>
 #include <linux/hid-debug.h>
-#include "usbhid/usbhid.h"
-#include <linux/usb.h>
 
 #include <linux/fb.h>
 #include <linux/seq_file.h>
index eb003574b634790b3f5c97cf03c7cba300e3f9fb..591f6b22aa947190a9e728b650caa40090cc9595 100644 (file)
@@ -19,8 +19,6 @@
 
 #include <linux/hid.h>
 #include <linux/vmalloc.h>
-#include "usbhid/usbhid.h"
-#include <linux/usb.h>
 
 #include <linux/fb.h>
 #include <linux/module.h>
@@ -143,8 +141,8 @@ static int picolcd_fb_send_tile(struct picolcd_data *data, u8 *vbitmap,
                else
                        hid_set_field(report2->field[0], 4 + i - 32, tdata[i]);
 
-       usbhid_submit_report(data->hdev, report1, USB_DIR_OUT);
-       usbhid_submit_report(data->hdev, report2, USB_DIR_OUT);
+       hid_hw_request(data->hdev, report1, HID_REQ_SET_REPORT);
+       hid_hw_request(data->hdev, report2, HID_REQ_SET_REPORT);
        spin_unlock_irqrestore(&data->lock, flags);
        return 0;
 }
@@ -214,7 +212,7 @@ int picolcd_fb_reset(struct picolcd_data *data, int clear)
                                hid_set_field(report->field[0], j, mapcmd[j]);
                        else
                                hid_set_field(report->field[0], j, 0);
-               usbhid_submit_report(data->hdev, report, USB_DIR_OUT);
+               hid_hw_request(data->hdev, report, HID_REQ_SET_REPORT);
        }
        spin_unlock_irqrestore(&data->lock, flags);
 
@@ -270,7 +268,7 @@ static void picolcd_fb_update(struct fb_info *info)
                                mutex_unlock(&info->lock);
                                if (!data)
                                        return;
-                               usbhid_wait_io(data->hdev);
+                               hid_hw_wait(data->hdev);
                                mutex_lock(&info->lock);
                                n = 0;
                        }
@@ -288,7 +286,7 @@ static void picolcd_fb_update(struct fb_info *info)
                spin_unlock_irqrestore(&fbdata->lock, flags);
                mutex_unlock(&info->lock);
                if (data)
-                       usbhid_wait_io(data->hdev);
+                       hid_hw_wait(data->hdev);
                return;
        }
 out:
index 2d0ddc5ac65fe1b6d47f236c97a19a32585aee04..89821c2da6d76b766347ae629314d68df3033942 100644 (file)
@@ -18,8 +18,6 @@
  ***************************************************************************/
 
 #include <linux/hid.h>
-#include "usbhid/usbhid.h"
-#include <linux/usb.h>
 
 #include <linux/fb.h>
 #include <linux/lcd.h>
@@ -48,7 +46,7 @@ static int picolcd_set_contrast(struct lcd_device *ldev, int contrast)
        spin_lock_irqsave(&data->lock, flags);
        hid_set_field(report->field[0], 0, data->lcd_contrast);
        if (!(data->status & PICOLCD_FAILED))
-               usbhid_submit_report(data->hdev, report, USB_DIR_OUT);
+               hid_hw_request(data->hdev, report, HID_REQ_SET_REPORT);
        spin_unlock_irqrestore(&data->lock, flags);
        return 0;
 }
index 28cb6a4f96342c788d637f913b7649c2ab0510dc..e994f9c290128942a578a92e8934b2cc76effa86 100644 (file)
@@ -21,8 +21,6 @@
 #include <linux/hid-debug.h>
 #include <linux/input.h>
 #include "hid-ids.h"
-#include "usbhid/usbhid.h"
-#include <linux/usb.h>
 
 #include <linux/fb.h>
 #include <linux/vmalloc.h>
@@ -55,7 +53,7 @@ void picolcd_leds_set(struct picolcd_data *data)
        spin_lock_irqsave(&data->lock, flags);
        hid_set_field(report->field[0], 0, data->led_state);
        if (!(data->status & PICOLCD_FAILED))
-               usbhid_submit_report(data->hdev, report, USB_DIR_OUT);
+               hid_hw_request(data->hdev, report, HID_REQ_SET_REPORT);
        spin_unlock_irqrestore(&data->lock, flags);
 }
 
index b0199d27787b69a328d09488e5802f6e51b781a2..d29112fa5cd51a86b4c29c31398874cc5a726e3d 100644 (file)
 #include <linux/input.h>
 #include <linux/slab.h>
 #include <linux/module.h>
-#include <linux/usb.h>
 #include <linux/hid.h>
 
 #include "hid-ids.h"
 
 #ifdef CONFIG_PANTHERLORD_FF
-#include "usbhid/usbhid.h"
 
 struct plff_device {
        struct hid_report *report;
@@ -75,7 +73,7 @@ static int hid_plff_play(struct input_dev *dev, void *data,
        *plff->strong = left;
        *plff->weak = right;
        debug("running with 0x%02x 0x%02x", left, right);
-       usbhid_submit_report(hid, plff->report, USB_DIR_OUT);
+       hid_hw_request(hid, plff->report, HID_REQ_SET_REPORT);
 
        return 0;
 }
@@ -169,7 +167,7 @@ static int plff_init(struct hid_device *hid)
 
                *strong = 0x00;
                *weak = 0x00;
-               usbhid_submit_report(hid, plff->report, USB_DIR_OUT);
+               hid_hw_request(hid, plff->report, HID_REQ_SET_REPORT);
        }
 
        hid_info(hid, "Force feedback for PantherLord/GreenAsia devices by Anssi Hannula <anssi.hannula@gmail.com>\n");
index 4e1c4bcbdc039763ce170dbb7913bd56fd003d4d..7ed82805641477e5556dff5f12898f2f42095559 100644 (file)
@@ -26,7 +26,6 @@
 #include <sound/core.h>
 #include <sound/initval.h>
 #include <sound/rawmidi.h>
-#include "usbhid/usbhid.h"
 #include "hid-ids.h"
 
 
@@ -306,7 +305,7 @@ static void pcmidi_submit_output_report(struct pcmidi_snd *pm, int state)
        report->field[0]->value[0] = 0x01;
        report->field[0]->value[1] = state;
 
-       usbhid_submit_report(hdev, report, USB_DIR_OUT);
+       hid_hw_request(hdev, report, HID_REQ_SET_REPORT);
 }
 
 static int pcmidi_handle_report1(struct pcmidi_snd *pm, u8 *data)
index 6679788bf75ac0b93126de3b7cac920289c618bb..ca74981073271effdddc72ba1f173acea27ebbf9 100644 (file)
@@ -18,8 +18,6 @@
  */
 #include <linux/device.h>
 #include <linux/hid.h>
-#include <linux/usb.h>
-#include "usbhid/usbhid.h"
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/mfd/core.h>
@@ -204,8 +202,8 @@ int sensor_hub_set_feature(struct hid_sensor_hub_device *hsdev, u32 report_id,
                goto done_proc;
        }
        hid_set_field(report->field[field_index], 0, value);
-       usbhid_submit_report(hsdev->hdev, report, USB_DIR_OUT);
-       usbhid_wait_io(hsdev->hdev);
+       hid_hw_request(hsdev->hdev, report, HID_REQ_SET_REPORT);
+       hid_hw_wait(hsdev->hdev);
 
 done_proc:
        mutex_unlock(&data->mutex);
@@ -227,8 +225,8 @@ int sensor_hub_get_feature(struct hid_sensor_hub_device *hsdev, u32 report_id,
                ret = -EINVAL;
                goto done_proc;
        }
-       usbhid_submit_report(hsdev->hdev, report, USB_DIR_IN);
-       usbhid_wait_io(hsdev->hdev);
+       hid_hw_request(hsdev->hdev, report, HID_REQ_GET_REPORT);
+       hid_hw_wait(hsdev->hdev);
        *value = report->field[field_index]->value[0];
 
 done_proc:
@@ -262,7 +260,7 @@ int sensor_hub_input_attr_get_raw_value(struct hid_sensor_hub_device *hsdev,
                spin_unlock_irqrestore(&data->lock, flags);
                goto err_free;
        }
-       usbhid_submit_report(hsdev->hdev, report, USB_DIR_IN);
+       hid_hw_request(hsdev->hdev, report, HID_REQ_GET_REPORT);
        spin_unlock_irqrestore(&data->lock, flags);
        wait_for_completion_interruptible_timeout(&data->pending.ready, HZ*5);
        switch (data->pending.raw_size) {
index 28f774003f0381a97c58df8ab44ad11393a14d91..37845eccddb566e138ee503876a0a0351918b131 100644 (file)
 
 #include <linux/input.h>
 #include <linux/slab.h>
-#include <linux/usb.h>
 #include <linux/hid.h>
 #include <linux/module.h>
 #include "hid-ids.h"
 
 #ifdef CONFIG_SMARTJOYPLUS_FF
-#include "usbhid/usbhid.h"
 
 struct sjoyff_device {
        struct hid_report *report;
@@ -57,7 +55,7 @@ static int hid_sjoyff_play(struct input_dev *dev, void *data,
        sjoyff->report->field[0]->value[1] = right;
        sjoyff->report->field[0]->value[2] = left;
        dev_dbg(&dev->dev, "running with 0x%02x 0x%02x\n", left, right);
-       usbhid_submit_report(hid, sjoyff->report, USB_DIR_OUT);
+       hid_hw_request(hid, sjoyff->report, HID_REQ_SET_REPORT);
 
        return 0;
 }
@@ -115,7 +113,7 @@ static int sjoyff_init(struct hid_device *hid)
                sjoyff->report->field[0]->value[0] = 0x01;
                sjoyff->report->field[0]->value[1] = 0x00;
                sjoyff->report->field[0]->value[2] = 0x00;
-               usbhid_submit_report(hid, sjoyff->report, USB_DIR_OUT);
+               hid_hw_request(hid, sjoyff->report, HID_REQ_SET_REPORT);
        }
 
        hid_info(hid, "Force feedback for SmartJoy PLUS PS2/USB adapter\n");
index e94371a059cb3b65f53580d83f5dc40e51ee493c..a2f587d004e1e6afccadcd424a2ac5af202a74b6 100644 (file)
 #include <linux/device.h>
 #include <linux/hid.h>
 #include <linux/module.h>
-#include <linux/usb.h>
 
 #include "hid-ids.h"
-#include "usbhid/usbhid.h"
 
 static const struct hid_device_id speedlink_devices[] = {
        { HID_USB_DEVICE(USB_VENDOR_ID_X_TENSIONS, USB_DEVICE_ID_SPEEDLINK_VAD_CEZANNE)},
index 2ed995cda44a8763a11c4c5aba0e69277dfb1069..98e66ac718426cda87ae78cc2facaa97ca8543b8 100644 (file)
@@ -16,7 +16,6 @@
 #include <linux/hid.h>
 #include <linux/module.h>
 
-#include "usbhid/usbhid.h"
 #include "hid-ids.h"
 
 #if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
@@ -132,7 +131,7 @@ static void steelseries_srws1_set_leds(struct hid_device *hdev, __u16 leds)
        value[14] = 0x00;
        value[15] = 0x00;
 
-       usbhid_submit_report(hdev, report, USB_DIR_OUT);
+       hid_hw_request(hdev, report, HID_REQ_SET_REPORT);
 
        /* Note: LED change does not show on device until the device is read/polled */
 }
index 2055a52e9a20f4682866c65b972a6ad96afce8e8..99342cfa0ea2f82591831aaa21fcd9b4e11915c3 100644 (file)
@@ -12,7 +12,6 @@
 #include <linux/hid.h>
 #include <linux/leds.h>
 #include <linux/module.h>
-#include <linux/usb.h>
 
 #include "hid-ids.h"
 
index e4fcf3f702a519b95fdc9ca8ea73d1d80a777c42..b83376077d72282ac3373fe700e8d273d303fc1f 100644 (file)
@@ -30,7 +30,6 @@
 #include <linux/hid.h>
 #include <linux/input.h>
 #include <linux/slab.h>
-#include <linux/usb.h>
 #include <linux/module.h>
 
 #include "hid-ids.h"
@@ -46,7 +45,6 @@ static const signed short ff_joystick[] = {
 };
 
 #ifdef CONFIG_THRUSTMASTER_FF
-#include "usbhid/usbhid.h"
 
 /* Usages for thrustmaster devices I know about */
 #define THRUSTMASTER_USAGE_FF  (HID_UP_GENDESK | 0xbb)
@@ -103,7 +101,7 @@ static int tmff_play(struct input_dev *dev, void *data,
                dbg_hid("(x, y)=(%04x, %04x)\n", x, y);
                ff_field->value[0] = x;
                ff_field->value[1] = y;
-               usbhid_submit_report(hid, tmff->report, USB_DIR_OUT);
+               hid_hw_request(hid, tmff->report, HID_REQ_SET_REPORT);
                break;
 
        case FF_RUMBLE:
@@ -117,7 +115,7 @@ static int tmff_play(struct input_dev *dev, void *data,
                dbg_hid("(left,right)=(%08x, %08x)\n", left, right);
                ff_field->value[0] = left;
                ff_field->value[1] = right;
-               usbhid_submit_report(hid, tmff->report, USB_DIR_OUT);
+               hid_hw_request(hid, tmff->report, HID_REQ_SET_REPORT);
                break;
        }
        return 0;
index af66452592e963c8a5e91f17921e166e50699800..6ec28a37c146ab58d623ef1ccaafc38b3dcd9477 100644 (file)
 #include <linux/hid.h>
 #include <linux/input.h>
 #include <linux/slab.h>
-#include <linux/usb.h>
 #include <linux/module.h>
 
 #include "hid-ids.h"
 
 #ifdef CONFIG_ZEROPLUS_FF
-#include "usbhid/usbhid.h"
 
 struct zpff_device {
        struct hid_report *report;
@@ -59,7 +57,7 @@ static int zpff_play(struct input_dev *dev, void *data,
        zpff->report->field[2]->value[0] = left;
        zpff->report->field[3]->value[0] = right;
        dbg_hid("running with 0x%02x 0x%02x\n", left, right);
-       usbhid_submit_report(hid, zpff->report, USB_DIR_OUT);
+       hid_hw_request(hid, zpff->report, HID_REQ_SET_REPORT);
 
        return 0;
 }
@@ -104,7 +102,7 @@ static int zpff_init(struct hid_device *hid)
        zpff->report->field[1]->value[0] = 0x02;
        zpff->report->field[2]->value[0] = 0x00;
        zpff->report->field[3]->value[0] = 0x00;
-       usbhid_submit_report(hid, zpff->report, USB_DIR_OUT);
+       hid_hw_request(hid, zpff->report, HID_REQ_SET_REPORT);
 
        hid_info(hid, "force feedback for Zeroplus based devices by Anssi Hannula <anssi.hannula@gmail.com>\n");
 
index ec7930217a6dff1fceb15b1a445ec0462cb47b82..935f387be95a333cde1e9ac56c931811f60135a2 100644 (file)
@@ -563,6 +563,37 @@ static int i2c_hid_output_raw_report(struct hid_device *hid, __u8 *buf,
        return ret;
 }
 
+static void i2c_hid_request(struct hid_device *hid, struct hid_report *rep,
+               int reqtype)
+{
+       struct i2c_client *client = hid->driver_data;
+       struct i2c_hid *ihid = i2c_get_clientdata(client);
+       char *buf;
+       int ret;
+
+       buf = kzalloc(ihid->bufsize, GFP_KERNEL);
+       if (!buf)
+               return;
+
+       switch (reqtype) {
+       case HID_REQ_GET_REPORT:
+               ret = i2c_hid_get_raw_report(hid, rep->id, buf, ihid->bufsize,
+                                            rep->type);
+               if (ret < 0)
+                       dev_err(&client->dev, "%s: unable to get report: %d\n",
+                               __func__, ret);
+               else
+                       hid_input_report(hid, rep->type, buf, ret, 0);
+               break;
+       case HID_REQ_SET_REPORT:
+               hid_output_report(rep, buf);
+               i2c_hid_output_raw_report(hid, buf, ihid->bufsize, rep->type);
+               break;
+       }
+
+       kfree(buf);
+}
+
 static int i2c_hid_parse(struct hid_device *hid)
 {
        struct i2c_client *client = hid->driver_data;
@@ -742,6 +773,7 @@ static struct hid_ll_driver i2c_hid_ll_driver = {
        .open = i2c_hid_open,
        .close = i2c_hid_close,
        .power = i2c_hid_power,
+       .request = i2c_hid_request,
        .hidinput_input_event = i2c_hid_hidinput_input_event,
 };
 
index 8e0c4bf94ebc44b8a3cf214bfd82b9000a7b874a..effcd3d6f5cf6ebf0f638e93b20448edaeb5bc34 100644 (file)
@@ -639,7 +639,7 @@ static void __usbhid_submit_report(struct hid_device *hid, struct hid_report *re
        }
 }
 
-void usbhid_submit_report(struct hid_device *hid, struct hid_report *report, unsigned char dir)
+static void usbhid_submit_report(struct hid_device *hid, struct hid_report *report, unsigned char dir)
 {
        struct usbhid_device *usbhid = hid->driver_data;
        unsigned long flags;
@@ -648,7 +648,6 @@ void usbhid_submit_report(struct hid_device *hid, struct hid_report *report, uns
        __usbhid_submit_report(hid, report, dir);
        spin_unlock_irqrestore(&usbhid->lock, flags);
 }
-EXPORT_SYMBOL_GPL(usbhid_submit_report);
 
 /* Workqueue routine to send requests to change LEDs */
 static void hid_led(struct work_struct *work)
@@ -706,7 +705,7 @@ static int usb_hidinput_input_event(struct input_dev *dev, unsigned int type, un
        return 0;
 }
 
-int usbhid_wait_io(struct hid_device *hid)
+static int usbhid_wait_io(struct hid_device *hid)
 {
        struct usbhid_device *usbhid = hid->driver_data;
 
@@ -720,7 +719,6 @@ int usbhid_wait_io(struct hid_device *hid)
 
        return 0;
 }
-EXPORT_SYMBOL_GPL(usbhid_wait_io);
 
 static int hid_set_idle(struct usb_device *dev, int ifnum, int report, int idle)
 {
@@ -1243,6 +1241,32 @@ static int usbhid_power(struct hid_device *hid, int lvl)
        return r;
 }
 
+static void usbhid_request(struct hid_device *hid, struct hid_report *rep, int reqtype)
+{
+       switch (reqtype) {
+       case HID_REQ_GET_REPORT:
+               usbhid_submit_report(hid, rep, USB_DIR_IN);
+               break;
+       case HID_REQ_SET_REPORT:
+               usbhid_submit_report(hid, rep, USB_DIR_OUT);
+               break;
+       }
+}
+
+static int usbhid_idle(struct hid_device *hid, int report, int idle,
+               int reqtype)
+{
+       struct usb_device *dev = hid_to_usb_dev(hid);
+       struct usb_interface *intf = to_usb_interface(hid->dev.parent);
+       struct usb_host_interface *interface = intf->cur_altsetting;
+       int ifnum = interface->desc.bInterfaceNumber;
+
+       if (reqtype != HID_REQ_SET_IDLE)
+               return -EINVAL;
+
+       return hid_set_idle(dev, ifnum, report, idle);
+}
+
 static struct hid_ll_driver usb_hid_driver = {
        .parse = usbhid_parse,
        .start = usbhid_start,
@@ -1251,6 +1275,9 @@ static struct hid_ll_driver usb_hid_driver = {
        .close = usbhid_close,
        .power = usbhid_power,
        .hidinput_input_event = usb_hidinput_input_event,
+       .request = usbhid_request,
+       .wait = usbhid_wait_io,
+       .idle = usbhid_idle,
 };
 
 static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id *id)
index f91c136821f7097e05cd761ed9f554a56fabcfed..10b6167027802abbc289466c00a74b6281e2b5f3 100644 (file)
@@ -263,8 +263,8 @@ static void pidff_set_envelope_report(struct pidff_device *pidff,
                envelope->attack_level,
                pidff->set_envelope[PID_ATTACK_LEVEL].value[0]);
 
-       usbhid_submit_report(pidff->hid, pidff->reports[PID_SET_ENVELOPE],
-                         USB_DIR_OUT);
+       hid_hw_request(pidff->hid, pidff->reports[PID_SET_ENVELOPE],
+                       HID_REQ_SET_REPORT);
 }
 
 /*
@@ -290,8 +290,8 @@ static void pidff_set_constant_force_report(struct pidff_device *pidff,
        pidff_set_signed(&pidff->set_constant[PID_MAGNITUDE],
                         effect->u.constant.level);
 
-       usbhid_submit_report(pidff->hid, pidff->reports[PID_SET_CONSTANT],
-                         USB_DIR_OUT);
+       hid_hw_request(pidff->hid, pidff->reports[PID_SET_CONSTANT],
+                       HID_REQ_SET_REPORT);
 }
 
 /*
@@ -325,8 +325,8 @@ static void pidff_set_effect_report(struct pidff_device *pidff,
                                pidff->effect_direction);
        pidff->set_effect[PID_START_DELAY].value[0] = effect->replay.delay;
 
-       usbhid_submit_report(pidff->hid, pidff->reports[PID_SET_EFFECT],
-                         USB_DIR_OUT);
+       hid_hw_request(pidff->hid, pidff->reports[PID_SET_EFFECT],
+                       HID_REQ_SET_REPORT);
 }
 
 /*
@@ -357,8 +357,8 @@ static void pidff_set_periodic_report(struct pidff_device *pidff,
        pidff_set(&pidff->set_periodic[PID_PHASE], effect->u.periodic.phase);
        pidff->set_periodic[PID_PERIOD].value[0] = effect->u.periodic.period;
 
-       usbhid_submit_report(pidff->hid, pidff->reports[PID_SET_PERIODIC],
-                         USB_DIR_OUT);
+       hid_hw_request(pidff->hid, pidff->reports[PID_SET_PERIODIC],
+                       HID_REQ_SET_REPORT);
 
 }
 
@@ -399,8 +399,8 @@ static void pidff_set_condition_report(struct pidff_device *pidff,
                          effect->u.condition[i].left_saturation);
                pidff_set(&pidff->set_condition[PID_DEAD_BAND],
                          effect->u.condition[i].deadband);
-               usbhid_submit_report(pidff->hid, pidff->reports[PID_SET_CONDITION],
-                                 USB_DIR_OUT);
+               hid_hw_request(pidff->hid, pidff->reports[PID_SET_CONDITION],
+                               HID_REQ_SET_REPORT);
        }
 }
 
@@ -440,8 +440,8 @@ static void pidff_set_ramp_force_report(struct pidff_device *pidff,
                         effect->u.ramp.start_level);
        pidff_set_signed(&pidff->set_ramp[PID_RAMP_END],
                         effect->u.ramp.end_level);
-       usbhid_submit_report(pidff->hid, pidff->reports[PID_SET_RAMP],
-                         USB_DIR_OUT);
+       hid_hw_request(pidff->hid, pidff->reports[PID_SET_RAMP],
+                       HID_REQ_SET_REPORT);
 }
 
 /*
@@ -465,19 +465,19 @@ static int pidff_request_effect_upload(struct pidff_device *pidff, int efnum)
        int j;
 
        pidff->create_new_effect_type->value[0] = efnum;
-       usbhid_submit_report(pidff->hid, pidff->reports[PID_CREATE_NEW_EFFECT],
-                         USB_DIR_OUT);
+       hid_hw_request(pidff->hid, pidff->reports[PID_CREATE_NEW_EFFECT],
+                       HID_REQ_SET_REPORT);
        hid_dbg(pidff->hid, "create_new_effect sent, type: %d\n", efnum);
 
        pidff->block_load[PID_EFFECT_BLOCK_INDEX].value[0] = 0;
        pidff->block_load_status->value[0] = 0;
-       usbhid_wait_io(pidff->hid);
+       hid_hw_wait(pidff->hid);
 
        for (j = 0; j < 60; j++) {
                hid_dbg(pidff->hid, "pid_block_load requested\n");
-               usbhid_submit_report(pidff->hid, pidff->reports[PID_BLOCK_LOAD],
-                                 USB_DIR_IN);
-               usbhid_wait_io(pidff->hid);
+               hid_hw_request(pidff->hid, pidff->reports[PID_BLOCK_LOAD],
+                               HID_REQ_GET_REPORT);
+               hid_hw_wait(pidff->hid);
                if (pidff->block_load_status->value[0] ==
                    pidff->status_id[PID_BLOCK_LOAD_SUCCESS]) {
                        hid_dbg(pidff->hid, "device reported free memory: %d bytes\n",
@@ -513,8 +513,8 @@ static void pidff_playback_pid(struct pidff_device *pidff, int pid_id, int n)
                pidff->effect_operation[PID_LOOP_COUNT].value[0] = n;
        }
 
-       usbhid_submit_report(pidff->hid, pidff->reports[PID_EFFECT_OPERATION],
-                         USB_DIR_OUT);
+       hid_hw_request(pidff->hid, pidff->reports[PID_EFFECT_OPERATION],
+                       HID_REQ_SET_REPORT);
 }
 
 /**
@@ -535,8 +535,8 @@ static int pidff_playback(struct input_dev *dev, int effect_id, int value)
 static void pidff_erase_pid(struct pidff_device *pidff, int pid_id)
 {
        pidff->block_free[PID_EFFECT_BLOCK_INDEX].value[0] = pid_id;
-       usbhid_submit_report(pidff->hid, pidff->reports[PID_BLOCK_FREE],
-                         USB_DIR_OUT);
+       hid_hw_request(pidff->hid, pidff->reports[PID_BLOCK_FREE],
+                       HID_REQ_SET_REPORT);
 }
 
 /*
@@ -551,7 +551,7 @@ static int pidff_erase_effect(struct input_dev *dev, int effect_id)
                effect_id, pidff->pid_id[effect_id]);
        /* Wait for the queue to clear. We do not want a full fifo to
           prevent the effect removal. */
-       usbhid_wait_io(pidff->hid);
+       hid_hw_wait(pidff->hid);
        pidff_playback_pid(pidff, pid_id, 0);
        pidff_erase_pid(pidff, pid_id);
 
@@ -718,8 +718,8 @@ static void pidff_set_gain(struct input_dev *dev, u16 gain)
        struct pidff_device *pidff = dev->ff->private;
 
        pidff_set(&pidff->device_gain[PID_DEVICE_GAIN_FIELD], gain);
-       usbhid_submit_report(pidff->hid, pidff->reports[PID_DEVICE_GAIN],
-                         USB_DIR_OUT);
+       hid_hw_request(pidff->hid, pidff->reports[PID_DEVICE_GAIN],
+                       HID_REQ_SET_REPORT);
 }
 
 static void pidff_autocenter(struct pidff_device *pidff, u16 magnitude)
@@ -744,8 +744,8 @@ static void pidff_autocenter(struct pidff_device *pidff, u16 magnitude)
        pidff->set_effect[PID_DIRECTION_ENABLE].value[0] = 1;
        pidff->set_effect[PID_START_DELAY].value[0] = 0;
 
-       usbhid_submit_report(pidff->hid, pidff->reports[PID_SET_EFFECT],
-                         USB_DIR_OUT);
+       hid_hw_request(pidff->hid, pidff->reports[PID_SET_EFFECT],
+                       HID_REQ_SET_REPORT);
 }
 
 /*
@@ -1158,19 +1158,19 @@ static void pidff_reset(struct pidff_device *pidff)
 
        pidff->device_control->value[0] = pidff->control_id[PID_RESET];
        /* We reset twice as sometimes hid_wait_io isn't waiting long enough */
-       usbhid_submit_report(hid, pidff->reports[PID_DEVICE_CONTROL], USB_DIR_OUT);
-       usbhid_wait_io(hid);
-       usbhid_submit_report(hid, pidff->reports[PID_DEVICE_CONTROL], USB_DIR_OUT);
-       usbhid_wait_io(hid);
+       hid_hw_request(hid, pidff->reports[PID_DEVICE_CONTROL], HID_REQ_SET_REPORT);
+       hid_hw_wait(hid);
+       hid_hw_request(hid, pidff->reports[PID_DEVICE_CONTROL], HID_REQ_SET_REPORT);
+       hid_hw_wait(hid);
 
        pidff->device_control->value[0] =
                pidff->control_id[PID_ENABLE_ACTUATORS];
-       usbhid_submit_report(hid, pidff->reports[PID_DEVICE_CONTROL], USB_DIR_OUT);
-       usbhid_wait_io(hid);
+       hid_hw_request(hid, pidff->reports[PID_DEVICE_CONTROL], HID_REQ_SET_REPORT);
+       hid_hw_wait(hid);
 
        /* pool report is sometimes messed up, refetch it */
-       usbhid_submit_report(hid, pidff->reports[PID_POOL], USB_DIR_IN);
-       usbhid_wait_io(hid);
+       hid_hw_request(hid, pidff->reports[PID_POOL], HID_REQ_GET_REPORT);
+       hid_hw_wait(hid);
 
        if (pidff->pool[PID_SIMULTANEOUS_MAX].value) {
                while (pidff->pool[PID_SIMULTANEOUS_MAX].value[0] < 2) {
@@ -1181,9 +1181,9 @@ static void pidff_reset(struct pidff_device *pidff)
                                break;
                        }
                        hid_dbg(pidff->hid, "pid_pool requested again\n");
-                       usbhid_submit_report(hid, pidff->reports[PID_POOL],
-                                         USB_DIR_IN);
-                       usbhid_wait_io(hid);
+                       hid_hw_request(hid, pidff->reports[PID_POOL],
+                                         HID_REQ_GET_REPORT);
+                       hid_hw_wait(hid);
                }
        }
 }
@@ -1269,8 +1269,8 @@ int hid_pidff_init(struct hid_device *hid)
 
        if (test_bit(FF_GAIN, dev->ffbit)) {
                pidff_set(&pidff->device_gain[PID_DEVICE_GAIN_FIELD], 0xffff);
-               usbhid_submit_report(hid, pidff->reports[PID_DEVICE_GAIN],
-                                    USB_DIR_OUT);
+               hid_hw_request(hid, pidff->reports[PID_DEVICE_GAIN],
+                                    HID_REQ_SET_REPORT);
        }
 
        error = pidff_check_autocenter(pidff, dev);
index 87bd64959a91b4bed5e3745751e237f78ac4470a..2f1ddca6f2e0a3a4712bce434d5b29e1556e216c 100644 (file)
@@ -705,8 +705,8 @@ static long hiddev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                if (report == NULL)
                        break;
 
-               usbhid_submit_report(hid, report, USB_DIR_IN);
-               usbhid_wait_io(hid);
+               hid_hw_request(hid, report, HID_REQ_GET_REPORT);
+               hid_hw_wait(hid);
 
                r = 0;
                break;
@@ -724,8 +724,8 @@ static long hiddev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                if (report == NULL)
                        break;
 
-               usbhid_submit_report(hid, report, USB_DIR_OUT);
-               usbhid_wait_io(hid);
+               hid_hw_request(hid, report, HID_REQ_SET_REPORT);
+               hid_hw_wait(hid);
 
                r = 0;
                break;
index bd87a61e53037dd63c63aff48a277ff172cd964c..dbb6af6991350d4e09b2c7ca484411065afdc75c 100644 (file)
 #include <linux/input.h>
 
 /*  API provided by hid-core.c for USB HID drivers */
-int usbhid_wait_io(struct hid_device* hid);
 void usbhid_close(struct hid_device *hid);
 int usbhid_open(struct hid_device *hid);
 void usbhid_init_reports(struct hid_device *hid);
-void usbhid_submit_report
-(struct hid_device *hid, struct hid_report *report, unsigned char dir);
 int usbhid_get_power(struct hid_device *hid);
 void usbhid_put_power(struct hid_device *hid);
 struct usb_interface *usbhid_find_interface(int minor);
index e14b465b11463d353553027e602d79499d8be01d..863744c38ddc88c2c324c0021a9763b7bab43887 100644 (file)
@@ -662,6 +662,9 @@ struct hid_driver {
  * @hidinput_input_event: event input event (e.g. ff or leds)
  * @parse: this method is called only once to parse the device data,
  *        shouldn't allocate anything to not leak memory
+ * @request: send report request to device (e.g. feature report)
+ * @wait: wait for buffered io to complete (send/recv reports)
+ * @idle: send idle request to device
  */
 struct hid_ll_driver {
        int (*start)(struct hid_device *hdev);
@@ -676,6 +679,13 @@ struct hid_ll_driver {
                        unsigned int code, int value);
 
        int (*parse)(struct hid_device *hdev);
+
+       void (*request)(struct hid_device *hdev,
+                       struct hid_report *report, int reqtype);
+
+       int (*wait)(struct hid_device *hdev);
+       int (*idle)(struct hid_device *hdev, int report, int idle, int reqtype);
+
 };
 
 #define        PM_HINT_FULLON  1<<5
@@ -883,6 +893,49 @@ static inline int hid_hw_power(struct hid_device *hdev, int level)
        return hdev->ll_driver->power ? hdev->ll_driver->power(hdev, level) : 0;
 }
 
+
+/**
+ * hid_hw_request - send report request to device
+ *
+ * @hdev: hid device
+ * @report: report to send
+ * @reqtype: hid request type
+ */
+static inline void hid_hw_request(struct hid_device *hdev,
+                                 struct hid_report *report, int reqtype)
+{
+       if (hdev->ll_driver->request)
+               hdev->ll_driver->request(hdev, report, reqtype);
+}
+
+/**
+ * hid_hw_idle - send idle request to device
+ *
+ * @hdev: hid device
+ * @report: report to control
+ * @idle: idle state
+ * @reqtype: hid request type
+ */
+static inline int hid_hw_idle(struct hid_device *hdev, int report, int idle,
+               int reqtype)
+{
+       if (hdev->ll_driver->idle)
+               return hdev->ll_driver->idle(hdev, report, idle, reqtype);
+
+       return 0;
+}
+
+/**
+ * hid_hw_wait - wait for buffered io to complete
+ *
+ * @hdev: hid device
+ */
+static inline void hid_hw_wait(struct hid_device *hdev)
+{
+       if (hdev->ll_driver->wait)
+               hdev->ll_driver->wait(hdev);
+}
+
 int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size,
                int interrupt);