HID: wiimote: Fix wiimote mp scale linearization
authorCyan Ogilvie <cyan.ogilvie@gmail.com>
Wed, 16 Mar 2016 16:59:41 +0000 (18:59 +0200)
committerJiri Kosina <jkosina@suse.cz>
Fri, 18 Mar 2016 16:31:38 +0000 (17:31 +0100)
commitd30596737e8e7b2f1235d7ba20592b8309e3af04
tree4074e2ad70bff2b085a6e7025e8f202b16c33aeb
parentd66435cc7da95964cb386674bd82ec12ca66320a
HID: wiimote: Fix wiimote mp scale linearization

The wiimote motion plus gyros use two scales to report fast and slow
rotation - below 440 deg/s uses 8192/440 units / deg/s, and above uses
8192/2000 units / deg/s.

Previously this driver attempted to linearize the two by scaling the fast
rate by 18 and the slow by 9, but this results in a scale of
8192*9/440 = ~167.564 for slow and 8192*18/2000 = 73.728 for fast.

Correct the fast motion scale factor so that both report ~167.564
units / deg/s

Signed-off-by: Cyan Ogilvie <cyan.ogilvie@gmail.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-wiimote-modules.c