linux/drivers/hid
Mauro Carvalho Chehab e57a67da60 HID: hid-sony: fix troubles with Sony remote clones
There are some Sony clone gamepads that are incompatible
with PS3 since firmware 3.50, as they decided to prevent those
devices to work, without any good technical reason. I was one of those
'blessed' people affected by their niceness with their customers.

Marcelo also has another device with a similar problem.

Perhaps due to Sony's way to block the device, damaging the device's
eeprom, or perhaps because they just have a different, broken Report
descriptor, there are 3 buttons that don't work on both devices
(the ones equivalent to square, round and X).

What it happens is that the descriptor generate weird EV_ABS events
to those buttons, instead of EV_MSC/EV_KEY.

A fix that seems to be enough for them is to return the original
sixaxis table instead of the broken one. That's what this patch
does.

Yet, there are some missing entries at the used keytable. On my
tests, all keys are now producing the right events, but the reported
keycodes look weird:

"square" key: (Button.0010 = 1)

1355524363.460835: event type EV_MSC(0x04): scancode = 0x90010
1355524363.460835: event type EV_KEY(0x01) key_up: BTN_DEAD(0x0001)

"round" key: (Button.000e = 1)

1355524410.908705: event type EV_MSC(0x04): scancode = 0x9000e
1355524410.908705: event type EV_KEY(0x01) key_down: (0x0001)
1355524410.971788: event type EV_MSC(0x04): scancode = 0x9000e
1355524410.971788: event type EV_KEY(0x01) key_up: (0x0001)

"X" key: (Button.000f = 1)
1355524384.880813: event type EV_MSC(0x04): scancode = 0x9000f
1355524384.880813: event type EV_KEY(0x01) key_down: (0x0001)
1355524384.979815: event type EV_MSC(0x04): scancode = 0x9000f
1355524384.979815: event type EV_KEY(0x01) key_up: (0x0001)

The rationale is likely due to those entries at rdesc table, where the
Kernel were not likely able to parse:

Button.000d ---> Key.?
Button.000e ---> Key.?
Button.000f ---> Key.?
Button.0010 ---> Key.BtnDead
Button.0011 ---> Key.?
Button.0012 ---> Key.?
Button.0013 ---> Key.?

As a reference, this is the rdisc used on my clone (a Mad Catz
model 8846):

05 01 09 04 a1 01 a1 02 85 01 75 08 95 01 15 00 26 ff 00 81 03 75 01 95 0d 15 00 25 01 35 00 45 01 05 09 19 01 29 0d 81 02 75 01 95 03 06 00 ff 81 03 05 01 25 07 46 3b 01 75 04 95 01 65 14 09 39 81 42 65 00 75 01 95 0c 06 00 ff 81 03 15 00 26 ff 00 05 01 09 01 a1 00 75 08 95 04 15 00 15 00 15 00 35 00 35 00 46 ff 00 09 30 09 31 09 32 09 35 81 02 c0 05 01 75 08 95 27 09 01 81 02 75 08 95 30 09 01 91 02 75 08 95 30 09 01 b1 02 c0 a1 02 85 02 75 08 95 30 09 01 b1 02 c0 a1 02 85 ee 75 08 95 30 09 01 b1 02 c0 a1 02 85 ef 75 08 95 30 09 01 b1 02 c0 c0

This is what's returned on Marcelo's device (not sure what is
the brand name of his device):

05 01 09 04 a1 01 a1 02 85 01 75 08 95 01 15 00 26 ff 00 81 03 75 01 95 13 15 00 25 01 35 00 45 01 05 09 19 01 29 13 81 02 75 01 95 0d 06 00 ff 81 03 15 00 26 ff 00 05 01 09 01 a1 00 75 08 95 04 35 00 46 ff 00 09 30 09 31 09 32 09 35 81 02 c0 05 01 95 13 09 01 81 02 95 0c 81 01 75 10 95 04 26 ff 03 46 ff 03 09 01 81 02 c0 a1 02 85 02 75 08 95 30 09 01 b1 02 c0 a1 02 85 ee 75 08 95 30 09 01 b1 02 c0 a1 02 85 ef 75 08 95 30 09 01 b1 02 c0 c0

Reported-by: Marcelo Leitner <mleitner@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Tested-by: Marcelo Leitner <mleitner@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-01-03 10:47:58 +01:00
..
i2c-hid HID: i2c-hid: add mutex protecting open/close race 2012-12-12 18:26:22 +01:00
usbhid Merge branches 'for-3.7/upstream-fixes', 'for-3.8/hidraw', 'for-3.8/i2c-hid', 'for-3.8/multitouch', 'for-3.8/roccat', 'for-3.8/sensors' and 'for-3.8/upstream' into for-linus 2012-12-12 21:41:55 +01:00
Kconfig Merge branches 'for-3.7/upstream-fixes', 'for-3.8/hidraw', 'for-3.8/i2c-hid', 'for-3.8/multitouch', 'for-3.8/roccat', 'for-3.8/sensors' and 'for-3.8/upstream' into for-linus 2012-12-12 21:41:55 +01:00
Makefile Merge branches 'for-3.7/upstream-fixes', 'for-3.8/hidraw', 'for-3.8/i2c-hid', 'for-3.8/multitouch', 'for-3.8/roccat', 'for-3.8/sensors' and 'for-3.8/upstream' into for-linus 2012-12-12 21:41:55 +01:00
hid-a4tech.c HID: remove Paul Walmsley's copyright from places where it shouldn't be 2012-09-05 10:46:36 +02:00
hid-apple.c Merge branches 'for-3.7/upstream-fixes', 'for-3.8/hidraw', 'for-3.8/i2c-hid', 'for-3.8/multitouch', 'for-3.8/roccat', 'for-3.8/sensors' and 'for-3.8/upstream' into for-linus 2012-12-12 21:41:55 +01:00
hid-aureal.c HID: remove Paul Walmsley's copyright from places where it shouldn't be 2012-09-05 10:46:36 +02:00
hid-axff.c hid: Add module.h to fix up implicit users of it 2011-10-31 19:31:17 -04:00
hid-belkin.c HID: remove Paul Walmsley's copyright from places where it shouldn't be 2012-09-05 10:46:36 +02:00
hid-cherry.c HID: remove Paul Walmsley's copyright from places where it shouldn't be 2012-09-05 10:46:36 +02:00
hid-chicony.c HID: add ASUS AIO keyboard model AK1D 2012-07-23 12:10:21 +02:00
hid-core.c Merge branches 'for-3.7/upstream-fixes', 'for-3.8/hidraw', 'for-3.8/i2c-hid', 'for-3.8/multitouch', 'for-3.8/roccat', 'for-3.8/sensors' and 'for-3.8/upstream' into for-linus 2012-12-12 21:41:55 +01:00
hid-cypress.c HID: remove Paul Walmsley's copyright from places where it shouldn't be 2012-09-05 10:46:36 +02:00
hid-debug.c HID: hid-debug: Show rdesc for unclaimed devices 2012-08-27 08:01:21 -07:00
hid-dr.c hid: Add module.h to fix up implicit users of it 2011-10-31 19:31:17 -04:00
hid-elecom.c HID: Add and use hid_<level>: dev_<level> equivalents 2010-12-10 15:10:38 +01:00
hid-emsff.c Merge branches 'hyperv', 'multitouch', 'roccat', 'upstream', 'upstream-fixes', 'wacom' and 'wiimote' into for-linus 2012-01-05 15:51:02 +01:00
hid-ezkey.c HID: remove Paul Walmsley's copyright from places where it shouldn't be 2012-09-05 10:46:36 +02:00
hid-gaff.c hid: Add module.h to fix up implicit users of it 2011-10-31 19:31:17 -04:00
hid-generic.c HID: Create a common generic driver 2012-05-01 12:54:55 +02:00
hid-gyration.c HID: remove Paul Walmsley's copyright from places where it shouldn't be 2012-09-05 10:46:36 +02:00
hid-holtek-kbd.c HID: Add driver for Holtek based keyboards with broken HID 2012-07-12 12:34:43 +02:00
hid-holtekff.c HID: holtekff: use %*ph to dump small buffers 2012-09-10 23:00:32 +02:00
hid-hyperv.c HID: hyperv: Set the hid drvdata correctly 2012-05-17 10:01:07 +02:00
hid-icade.c HID: Add driver for ION iCade 2012-10-31 15:52:59 +01:00
hid-ids.h Merge branches 'for-3.7/upstream-fixes', 'for-3.8/hidraw', 'for-3.8/i2c-hid', 'for-3.8/multitouch', 'for-3.8/roccat', 'for-3.8/sensors' and 'for-3.8/upstream' into for-linus 2012-12-12 21:41:55 +01:00
hid-input.c Merge branches 'for-3.7/upstream-fixes', 'for-3.8/hidraw', 'for-3.8/i2c-hid', 'for-3.8/multitouch', 'for-3.8/roccat', 'for-3.8/sensors' and 'for-3.8/upstream' into for-linus 2012-12-12 21:41:55 +01:00
hid-kensington.c HID: adding __init/__exit macros to module init/exit functions 2009-07-23 01:28:01 +02:00
hid-keytouch.c HID: add support for Keytouch IEC 60945 2011-02-17 15:12:45 +01:00
hid-kye.c HID: kye: Add support for 3 tablets 2012-02-28 13:37:12 +01:00
hid-lcpower.c HID: hid-lcpower: Use HID_UP_LOGIVENDOR instead of hard coded 0x0ffbc0000 2012-09-05 11:55:35 +02:00
hid-lenovo-tpkbd.c Merge branch 'upstream' into for-linus 2012-10-01 14:37:51 +02:00
hid-lg.c Merge branch 'upstream' into for-linus 2012-10-01 14:37:51 +02:00
hid-lg.h HID: hid-lg4ff: Adjust X axis input value accordingly to selected range. 2012-09-25 15:41:02 +02:00
hid-lg2ff.c HID: Add and use hid_<level>: dev_<level> equivalents 2010-12-10 15:10:38 +01:00
hid-lg3ff.c HID: Add and use hid_<level>: dev_<level> equivalents 2010-12-10 15:10:38 +01:00
hid-lg4ff.c Merge branch 'upstream' into for-linus 2012-10-01 14:37:51 +02:00
hid-lgff.c HID: lg4ff - Move handling of Logitech wheels to lg4ff driver 2011-08-04 16:45:55 +02:00
hid-logitech-dj.c HID: Fix logitech-dj: missing Unifying device issue 2012-09-22 10:58:48 +02:00
hid-logitech-dj.h HID: Fix logitech-dj: missing Unifying device issue 2012-09-22 10:58:48 +02:00
hid-magicmouse.c Input: MT - Add flags to input_mt_init_slots() 2012-09-19 19:50:18 +02:00
hid-microsoft.c HID: microsoft: do not use compound literal - fix build 2012-11-12 15:34:59 +01:00
hid-monterey.c HID: remove Paul Walmsley's copyright from places where it shouldn't be 2012-09-05 10:46:36 +02:00
hid-multitouch.c HID: multitouch: fix Win 8 protocol 2012-11-15 10:19:00 +01:00
hid-ntrig.c HID: ntrig: change default value of logical/physical width/height to 1 2012-09-25 15:20:07 +02:00
hid-ortek.c HID: add support for Skycable 0x3f07 wireless presenter 2011-03-21 16:12:23 +01:00
hid-petalynx.c HID: remove Paul Walmsley's copyright from places where it shouldn't be 2012-09-05 10:46:36 +02:00
hid-picolcd.h HID: picolcd: fix build error if !CONFIG_DEBUG_FS 2012-09-11 16:06:22 +02:00
hid-picolcd_backlight.c HID: picoLCD: Improve unplug handling 2012-08-15 10:13:26 +02:00
hid-picolcd_cir.c HID: picoLCD: fix a NULL test in picolcd_raw_cir() 2012-09-08 21:19:07 +02:00
hid-picolcd_core.c HID: picolcd_core: Remove setting hdev->claimed before calling hid_hw_start() 2012-09-19 13:57:03 +02:00
hid-picolcd_debugfs.c HID: picoLCD: optimize for inactive debugfs 2012-10-01 10:25:01 +02:00
hid-picolcd_fb.c Merge branch 'for-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq 2012-10-02 09:54:49 -07:00
hid-picolcd_lcd.c HID: picoLCD: Improve unplug handling 2012-08-15 10:13:26 +02:00
hid-picolcd_leds.c HID: picoLCD: Improve unplug handling 2012-08-15 10:13:26 +02:00
hid-pl.c misc latin1 to utf8 conversions 2012-01-02 13:04:55 +01:00
hid-primax.c HID: primax: Remove px_probe() and px_remove() functions 2012-09-07 14:55:38 +02:00
hid-prodikeys.c HID: prodikeys: Remove unnecessary casts of void pointers 2012-09-17 13:08:30 +02:00
hid-ps3remote.c HID: Add support for Sony PS3 BD Remote Control 2012-10-01 10:11:48 +02:00
hid-roccat-arvo.c HID: roccat: rename roccat_common functions to roccat_common2 2012-06-28 10:34:01 +02:00
hid-roccat-arvo.h HID: roccat: correction and cleanup of HID feature reports 2011-06-13 12:52:57 +02:00
hid-roccat-common.c HID: roccat: rename roccat_common functions to roccat_common2 2012-06-28 10:34:01 +02:00
hid-roccat-common.h HID: roccat: rename roccat_common functions to roccat_common2 2012-06-28 10:34:01 +02:00
hid-roccat-isku.c HID: roccat: add sysfs attr "reset" for Isku 2012-11-12 15:30:27 +01:00
hid-roccat-isku.h HID: roccat: add sysfs attr "reset" for Isku 2012-11-12 15:30:27 +01:00
hid-roccat-kone.c HID: roccat: fix wrong hid_err usage on struct usb_device 2012-06-28 10:34:01 +02:00
hid-roccat-kone.h HID: roccat: correction and cleanup of HID feature reports 2011-06-13 12:52:57 +02:00
hid-roccat-koneplus.c HID: roccat: deprecate some Koneplus attributes 2012-11-12 15:30:28 +01:00
hid-roccat-koneplus.h HID: roccat: fix wrong attr size for koneplus tcu 2012-11-18 22:58:28 +01:00
hid-roccat-kovaplus.c HID: roccat: deprecate some Kovaplus attributes 2012-11-12 15:30:29 +01:00
hid-roccat-kovaplus.h HID: roccat: deprecate some Kovaplus attributes 2012-11-12 15:30:29 +01:00
hid-roccat-lua.c HID: roccat: add support for Roccat Lua 2012-10-17 10:44:47 +02:00
hid-roccat-lua.h HID: roccat: add support for Roccat Lua 2012-10-17 10:44:47 +02:00
hid-roccat-pyra.c HID: roccat: deprecated some Pyra attributes 2012-11-12 15:30:28 +01:00
hid-roccat-pyra.h HID: roccat: deprecated some Pyra attributes 2012-11-12 15:30:28 +01:00
hid-roccat-savu.c HID: roccat: enable Savu device reset 2012-11-05 13:17:39 +01:00
hid-roccat-savu.h HID: roccat: added sensor sysfs attribute for Savu 2012-07-20 09:50:42 +02:00
hid-roccat.c Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux 2011-11-06 19:44:47 -08:00
hid-saitek.c HID: add new driver for non-compliant Saitek devices 2012-02-22 11:30:17 +01:00
hid-samsung.c HID: remove Paul Walmsley's copyright from places where it shouldn't be 2012-09-05 10:46:36 +02:00
hid-sensor-hub.c Merge branches 'for-3.7/upstream-fixes', 'for-3.8/hidraw', 'for-3.8/i2c-hid', 'for-3.8/multitouch', 'for-3.8/roccat', 'for-3.8/sensors' and 'for-3.8/upstream' into for-linus 2012-12-12 21:41:55 +01:00
hid-sjoy.c HID: sjoy: Add device ID for Super Joy Box 3 2012-02-21 14:16:36 +01:00
hid-sony.c HID: hid-sony: fix troubles with Sony remote clones 2013-01-03 10:47:58 +01:00
hid-speedlink.c HID: Add driver to fix Speedlink VAD Cezanne support 2011-06-08 09:45:37 +02:00
hid-sunplus.c HID: remove Paul Walmsley's copyright from places where it shouldn't be 2012-09-05 10:46:36 +02:00
hid-tivo.c HID: tivo: fix support for bluetooth version of tivo Slide 2012-03-30 15:28:59 +02:00
hid-tmff.c hid: Add module.h to fix up implicit users of it 2011-10-31 19:31:17 -04:00
hid-topseed.c HID: Add support for Perixx PERIBOARD-707 (Plus) 2010-11-25 15:59:02 +01:00
hid-twinhan.c misc latin1 to utf8 conversions 2012-01-02 13:04:55 +01:00
hid-uclogic.c HID: uclogic: Add support for UC-Logic TWHA60 2012-08-27 08:09:21 -07:00
hid-wacom.c Merge branch 'upstream' into for-linus 2012-10-01 14:37:51 +02:00
hid-waltop.c HID: waltop: Remove waltop_probe() and waltop_remove() functions 2012-09-07 14:53:59 +02:00
hid-wiimote-core.c HID: wiimote: Fix IR data parser 2012-05-09 11:40:51 +02:00
hid-wiimote-debug.c simple_open: automatically convert to simple_open() 2012-04-05 15:25:50 -07:00
hid-wiimote-ext.c Merge branch 'for-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq 2012-10-02 09:54:49 -07:00
hid-wiimote.h HID: wiimote: Allow direct DRM debug access 2011-11-22 23:11:10 +01:00
hid-zpff.c hid: Add module.h to fix up implicit users of it 2011-10-31 19:31:17 -04:00
hid-zydacron.c HID: zydacron: kfree() NULL pointer cleanup 2011-08-04 23:51:29 +02:00
hidraw.c HID: hidraw: fix signaling SIGIO when hidraw reports an event 2012-11-28 16:36:18 +01:00
uhid.c HID: uhid: Fix sending events with invalid data 2012-07-20 09:53:45 +02:00