Skip to content

Commit

Permalink
Merge branches 'upstream' and 'upstream-fixes' into for-linus
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiri Kosina committed Oct 23, 2010
3 parents 35da7a3 + 569b10a + cb17468 commit c3d9d74
Show file tree
Hide file tree
Showing 13 changed files with 174 additions and 98 deletions.
60 changes: 30 additions & 30 deletions drivers/hid/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -56,28 +56,28 @@ menu "Special HID drivers"
depends on HID

config HID_3M_PCT
tristate "3M PCT"
tristate "3M PCT touchscreen"
depends on USB_HID
---help---
Support for 3M PCT touch screens.

config HID_A4TECH
tristate "A4 tech" if EMBEDDED
tristate "A4 tech mice" if EMBEDDED
depends on USB_HID
default !EMBEDDED
---help---
Support for A4 tech X5 and WOP-35 / Trust 450L mice.

config HID_ACRUX_FF
tristate "ACRUX force feedback support"
tristate "ACRUX force feedback"
depends on USB_HID
select INPUT_FF_MEMLESS
---help---
Say Y here if you want to enable force feedback support for ACRUX
game controllers.

config HID_APPLE
tristate "Apple" if EMBEDDED
tristate "Apple {i,Power,Mac}Books" if EMBEDDED
depends on (USB_HID || BT_HIDP)
default !EMBEDDED
---help---
Expand All @@ -88,7 +88,7 @@ config HID_APPLE
MacBooks, MacBook Pros and Apple Aluminum.

config HID_BELKIN
tristate "Belkin" if EMBEDDED
tristate "Belkin Flip KVM and Wireless keyboard" if EMBEDDED
depends on USB_HID
default !EMBEDDED
---help---
Expand All @@ -101,14 +101,14 @@ config HID_CANDO
Support for Cando dual touch panel.

config HID_CHERRY
tristate "Cherry" if EMBEDDED
tristate "Cherry Cymotion keyboard" if EMBEDDED
depends on USB_HID
default !EMBEDDED
---help---
Support for Cherry Cymotion keyboard.

config HID_CHICONY
tristate "Chicony" if EMBEDDED
tristate "Chicony Tactical pad" if EMBEDDED
depends on USB_HID
default !EMBEDDED
---help---
Expand All @@ -130,20 +130,20 @@ config HID_PRODIKEYS
and some additional multimedia keys.

config HID_CYPRESS
tristate "Cypress" if EMBEDDED
tristate "Cypress mouse and barcode readers" if EMBEDDED
depends on USB_HID
default !EMBEDDED
---help---
Support for cypress mouse and barcode readers.

config HID_DRAGONRISE
tristate "DragonRise Inc. support"
tristate "DragonRise Inc. game controller"
depends on USB_HID
---help---
Say Y here if you have DragonRise Inc.game controllers.

config DRAGONRISE_FF
bool "DragonRise Inc. force feedback support"
bool "DragonRise Inc. force feedback"
depends on HID_DRAGONRISE
select INPUT_FF_MEMLESS
---help---
Expand All @@ -157,46 +157,46 @@ config HID_EGALAX
Support for the eGalax dual-touch panel.

config HID_ELECOM
tristate "ELECOM"
tristate "ELECOM BM084 bluetooth mouse"
depends on BT_HIDP
---help---
Support for the ELECOM BM084 (bluetooth mouse).

config HID_EZKEY
tristate "Ezkey" if EMBEDDED
tristate "Ezkey BTC 8193 keyboard" if EMBEDDED
depends on USB_HID
default !EMBEDDED
---help---
Support for Ezkey BTC 8193 keyboard.

config HID_KYE
tristate "Kye" if EMBEDDED
tristate "Kye/Genius Ergo Mouse" if EMBEDDED
depends on USB_HID
default !EMBEDDED
---help---
Support for Kye/Genius Ergo Mouse.

config HID_GYRATION
tristate "Gyration"
tristate "Gyration remote control"
depends on USB_HID
---help---
Support for Gyration remote control.

config HID_TWINHAN
tristate "Twinhan"
tristate "Twinhan IR remote control"
depends on USB_HID
---help---
Support for Twinhan IR remote control.

config HID_KENSINGTON
tristate "Kensington" if EMBEDDED
tristate "Kensington Slimblade Trackball" if EMBEDDED
depends on USB_HID
default !EMBEDDED
---help---
Support for Kensington Slimblade Trackball.

config HID_LOGITECH
tristate "Logitech" if EMBEDDED
tristate "Logitech devices" if EMBEDDED
depends on USB_HID
default !EMBEDDED
---help---
Expand Down Expand Up @@ -245,39 +245,39 @@ config HID_MAGICMOUSE
Apple Wireless "Magic" Mouse.

