Commit f9b9f9c6 authored by Vojtech Pavlik's avatar Vojtech Pavlik

input: HID update

	- Fix a bad #define for HID_QUIRK_BADPAD
	- Set absfuzz and absflat for joysticks/gamepads only
	- Add TangTop quirk
parent 7bf1da72
......@@ -1327,6 +1327,9 @@ void hid_init_reports(struct hid_device *hid)
#define USB_VENDOR_ID_ONTRAK 0x0a07
#define USB_DEVICE_ID_ONTRAK_ADU100 0x0064
#define USB_VENDOR_ID_TANGTOP 0x0d3d
#define USB_DEVICE_ID_TANGTOP_USBPS2 0x0001
struct hid_blacklist {
__u16 idVendor;
__u16 idProduct;
......@@ -1368,6 +1371,7 @@ struct hid_blacklist {
{ USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 300, HID_QUIRK_IGNORE },
{ USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 400, HID_QUIRK_IGNORE },
{ USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 500, HID_QUIRK_IGNORE },
{ USB_VENDOR_ID_TANGTOP, USB_DEVICE_ID_TANGTOP_USBPS2, HID_QUIRK_NOGET },
{ 0, 0 }
};
......@@ -1533,6 +1537,8 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf)
kfree(buf);
hid->urbctrl = usb_alloc_urb(0, GFP_KERNEL);
if (!hid->urbctrl)
goto fail;
usb_fill_control_urb(hid->urbctrl, dev, 0, (void *) hid->cr,
hid->ctrlbuf, 1, hid_ctrl, hid);
hid->urbctrl->setup_dma = hid->cr_dma;
......
......@@ -364,9 +364,14 @@ static void hidinput_configure_usage(struct hid_device *device, struct hid_field
input->absmin[usage->code] = a;
input->absmax[usage->code] = b;
input->absfuzz[usage->code] = 0;
input->absflat[usage->code] = 0;
if (field->application == HID_GD_GAMEPAD || field->application == HID_GD_JOYSTICK) {
input->absfuzz[usage->code] = (b - a) >> 8;
input->absflat[usage->code] = (b - a) >> 4;
}
}
if (usage->hat_min != usage->hat_max) {
int i;
......
......@@ -206,7 +206,7 @@ struct hid_item {
#define HID_QUIRK_IGNORE 0x04
#define HID_QUIRK_NOGET 0x08
#define HID_QUIRK_HIDDEV 0x10
#define HID_QUIRK_BADPAD 0x12
#define HID_QUIRK_BADPAD 0x20
/*
* This is the global enviroment of the parser. This information is
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment