HID: hid-sensor-hub: fix report size
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Sat, 26 Oct 2013 17:04:09 +0000 (10:04 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Dec 2013 19:06:20 +0000 (11:06 -0800)
commitc51b035020bd354d6c5b272c2965520b63d2927e
treeb853b3c4309294c6f767bbac74e1e1ed4869bd9e
parent32627d0a4a7e19a6bbbbca04ba3e7e44f6cbb5ae
HID: hid-sensor-hub: fix report size

commit d4b1bba76171cb783e32441b28462fe841073ed8 upstream.

Most of the hid sensor field size is reported in report_size field
in the report descriptor. For rotation fusion sensor the quaternion
data is 16 byte field, the report size was set to 4 and report
count field is set to 4. So the total size is 16 bytes. But the current
driver has a bug and not taking account for report count field. This
causes user space to see only 4 bytes of data sent via IIO interface.
The number of bytes in a field needs to take account of report_count
field. Need to multiply report_size and report_count to get total
number of bytes.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/hid-sensor-hub.c