config HID_MICROSOFT
tristate "Microsoft" if EMBEDDED
tristate "Microsoft non-fully HID-compliant devices" if EMBEDDED
depends on USB_HID
default !EMBEDDED
---help---
Support for Microsoft devices that are not fully compliant with HID standard.

config HID_MOSART
tristate "MosArt"
tristate "MosArt dual-touch panels"
depends on USB_HID
---help---
Support for MosArt dual-touch panels.

config HID_MONTEREY
tristate "Monterey" if EMBEDDED
tristate "Monterey Genius KB29E keyboard" if EMBEDDED
depends on USB_HID
default !EMBEDDED
---help---
Support for Monterey Genius KB29E.

config HID_NTRIG
tristate "NTrig"
tristate "N-Trig touch screen"
depends on USB_HID
---help---
Support for N-Trig touch screen.

config HID_ORTEK
tristate "Ortek"
tristate "Ortek WKB-2000 wireless keyboard and mouse trackpad"
depends on USB_HID
---help---
Support for Ortek WKB-2000 wireless keyboard + mouse trackpad.

config HID_PANTHERLORD
tristate "Pantherlord support"
tristate "Pantherlord/GreenAsia game controller"
depends on USB_HID
---help---
Say Y here if you have a PantherLord/GreenAsia based game controller
Expand All @@ -292,7 +292,7 @@ config PANTHERLORD_FF
or adapter and want to enable force feedback support for it.

config HID_PETALYNX
tristate "Petalynx"
tristate "Petalynx Maxter remote control"
depends on USB_HID
---help---
Support for Petalynx Maxter remote control.
Expand Down Expand Up @@ -356,7 +356,7 @@ config HID_PICOLCD_LEDS
Provide access to PicoLCD's GPO pins via leds class.

config HID_QUANTA
tristate "Quanta Optical Touch"
tristate "Quanta Optical Touch panels"
depends on USB_HID
---help---
Support for Quanta Optical Touch dual-touch panels.
Expand All @@ -377,31 +377,31 @@ config HID_ROCCAT_KONE
Support for Roccat Kone mouse.

config HID_SAMSUNG
tristate "Samsung"
tristate "Samsung InfraRed remote control or keyboards"
depends on USB_HID
---help---
Support for Samsung InfraRed remote control or keyboards.

config HID_SONY
tristate "Sony"
tristate "Sony PS3 controller"
depends on USB_HID
---help---
Support for Sony PS3 controller.

config HID_STANTUM
tristate "Stantum"
tristate "Stantum multitouch panel"
depends on USB_HID
---help---
Support for Stantum multitouch panel.

config HID_SUNPLUS
tristate "Sunplus"
tristate "Sunplus wireless desktop"
depends on USB_HID
---help---
Support for Sunplus wireless desktop.

config HID_GREENASIA
tristate "GreenAsia (Product ID 0x12) support"
tristate "GreenAsia (Product ID 0x12) game controller support"
depends on USB_HID
---help---
Say Y here if you have a GreenAsia (Product ID 0x12) based game
Expand Down
2 changes: 2 additions & 0 deletions drivers/hid/hid-a4tech.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ static const struct hid_device_id a4_devices[] = {
.driver_data = A4_2WHEEL_MOUSE_HACK_7 },
{ HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_X5_005D),
.driver_data = A4_2WHEEL_MOUSE_HACK_B8 },
{ HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_RP_649),
.driver_data = A4_2WHEEL_MOUSE_HACK_B8 },
{ }
};
MODULE_DEVICE_TABLE(hid, a4_devices);
Expand Down
3 changes: 3 additions & 0 deletions drivers/hid/hid-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1241,6 +1241,7 @@ static const struct hid_device_id hid_blacklist[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_3M, USB_DEVICE_ID_3M2256) },
{ HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU) },
{ HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_X5_005D) },
{ HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_RP_649) },
#if defined(CONFIG_HID_ACRUX_FF) || defined(CONFIG_HID_ACRUX_FF_MODULE)
{ HID_USB_DEVICE(USB_VENDOR_ID_ACRUX, 0x0802) },
#endif
Expand Down Expand Up @@ -1377,6 +1378,8 @@ static const struct hid_device_id hid_blacklist[] = {
{ 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_STANTUM, USB_DEVICE_ID_MTP) },
{ HID_USB_DEVICE(USB_VENDOR_ID_STANTUM_STM, USB_DEVICE_ID_MTP_STM) },
{ HID_USB_DEVICE(USB_VENDOR_ID_STANTUM_SITRONIX, USB_DEVICE_ID_MTP_SITRONIX) },
{ HID_USB_DEVICE(USB_VENDOR_ID_SUNPLUS, USB_DEVICE_ID_SUNPLUS_WDESKTOP) },
{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb300) },
{ HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb304) },
Expand Down
2 changes: 2 additions & 0 deletions drivers/hid/hid-debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,8 @@ void hid_debug_event(struct hid_device *hdev, char *buf)
buf[i];
list->tail = (list->tail + i) % HID_DEBUG_BUFSIZE;
}

