---help---
Support for Gyration remote control.
++++++ config HID_ICADE
++++++ tristate "ION iCade arcade controller"
++++++ depends on BT_HIDP
++++++ ---help---
++++++ Support for the ION iCade arcade controller to work as a joystick.
++++++
++++++ To compile this driver as a module, choose M here: the
++++++ module will be called hid-icade.
++++++
config HID_TWINHAN
tristate "Twinhan IR remote control"
depends on USB_HID
source "drivers/hid/usbhid/Kconfig"
++ ++++source "drivers/hid/i2c-hid/Kconfig"
++ ++++
endmenu
obj-$(CONFIG_HID_HOLTEK) += hid-holtek-kbd.o
obj-$(CONFIG_HID_HOLTEK) += hid-holtekff.o
obj-$(CONFIG_HID_HYPERV_MOUSE) += hid-hyperv.o
++++++ obj-$(CONFIG_HID_ICADE) += hid-icade.o
obj-$(CONFIG_HID_KENSINGTON) += hid-kensington.o
obj-$(CONFIG_HID_KEYTOUCH) += hid-keytouch.o
obj-$(CONFIG_HID_KYE) += hid-kye.o
obj-$(CONFIG_HID_PS3REMOTE) += hid-ps3remote.o
obj-$(CONFIG_HID_ROCCAT) += hid-roccat.o hid-roccat-common.o \
hid-roccat-arvo.o hid-roccat-isku.o hid-roccat-kone.o \
---- -- hid-roccat-koneplus.o hid-roccat-kovaplus.o hid-roccat-pyra.o \
---- -- hid-roccat-savu.o
++++ ++ hid-roccat-koneplus.o hid-roccat-kovaplus.o hid-roccat-lua.o \
++++ ++ hid-roccat-pyra.o hid-roccat-savu.o
obj-$(CONFIG_HID_SAITEK) += hid-saitek.o
obj-$(CONFIG_HID_SAMSUNG) += hid-samsung.o
obj-$(CONFIG_HID_SMARTJOYPLUS) += hid-sjoy.o
obj-$(CONFIG_USB_MOUSE) += usbhid/
obj-$(CONFIG_USB_KBD) += usbhid/
++ ++++obj-$(CONFIG_I2C_HID) += i2c-hid/
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ANSI),
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ISO),
------ .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
++++++ .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN |
++++++ APPLE_ISO_KEYBOARD },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_JIS),
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN |
APPLE_RDESC_JIS },
.driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_JIS),
.driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS },
+ + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7A_ANSI),
+ + .driver_data = APPLE_HAS_FN },
+ + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7A_ISO),
+ + .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD },
+ + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7A_JIS),
+ + .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI),
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO),
static struct hid_field *hid_register_field(struct hid_report *report, unsigned usages, unsigned values)
{
struct hid_field *field;
+++ +++ int i;
if (report->maxfield == HID_MAX_FIELDS) {
hid_err(report->device, "too many fields in report\n");
field->value = (s32 *)(field->usage + usages);
field->report = report;
+++ +++ for (i = 0; i < usages; i++)
+++ +++ field->usage[i].usage_index = i;
+++ +++
return field;
}
static int hid_parser_global(struct hid_parser *parser, struct hid_item *item)
{
+++ +++ __u32 raw_value;
switch (item->tag) {
case HID_GLOBAL_ITEM_TAG_PUSH:
return 0;
case HID_GLOBAL_ITEM_TAG_UNIT_EXPONENT:
--- --- parser->global.unit_exponent = item_sdata(item);
+++ +++ /* Units exponent negative numbers are given through a
+++ +++ * two's complement.
+++ +++ * See "6.2.2.7 Global Items" for more information. */
+++ +++ raw_value = item_udata(item);
+++ +++ if (!(raw_value & 0xfffffff0))
+++ +++ parser->global.unit_exponent = hid_snto32(raw_value, 4);
+++ +++ else
+++ +++ parser->global.unit_exponent = raw_value;
return 0;
case HID_GLOBAL_ITEM_TAG_UNIT:
hid_scan_usage(hid, u);
break;
}
----- - }
+++++ + } 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->group = HID_GROUP_SENSOR_HUB;
}
return 0;
return value & (1 << (n - 1)) ? value | (-1 << n) : value;
}
+++ +++s32 hid_snto32(__u32 value, unsigned n)
+++ +++{
+++ +++ return snto32(value, n);
+++ +++}
+++ +++EXPORT_SYMBOL_GPL(hid_snto32);
+++ +++
/*
* Convert a signed 32-bit integer to a signed n-bit integer.
*/
* there is a proper autodetection and autoloading in place (based on presence
* of HID_DG_CONTACTID), so those devices don't need to be added to this list,
* as we are doing the right thing in hid_scan_usage().
+++++ + *
+++++ + * Autodetection for (USB) HID sensor hubs exists too. If a collection of type
+++++ + * physical is found inside a usage page of type sensor, hid-sensor-hub will be
+++++ + * used as a driver. See hid_scan_report().
*/
static const struct hid_device_id hid_have_special_driver[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_ISO) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_JIS) },
+ + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7A_ANSI) },
+ + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7A_ISO) },
+ + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7A_JIS) },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI) },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO) },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS) },
++++++ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ANSI) },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ISO) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) },
{ HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE_3) },
{ HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK, USB_DEVICE_ID_HOLTEK_ON_LINE_GRIP) },
{ HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD) },
----- - { HID_USB_DEVICE(USB_VENDOR_ID_INTEL_8086, USB_DEVICE_ID_SENSOR_HUB_1020) },
----- - { HID_USB_DEVICE(USB_VENDOR_ID_INTEL_8086, USB_DEVICE_ID_SENSOR_HUB_09FA) },
----- - { HID_USB_DEVICE(USB_VENDOR_ID_INTEL_8087, USB_DEVICE_ID_SENSOR_HUB_1020) },
----- - { HID_USB_DEVICE(USB_VENDOR_ID_INTEL_8087, USB_DEVICE_ID_SENSOR_HUB_09FA) },
++++++ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ION, USB_DEVICE_ID_ICADE) },
{ HID_USB_DEVICE(USB_VENDOR_ID_KENSINGTON, USB_DEVICE_ID_KS_SLIMBLADE) },
{ HID_USB_DEVICE(USB_VENDOR_ID_KEYTOUCH, USB_DEVICE_ID_KEYTOUCH_IEC) },
{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_ERGO_525V) },
{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_ISKU) },
{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KONEPLUS) },
{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KOVAPLUS) },
++++ ++ { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_LUA) },
{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_PYRA_WIRED) },
{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_PYRA_WIRELESS) },
{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_SAVU) },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) },
{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE) },
{ HID_USB_DEVICE(USB_VENDOR_ID_SUNPLUS, USB_DEVICE_ID_SUNPLUS_WDESKTOP) },
----- - { HID_USB_DEVICE(USB_VENDOR_ID_STANTUM_STM, USB_DEVICE_ID_SENSOR_HUB_7014) },
{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb300) },
{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb304) },
{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb323) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_ISO) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_JIS) },
+ + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7A_ANSI) },
+ + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7A_ISO) },
+ + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7A_JIS) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) },
{ }
};
------ static bool hid_ignore(struct hid_device *hdev)
++++++ bool hid_ignore(struct hid_device *hdev)
{
++++++ if (hdev->quirks & HID_QUIRK_NO_IGNORE)
++++++ return false;
++++++ if (hdev->quirks & HID_QUIRK_IGNORE)
++++++ return true;
++++++
switch (hdev->vendor) {
case USB_VENDOR_ID_CODEMERCS:
/* ignore all Code Mercenaries IOWarrior devices */
if (hdev->product == USB_DEVICE_ID_JESS_YUREX &&
hdev->type == HID_TYPE_USBNONE)
return true;
------ break;
++++++ break;
++++++ case USB_VENDOR_ID_DWAV:
++++++ /* These are handled by usbtouchscreen. hdev->type is probably
++++++ * HID_TYPE_USBNONE, but we say !HID_TYPE_USBMOUSE to match
++++++ * usbtouchscreen. */
++++++ if ((hdev->product == USB_DEVICE_ID_EGALAX_TOUCHCONTROLLER ||
++++++ hdev->product == USB_DEVICE_ID_DWAV_TOUCHCONTROLLER) &&
++++++ hdev->type != HID_TYPE_USBMOUSE)
++++++ return true;
++++++ break;
}
if (hdev->type == HID_TYPE_USBMOUSE &&
return !!hid_match_id(hdev, hid_ignore_list);
}
++++++ EXPORT_SYMBOL_GPL(hid_ignore);
int hid_add_device(struct hid_device *hdev)
{
/* we need to kill them here, otherwise they will stay allocated to
* wait for coming driver */
------ if (!(hdev->quirks & HID_QUIRK_NO_IGNORE)
------ && (hid_ignore(hdev) || (hdev->quirks & HID_QUIRK_IGNORE)))
++++++ if (hid_ignore(hdev))
return -ENODEV;
/*
#define USB_DEVICE_ID_APPLE_WELLSPRING5A_ANSI 0x0252
#define USB_DEVICE_ID_APPLE_WELLSPRING5A_ISO 0x0253
#define USB_DEVICE_ID_APPLE_WELLSPRING5A_JIS 0x0254
+ +#define USB_DEVICE_ID_APPLE_WELLSPRING7A_ANSI 0x0259
+ +#define USB_DEVICE_ID_APPLE_WELLSPRING7A_ISO 0x025a
+ +#define USB_DEVICE_ID_APPLE_WELLSPRING7A_JIS 0x025b
#define USB_DEVICE_ID_APPLE_WELLSPRING6A_ANSI 0x0249
#define USB_DEVICE_ID_APPLE_WELLSPRING6A_ISO 0x024a
#define USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS 0x024b
#define USB_VENDOR_ID_DWAV 0x0eef
#define USB_DEVICE_ID_EGALAX_TOUCHCONTROLLER 0x0001
++++++ #define USB_DEVICE_ID_DWAV_TOUCHCONTROLLER 0x0002
#define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_480D 0x480d
#define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_480E 0x480e
#define USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_7207 0x7207
#define USB_VENDOR_ID_ILITEK 0x222a
#define USB_DEVICE_ID_ILITEK_MULTITOUCH 0x0001
++++++ #define USB_VENDOR_ID_ION 0x15e4
++++++ #define USB_DEVICE_ID_ICADE 0x0132
++++++
#define USB_VENDOR_ID_HOLTEK 0x1241
#define USB_DEVICE_ID_HOLTEK_ON_LINE_GRIP 0x5015
#define USB_VENDOR_ID_IMATION 0x0718
#define USB_DEVICE_ID_DISC_STAKKA 0xd000
----- -#define USB_VENDOR_ID_INTEL_8086 0x8086
----- -#define USB_VENDOR_ID_INTEL_8087 0x8087
----- -#define USB_DEVICE_ID_SENSOR_HUB_1020 0x1020
----- -#define USB_DEVICE_ID_SENSOR_HUB_09FA 0x09FA
----- -
#define USB_VENDOR_ID_IRTOUCHSYSTEMS 0x6615
#define USB_DEVICE_ID_IRTOUCH_INFRARED_USB 0x0070
#define USB_VENDOR_ID_NOVATEK 0x0603
#define USB_DEVICE_ID_NOVATEK_PCT 0x0600
++++++#define USB_DEVICE_ID_NOVATEK_MOUSE 0x1602
#define USB_VENDOR_ID_NTRIG 0x1b96
#define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN 0x0001
#define USB_DEVICE_ID_ROCCAT_ISKU 0x319c
#define USB_DEVICE_ID_ROCCAT_KONE 0x2ced
#define USB_DEVICE_ID_ROCCAT_KONEPLUS 0x2d51
++++ ++#define USB_DEVICE_ID_ROCCAT_KONEXTD 0x2e22
#define USB_DEVICE_ID_ROCCAT_KOVAPLUS 0x2d50
++++ ++#define USB_DEVICE_ID_ROCCAT_LUA 0x2c2e
#define USB_DEVICE_ID_ROCCAT_PYRA_WIRED 0x2c24
#define USB_DEVICE_ID_ROCCAT_PYRA_WIRELESS 0x2cf6
#define USB_DEVICE_ID_ROCCAT_SAVU 0x2d5a
#define USB_VENDOR_ID_SIGMA_MICRO 0x1c4f
#define USB_DEVICE_ID_SIGMA_MICRO_KEYBOARD 0x0002
++++++ #define USB_VENDOR_ID_SIGMATEL 0x066F
++++++ #define USB_DEVICE_ID_SIGMATEL_STMP3780 0x3780
++++++
#define USB_VENDOR_ID_SKYCABLE 0x1223
#define USB_DEVICE_ID_SKYCABLE_WIRELESS_PRESENTER 0x3F07
#define USB_VENDOR_ID_STANTUM_STM 0x0483
#define USB_DEVICE_ID_MTP_STM 0x3261
----- -#define USB_DEVICE_ID_SENSOR_HUB_7014 0x7014
#define USB_VENDOR_ID_STANTUM_SITRONIX 0x1403
#define USB_DEVICE_ID_MTP_SITRONIX 0x5001
#define USB_VENDOR_ID_TOUCHPACK 0x1bfd
#define USB_DEVICE_ID_TOUCHPACK_RTS 0x1688
++++++ #define USB_VENDOR_ID_TPV 0x25aa
++++++ #define USB_DEVICE_ID_TPV_OPTICAL_TOUCHSCREEN 0x8883
++++++
#define USB_VENDOR_ID_TURBOX 0x062a
#define USB_DEVICE_ID_TURBOX_KEYBOARD 0x0201
#define USB_DEVICE_ID_TURBOX_TOUCHSCREEN_MOSART 0x7100
return -EINVAL;
}
--- ---
/**
* hidinput_calc_abs_res - calculate an absolute axis resolution
* @field: the HID report field to calculate resolution for
* Only exponent 1 length units are processed. Centimeters and inches are
* converted to millimeters. Degrees are converted to radians.
*/
--- ---static __s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code)
+++ +++__s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code)
{
__s32 unit_exponent = field->unit_exponent;
__s32 logical_extents = field->logical_maximum -
case ABS_X:
case ABS_Y:
case ABS_Z:
--- --- if (field->unit == 0x11) { /* If centimeters */
+++ +++ case ABS_MT_POSITION_X:
+++ +++ case ABS_MT_POSITION_Y:
+++ +++ case ABS_MT_TOOL_X:
+++ +++ case ABS_MT_TOOL_Y:
+++ +++ case ABS_MT_TOUCH_MAJOR:
+++ +++ case ABS_MT_TOUCH_MINOR:
+++ +++ if (field->unit & 0xffffff00) /* Not a length */
+++ +++ return 0;
+++ +++ unit_exponent += hid_snto32(field->unit >> 4, 4) - 1;
+++ +++ switch (field->unit & 0xf) {
+++ +++ case 0x1: /* If centimeters */
/* Convert to millimeters */
unit_exponent += 1;
--- --- } else if (field->unit == 0x13) { /* If inches */
+++ +++ break;
+++ +++ case 0x3: /* If inches */
/* Convert to millimeters */
prev = physical_extents;
physical_extents *= 254;
if (physical_extents < prev)
return 0;
unit_exponent -= 1;
--- --- } else {
+++ +++ break;
+++ +++ default:
return 0;
}
break;
}
/* Calculate resolution */
--- --- return logical_extents / physical_extents;
+++ +++ return DIV_ROUND_CLOSEST(logical_extents, physical_extents);
}
+++ +++EXPORT_SYMBOL_GPL(hidinput_calc_abs_res);
#ifdef CONFIG_HID_BATTERY_STRENGTH
static enum power_supply_property hidinput_battery_props[] = {
static const struct hid_device_id hid_battery_quirks[] = {
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE,
++++++ USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO),
++++++ HID_BATTERY_QUIRK_PERCENT | HID_BATTERY_QUIRK_FEATURE },
++++++ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE,
USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ANSI),
HID_BATTERY_QUIRK_PERCENT | HID_BATTERY_QUIRK_FEATURE },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE,
if (code <= 0xf)
code += BTN_JOYSTICK;
else
------ code += BTN_TRIGGER_HAPPY;
++++++ code += BTN_TRIGGER_HAPPY - 0x10;
++++++ break;
++++++ case HID_GD_GAMEPAD:
++++++ if (code <= 0xf)
++++++ code += BTN_GAMEPAD;
++++++ else
++++++ code += BTN_TRIGGER_HAPPY - 0x10;
break;
------ case HID_GD_GAMEPAD: code += BTN_GAMEPAD; break;
default:
switch (field->physical) {
case HID_GD_MOUSE:
}
}
++++++ static struct hid_input *hidinput_allocate(struct hid_device *hid)
++++++ {
++++++ struct hid_input *hidinput = kzalloc(sizeof(*hidinput), GFP_KERNEL);
++++++ struct input_dev *input_dev = input_allocate_device();
++++++ if (!hidinput || !input_dev) {
++++++ kfree(hidinput);
++++++ input_free_device(input_dev);
++++++ hid_err(hid, "Out of memory during hid input probe\n");
++++++ return NULL;
++++++ }
++++++
++++++ input_set_drvdata(input_dev, hid);
++++++ input_dev->event = hid->ll_driver->hidinput_input_event;
++++++ input_dev->open = hidinput_open;
++++++ input_dev->close = hidinput_close;
++++++ input_dev->setkeycode = hidinput_setkeycode;
++++++ input_dev->getkeycode = hidinput_getkeycode;
++++++
++++++ input_dev->name = hid->name;
++++++ input_dev->phys = hid->phys;
++++++ input_dev->uniq = hid->uniq;
++++++ input_dev->id.bustype = hid->bus;
++++++ input_dev->id.vendor = hid->vendor;
++++++ input_dev->id.product = hid->product;
++++++ input_dev->id.version = hid->version;
++++++ input_dev->dev.parent = hid->dev.parent;
++++++ hidinput->input = input_dev;
++++++ list_add_tail(&hidinput->list, &hid->inputs);
++++++
++++++ return hidinput;
++++++ }
++++++
/*
* Register the input device; print a message.
* Configure the input layer interface
struct hid_driver *drv = hid->driver;
struct hid_report *report;
struct hid_input *hidinput = NULL;
------ struct input_dev *input_dev;
int i, j, k;
INIT_LIST_HEAD(&hid->inputs);
continue;
if (!hidinput) {
------ hidinput = kzalloc(sizeof(*hidinput), GFP_KERNEL);
------ input_dev = input_allocate_device();
------ if (!hidinput || !input_dev) {
------ kfree(hidinput);
------ input_free_device(input_dev);
------ hid_err(hid, "Out of memory during hid input probe\n");
++++++ hidinput = hidinput_allocate(hid);
++++++ if (!hidinput)
goto out_unwind;
------ }
------
------ input_set_drvdata(input_dev, hid);
------ input_dev->event =
------ hid->ll_driver->hidinput_input_event;
------ input_dev->open = hidinput_open;
------ input_dev->close = hidinput_close;
------ input_dev->setkeycode = hidinput_setkeycode;
------ input_dev->getkeycode = hidinput_getkeycode;
------
------ input_dev->name = hid->name;
------ input_dev->phys = hid->phys;
------ input_dev->uniq = hid->uniq;
------ input_dev->id.bustype = hid->bus;
------ input_dev->id.vendor = hid->vendor;
------ input_dev->id.product = hid->product;
------ input_dev->id.version = hid->version;
------ input_dev->dev.parent = hid->dev.parent;
------ hidinput->input = input_dev;
------ list_add_tail(&hidinput->list, &hid->inputs);
}
for (i = 0; i < report->maxfield; i++)
void *priv;
};
----- -static int sensor_hub_check_for_sensor_page(struct hid_device *hdev)
----- -{
----- - int i;
----- - int ret = -EINVAL;
----- -
----- - for (i = 0; i < hdev->maxcollection; i++) {
----- - struct hid_collection *col = &hdev->collection[i];
----- - if (col->type == HID_COLLECTION_PHYSICAL &&
----- - (col->usage & HID_USAGE_PAGE) == HID_UP_SENSOR) {
----- - ret = 0;
----- - break;
----- - }
----- - }
----- -
----- - return ret;
----- -}
----- -
static struct hid_report *sensor_hub_report(int id, struct hid_device *hdev,
int dir)
{
ptr = raw_data;
ptr++; /*Skip report id*/
------ if (!report)
------ goto err_report;
------
spin_lock_irqsave(&pdata->lock, flags);
for (i = 0; i < report->maxfield; ++i) {
callback->pdev);
spin_unlock_irqrestore(&pdata->lock, flags);
------ err_report:
return 1;
}
hid_err(hdev, "parse failed\n");
goto err_free;
}
----- - if (sensor_hub_check_for_sensor_page(hdev) < 0) {
----- - hid_err(hdev, "sensor page not found\n");
----- - goto err_free;
----- - }
INIT_LIST_HEAD(&hdev->inputs);
ret = hid_hw_start(hdev, 0);
}
static const struct hid_device_id sensor_hub_devices[] = {
----- - { HID_USB_DEVICE(USB_VENDOR_ID_INTEL_8086,
----- - USB_DEVICE_ID_SENSOR_HUB_1020) },
----- - { HID_USB_DEVICE(USB_VENDOR_ID_INTEL_8087,
----- - USB_DEVICE_ID_SENSOR_HUB_1020) },
----- - { HID_USB_DEVICE(USB_VENDOR_ID_INTEL_8086,
----- - USB_DEVICE_ID_SENSOR_HUB_09FA) },
----- - { HID_USB_DEVICE(USB_VENDOR_ID_INTEL_8087,
----- - USB_DEVICE_ID_SENSOR_HUB_09FA) },
----- - { HID_USB_DEVICE(USB_VENDOR_ID_STANTUM_STM,
----- - USB_DEVICE_ID_SENSOR_HUB_7014) },
+++++ + { HID_DEVICE(BUS_USB, HID_GROUP_SENSOR_HUB, HID_ANY_ID, HID_ANY_ID) },
{ }
};
MODULE_DEVICE_TABLE(hid, sensor_hub_devices);
{ USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET },
{ USB_VENDOR_ID_FREESCALE, USB_DEVICE_ID_FREESCALE_MX28, HID_QUIRK_NOGET },
{ USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_NOGET },
++++++ { USB_VENDOR_ID_NOVATEK, USB_DEVICE_ID_NOVATEK_MOUSE, HID_QUIRK_NO_INIT_REPORTS },
{ USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN, HID_QUIRK_NO_INIT_REPORTS },
{ USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN1, HID_QUIRK_NO_INIT_REPORTS },
{ USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN2, HID_QUIRK_NO_INIT_REPORTS },
{ USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3001, HID_QUIRK_NOGET },
{ USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH_3008, HID_QUIRK_NOGET },
{ USB_VENDOR_ID_SENNHEISER, USB_DEVICE_ID_SENNHEISER_BTD500USB, HID_QUIRK_NOGET },
++++++ { USB_VENDOR_ID_SIGMATEL, USB_DEVICE_ID_SIGMATEL_STMP3780, HID_QUIRK_NOGET },
{ USB_VENDOR_ID_SUN, USB_DEVICE_ID_RARITAN_KVM_DONGLE, HID_QUIRK_NOGET },
{ USB_VENDOR_ID_SYMBOL, USB_DEVICE_ID_SYMBOL_SCANNER_1, HID_QUIRK_NOGET },
{ USB_VENDOR_ID_SYMBOL, USB_DEVICE_ID_SYMBOL_SCANNER_2, HID_QUIRK_NOGET },
++++++ { USB_VENDOR_ID_TPV, USB_DEVICE_ID_TPV_OPTICAL_TOUCHSCREEN, HID_QUIRK_NOGET },
{ USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_KEYBOARD, HID_QUIRK_NOGET },
{ USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_PF1209, HID_QUIRK_MULTI_INPUT },
{ USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_WP4030U, HID_QUIRK_MULTI_INPUT },
- - -#ifndef __HID_H
- - -#define __HID_H
- - -
/*
* Copyright (c) 1999 Andreas Gal
* Copyright (c) 2000-2001 Vojtech Pavlik
* Copyright (c) 2006-2007 Jiri Kosina
*/
- - -
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
*/
+ + +#ifndef __HID_H
+ + +#define __HID_H
- - -/*
- - - * USB HID (Human Interface Device) interface class code
- - - */
- - -
- - -#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
- - - */
- - -
- - -#define HID_REQ_GET_REPORT 0x01
- - -#define HID_REQ_GET_IDLE 0x02
- - -#define HID_REQ_GET_PROTOCOL 0x03
- - -#define HID_REQ_SET_REPORT 0x09
- - -#define HID_REQ_SET_IDLE 0x0A
- - -#define HID_REQ_SET_PROTOCOL 0x0B
- - -
- - -/*
- - - * HID class descriptor types
- - - */
- - -
- - -#define HID_DT_HID (USB_TYPE_CLASS | 0x01)
- - -#define HID_DT_REPORT (USB_TYPE_CLASS | 0x02)
- - -#define HID_DT_PHYSICAL (USB_TYPE_CLASS | 0x03)
- - -
- - -#define HID_MAX_DESCRIPTOR_SIZE 4096
- - -
- - -#ifdef __KERNEL__
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/input.h>
#include <linux/semaphore.h>
#include <linux/power_supply.h>
+ + +#include <uapi/linux/hid.h>
/*
* We parse each description item into this structure. Short items data
#define HID_UP_MSVENDOR 0xff000000
#define HID_UP_CUSTOM 0x00ff0000
#define HID_UP_LOGIVENDOR 0xffbc0000
+++++ +#define HID_UP_SENSOR 0x00200000
#define HID_USAGE 0x0000ffff
*/
#define HID_GROUP_GENERIC 0x0001
#define HID_GROUP_MULTITOUCH 0x0002
+++++ +#define HID_GROUP_SENSOR_HUB 0x0003
/*
* This is the global environment of the parser. This information is
struct hid_usage {
unsigned hid; /* hid usage code */
unsigned collection_index; /* index into collection array */
+++ +++ unsigned usage_index; /* index into usage array */
/* hidinput data */
__u16 code; /* input driver code */
__u8 type; /* input driver type */
extern int hid_debug;
++++++ extern bool hid_ignore(struct hid_device *);
extern int hid_add_device(struct hid_device *);
extern void hid_destroy_device(struct hid_device *);
int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field);
struct hid_field *hidinput_get_led_field(struct hid_device *hid);
unsigned int hidinput_count_leds(struct hid_device *hid);
+++ +++__s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code);
void hid_output_report(struct hid_report *report, __u8 *data);
struct hid_device *hid_allocate_device(void);
struct hid_report *hid_register_report(struct hid_device *device, unsigned type, unsigned id);
void hid_disconnect(struct hid_device *hid);
const struct hid_device_id *hid_match_id(struct hid_device *hdev,
const struct hid_device_id *id);
+++ +++s32 hid_snto32(__u32 value, unsigned n);
/**
* hid_map_usage - map usage input bits
#define hid_dbg(hid, fmt, arg...) \
dev_dbg(&(hid)->dev, fmt, ##arg)
- - -#endif /* __KERNEL__ */
- - -
#endif
- - -