Accelerometer Kionix kxtj9 always outputs 8-bit data because assign
a boolean value to bit mask variable. This patch will fix this and
also change the resolution control variable name from "res_12bit"
to "res_ctl" to avoid misleading.
Change-Id: I4784bfb18679a1a64941eafc80762241cdd825fe
Signed-off-by: Figo Wang <figow@codeaurora.org>
Several fixes based on customer feedback:
* WHO_AM_I value has changed since preliminary parts used for initial
testing;
* Output of le16_to_cpu must be saved to memory before shifting to
preserve sign;
* Initial data rate was not extracted from data control register init.
This was causing the initial data rate to be set to maximum until
it was changed. To fix this problem, it made more sense to specify
initial data rate and extract the register mask from that.
Signed-off-by: Chris Hudson <chudson@kionix.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>