HID: i2c-hid: fix length for set/get report in i2c hid
authorHuzefa Kankroliwala <huzefa.nomanx.kankroliwala@intel.com>
Wed, 3 Apr 2013 12:45:21 +0000 (05:45 -0700)
committerJiri Kosina <jkosina@suse.cz>
Thu, 4 Apr 2013 07:59:32 +0000 (09:59 +0200)
commit7c4d577367fb710ea74a56955c5e3546fe5dd7ac
tree2e30de664d1f64d122a49b19604916f873f3fcdb
parent83a44ac8bf4a8e6cbbf0c00ff281a482778f708a
HID: i2c-hid: fix length for set/get report in i2c hid

With the current i2c hid driver set/get report does not work
as expected, for e.g sensor hub properties like power state,
frequency etc is not set properly on the device as a result
we do not get events.
The problem is that i2c hid driver in function i2c_hid_request
sets length equal to default buffer size for which the sensor
hub does not respond on get/set commands. Use report length
and calculate it based on report size and id.

Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Huzefa Kankroliwala <huzefa.nomanx.kankroliwala@intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/i2c-hid/i2c-hid.c