wake_up_interruptible(&hdev->debug_wait);
}
EXPORT_SYMBOL_GPL(hid_debug_event);

Expand Down
8 changes: 8 additions & 0 deletions drivers/hid/hid-ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#define USB_VENDOR_ID_A4TECH 0x09da
#define USB_DEVICE_ID_A4TECH_WCP32PU 0x0006
#define USB_DEVICE_ID_A4TECH_X5_005D 0x000a
#define USB_DEVICE_ID_A4TECH_RP_649 0x001a

#define USB_VENDOR_ID_AASHIMA 0x06d6
#define USB_DEVICE_ID_AASHIMA_GAMEPAD 0x0025
Expand Down Expand Up @@ -142,6 +143,7 @@
#define USB_DEVICE_ID_CH_FLIGHT_SIM_ECLIPSE_YOKE 0x0051
#define USB_DEVICE_ID_CH_FLIGHT_SIM_YOKE 0x00ff
#define USB_DEVICE_ID_CH_3AXIS_5BUTTON_STICK 0x00d3
#define USB_DEVICE_ID_CH_AXIS_295 0x001c

#define USB_VENDOR_ID_CHERRY 0x046a
#define USB_DEVICE_ID_CHERRY_CYMOTION 0x0023
Expand Down Expand Up @@ -485,6 +487,12 @@
#define USB_VENDOR_ID_STANTUM 0x1f87
#define USB_DEVICE_ID_MTP 0x0002

#define USB_VENDOR_ID_STANTUM_STM 0x0483
#define USB_DEVICE_ID_MTP_STM 0x3261

#define USB_VENDOR_ID_STANTUM_SITRONIX 0x1403
#define USB_DEVICE_ID_MTP_SITRONIX 0x5001

#define USB_VENDOR_ID_SUN 0x0430
#define USB_DEVICE_ID_RARITAN_KVM_DONGLE 0xcdab

Expand Down
80 changes: 80 additions & 0 deletions drivers/hid/hid-input.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,83 @@ static int hidinput_setkeycode(struct input_dev *dev,
}


/**
* hidinput_calc_abs_res - calculate an absolute axis resolution
* @field: the HID report field to calculate resolution for
* @code: axis code
*
* The formula is:
* (logical_maximum - logical_minimum)
* resolution = ----------------------------------------------------------
* (physical_maximum - physical_minimum) * 10 ^ unit_exponent
*
* 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
* inches. Degrees are converted to radians.
*/
static __s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code)
{
__s32 unit_exponent = field->unit_exponent;
__s32 logical_extents = field->logical_maximum -
field->logical_minimum;
__s32 physical_extents = field->physical_maximum -
field->physical_minimum;
__s32 prev;

/* Check if the extents are sane */
if (logical_extents <= 0 || physical_extents <= 0)
return 0;

/*
* Verify and convert units.
* See HID specification v1.11 6.2.2.7 Global Items for unit decoding
*/
if (code == ABS_X || code == ABS_Y || code == ABS_Z) {
if (field->unit == 0x11) { /* If centimeters */
/* Convert to inches */
prev = logical_extents;
logical_extents *= 254;
if (logical_extents < prev)
return 0;
unit_exponent += 2;
} else if (field->unit != 0x13) { /* If not inches */
return 0;
}
} else if (code == ABS_RX || code == ABS_RY || code == ABS_RZ) {
if (field->unit == 0x14) { /* If degrees */
/* Convert to radians */
prev = logical_extents;
logical_extents *= 573;
if (logical_extents < prev)
return 0;
unit_exponent += 1;
} else if (field->unit != 0x12) { /* If not radians */
return 0;
}
} else {
return 0;
}

/* Apply negative unit exponent */
for (; unit_exponent < 0; unit_exponent++) {
prev = logical_extents;
logical_extents *= 10;
if (logical_extents < prev)
return 0;
}
/* Apply positive unit exponent */
for (; unit_exponent > 0; unit_exponent--) {
prev = physical_extents;
physical_extents *= 10;
if (physical_extents < prev)
return 0;
}

/* Calculate resolution */
return logical_extents / physical_extents;
}

static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_field *field,
struct hid_usage *usage)
{
Expand Down Expand Up @@ -537,6 +614,9 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
input_set_abs_params(input, usage->code, a, b, (b - a) >> 8, (b - a) >> 4);
else input_set_abs_params(input, usage->code, a, b, 0, 0);

input_abs_set_res(input, usage->code,
hidinput_calc_abs_res(field, usage->code));

/* use a larger default input buffer for MT devices */
if (usage->code == ABS_MT_POSITION_X && input->hint_events_per_packet == 0)
input_set_events_per_packet(input, 60);
Expand Down
Loading

0 comments on commit c3d9d74

Please sign in to comment.