mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-28 17:41:50 +00:00
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: HID: length resolution should be reported units/mm HID: add support for F430 Force Feedback Wheel HID: egalax: Use kzalloc HID: Remove KERN_DEBUG from dbg_hid use Manually fixed trivial conflict in drivers/hid/hid-input.c (due to removal of KERN_DEBUG from dbg_hid use clashing with new keycode interface switch)
This commit is contained in:
commit
59e57c622c
4 changed files with 16 additions and 10 deletions
|
@ -1386,6 +1386,7 @@ static const struct hid_device_id hid_blacklist[] = {
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb651) },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb651) },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb653) },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb653) },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb654) },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb654) },
|
||||||
|
{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb65a) },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED, USB_DEVICE_ID_TOPSEED_CYBERLINK) },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED, USB_DEVICE_ID_TOPSEED_CYBERLINK) },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED2, USB_DEVICE_ID_TOPSEED2_RF_COMBO) },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED2, USB_DEVICE_ID_TOPSEED2_RF_COMBO) },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_TWINHAN, USB_DEVICE_ID_TWINHAN_IR_REMOTE) },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_TWINHAN, USB_DEVICE_ID_TWINHAN_IR_REMOTE) },
|
||||||
|
|
|
@ -221,7 +221,7 @@ static int egalax_probe(struct hid_device *hdev, const struct hid_device_id *id)
|
||||||
struct egalax_data *td;
|
struct egalax_data *td;
|
||||||
struct hid_report *report;
|
struct hid_report *report;
|
||||||
|
|
||||||
td = kmalloc(sizeof(struct egalax_data), GFP_KERNEL);
|
td = kzalloc(sizeof(struct egalax_data), GFP_KERNEL);
|
||||||
if (!td) {
|
if (!td) {
|
||||||
dev_err(&hdev->dev, "cannot allocate eGalax data\n");
|
dev_err(&hdev->dev, "cannot allocate eGalax data\n");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
|
@ -174,7 +174,7 @@ static int hidinput_setkeycode(struct input_dev *dev,
|
||||||
|
|
||||||
clear_bit(*old_keycode, dev->keybit);
|
clear_bit(*old_keycode, dev->keybit);
|
||||||
set_bit(usage->code, dev->keybit);
|
set_bit(usage->code, dev->keybit);
|
||||||
dbg_hid(KERN_DEBUG "Assigned keycode %d to HID usage code %x\n",
|
dbg_hid("Assigned keycode %d to HID usage code %x\n",
|
||||||
usage->code, usage->hid);
|
usage->code, usage->hid);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -203,8 +203,8 @@ static int hidinput_setkeycode(struct input_dev *dev,
|
||||||
*
|
*
|
||||||
* as seen in the HID specification v1.11 6.2.2.7 Global Items.
|
* as seen in the HID specification v1.11 6.2.2.7 Global Items.
|
||||||
*
|
*
|
||||||
* Only exponent 1 length units are processed. Centimeters are converted to
|
* Only exponent 1 length units are processed. Centimeters and inches are
|
||||||
* inches. Degrees are converted to radians.
|
* converted to millimeters. Degrees are converted to radians.
|
||||||
*/
|
*/
|
||||||
static __s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code)
|
static __s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code)
|
||||||
{
|
{
|
||||||
|
@ -225,13 +225,16 @@ static __s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code)
|
||||||
*/
|
*/
|
||||||
if (code == ABS_X || code == ABS_Y || code == ABS_Z) {
|
if (code == ABS_X || code == ABS_Y || code == ABS_Z) {
|
||||||
if (field->unit == 0x11) { /* If centimeters */
|
if (field->unit == 0x11) { /* If centimeters */
|
||||||
/* Convert to inches */
|
/* Convert to millimeters */
|
||||||
prev = logical_extents;
|
unit_exponent += 1;
|
||||||
logical_extents *= 254;
|
} else if (field->unit == 0x13) { /* If inches */
|
||||||
if (logical_extents < prev)
|
/* Convert to millimeters */
|
||||||
|
prev = physical_extents;
|
||||||
|
physical_extents *= 254;
|
||||||
|
if (physical_extents < prev)
|
||||||
return 0;
|
return 0;
|
||||||
unit_exponent += 2;
|
unit_exponent -= 1;
|
||||||
} else if (field->unit != 0x13) { /* If not inches */
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
} else if (code == ABS_RX || code == ABS_RY || code == ABS_RZ) {
|
} else if (code == ABS_RX || code == ABS_RY || code == ABS_RZ) {
|
||||||
|
|
|
@ -256,6 +256,8 @@ static const struct hid_device_id tm_devices[] = {
|
||||||
.driver_data = (unsigned long)ff_joystick },
|
.driver_data = (unsigned long)ff_joystick },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb654), /* FGT Force Feedback Wheel */
|
{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb654), /* FGT Force Feedback Wheel */
|
||||||
.driver_data = (unsigned long)ff_joystick },
|
.driver_data = (unsigned long)ff_joystick },
|
||||||
|
{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb65a), /* F430 Force Feedback Wheel */
|
||||||
|
.driver_data = (unsigned long)ff_joystick },
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
MODULE_DEVICE_TABLE(hid, tm_devices);
|
MODULE_DEVICE_TABLE(hid, tm_devices);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue