aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-apple.c
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2012-05-11 16:17:16 +0200
committerJiri Kosina <jkosina@suse.cz>2012-05-11 16:31:21 +0200
commit44d27f7dfedd9aadc082cda31462f6600f56e4ec (patch)
tree66935ad1e6ed841e83e4adbb031a93bbc0cbf5b3 /drivers/hid/hid-apple.c
parentHID: wiimote: Fix IR data parser (diff)
downloadlinux-dev-44d27f7dfedd9aadc082cda31462f6600f56e4ec.tar.xz
linux-dev-44d27f7dfedd9aadc082cda31462f6600f56e4ec.zip
HID: logitech: read all 32 bits of report type bitfield
On big-endian systems (e.g., Apple PowerBook), trying to use a logitech wireless mouse with the Logitech Unifying Receiver does not work with v3.2 and later kernels. The device doesn't show up in /dev/input. Older kernels work fine. That is because the new hid-logitech-dj driver claims the device. The device arrival notification appears: 20 00 41 02 00 00 00 00 00 00 00 00 00 00 00 and we read the report_types bitfield (02 00 00 00) to find out what kind of device it is. Unfortunately the driver only reads the first 8 bits and treats that value as a 32-bit little-endian number, so on a powerpc the report type seems to be 0x02000000 and is not recognized. Even on little-endian machines, connecting a media center remote control (report type 00 01 00 00) with this driver loaded would presumably fail for the same reason. Fix both problems by using get_unaligned_le32() to read all four bytes, which is a little clearer anyway. After this change, the wireless mouse works on Hugo's PowerBook again. Based on a patch by Nestor Lopez Casado. Addresses http://bugs.debian.org/671292 Reported-by: Hugo Osvaldo Barrera <hugo@osvaldobarrera.com.ar> Inspired-by: Nestor Lopez Casado <nlopezcasad@logitech.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Nestor Lopez Casado <nlopezcasad@logitech.com> Cc: <stable@vger.kernel.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-apple.c')
0 files changed, 0 insertions, 0 deletions