diff options
| author | Peter Meerwald <pmeerw@pmeerw.net> | 2014-07-16 14:32:00 -0400 |
|---|---|---|
| committer | Jonathan Cameron <jic23@kernel.org> | 2014-07-20 12:38:39 -0400 |
| commit | 381676d5e86596b11e22a62f196e192df6091373 (patch) | |
| tree | abc4e1eed66b45c521bb63028b0f1598ad126f94 | |
| parent | 61bd55ce1667809f022be88da77db17add90ea4e (diff) | |
iio:bma180: Fix scale factors to report correct acceleration units
The userspace interface for acceleration sensors is documented as using
m/s^2 units [Documentation/ABI/testing/sysfs-bus-iio]
The fullscale raw values for the BMA80 corresponds to -/+ 1, 1.5, 2, etc G
depending on the selected mode.
The scale table was converting to G rather than m/s^2.
Change the scaling table to match the documented interface.
See commit 71702e6e, iio: mma8452: Use correct acceleration units,
for a related fix.
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Cc: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Cc: Stable@vger.kernel.org
| -rw-r--r-- | drivers/iio/accel/bma180.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/iio/accel/bma180.c b/drivers/iio/accel/bma180.c index a7e68c81f89d..28388bb5d583 100644 --- a/drivers/iio/accel/bma180.c +++ b/drivers/iio/accel/bma180.c | |||
| @@ -68,13 +68,13 @@ | |||
| 68 | /* Defaults values */ | 68 | /* Defaults values */ |
| 69 | #define BMA180_DEF_PMODE 0 | 69 | #define BMA180_DEF_PMODE 0 |
| 70 | #define BMA180_DEF_BW 20 | 70 | #define BMA180_DEF_BW 20 |
| 71 | #define BMA180_DEF_SCALE 250 | 71 | #define BMA180_DEF_SCALE 2452 |
| 72 | 72 | ||
| 73 | /* Available values for sysfs */ | 73 | /* Available values for sysfs */ |
| 74 | #define BMA180_FLP_FREQ_AVAILABLE \ | 74 | #define BMA180_FLP_FREQ_AVAILABLE \ |
| 75 | "10 20 40 75 150 300" | 75 | "10 20 40 75 150 300" |
| 76 | #define BMA180_SCALE_AVAILABLE \ | 76 | #define BMA180_SCALE_AVAILABLE \ |
| 77 | "0.000130 0.000190 0.000250 0.000380 0.000500 0.000990 0.001980" | 77 | "0.001275 0.001863 0.002452 0.003727 0.004903 0.009709 0.019417" |
| 78 | 78 | ||
| 79 | struct bma180_data { | 79 | struct bma180_data { |
| 80 | struct i2c_client *client; | 80 | struct i2c_client *client; |
| @@ -94,7 +94,7 @@ enum bma180_axis { | |||
| 94 | }; | 94 | }; |
| 95 | 95 | ||
| 96 | static int bw_table[] = { 10, 20, 40, 75, 150, 300 }; /* Hz */ | 96 | static int bw_table[] = { 10, 20, 40, 75, 150, 300 }; /* Hz */ |
| 97 | static int scale_table[] = { 130, 190, 250, 380, 500, 990, 1980 }; | 97 | static int scale_table[] = { 1275, 1863, 2452, 3727, 4903, 9709, 19417 }; |
| 98 | 98 | ||
| 99 | static int bma180_get_acc_reg(struct bma180_data *data, enum bma180_axis axis) | 99 | static int bma180_get_acc_reg(struct bma180_data *data, enum bma180_axis axis) |
| 100 | { | 100 | { |
