linux_dsm_epyc7002/drivers/iio/accel
Linus Walleij 65e4345c8e iio: accel: st_accel: fix LIS3LV02 reading and scaling
The LIS3LV02 has a special bit that need to be set to get the
read values left aligned. Before this patch we get gibberish
like this:

iio_generic_buffer -a -c10 -n lis3lv02dl_accel
(...)
0.000000 -0.010042 -0.642688 19155832931907
0.000000 -0.010042 -0.642688 19155858751073

Which is because we read a raw value for 1g as 64 which is
the nominal 1024 for 1g shifted 4 bits to the left by being
right-aligned rather than left aligned.

Since all other sensors are left aligned, add some code to
set the special DAS (data alignment setting) bit to 1 so that
the right value is now read like this:

iio_generic_buffer -a -c10 -n lis3lv02dl_accel
(...)
0.000000 -0.147095 -10.120135 24761614364956
-0.029419 -0.176514 -10.120135 24761631624540

The scaling was weird as well: we have a gain of 1000 for 1g
and 3000 for 6g. I don't even remember how I came up with the
old values but they are wrong.

Fixes: 3acddf74f8 ("iio: st-sensors: add support for lis3lv02d accelerometer")
Cc: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Cc: Giuseppe Barba <giuseppe.barba@st.com>
Cc: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-12-31 14:35:04 +00:00
..
bma180.c
bma220_spi.c
bmc150-accel-core.c
bmc150-accel-i2c.c
bmc150-accel-spi.c
bmc150-accel.h
da280.c iio: accel: Add driver for the MiraMEMS DA280 3-axis 14-bit digital accelerometer 2016-10-11 19:40:15 +01:00
da311.c iio: accel: Add driver for the MiraMEMS DA311 3-axis 12-bit digital accelerometer 2016-10-11 19:39:14 +01:00
dmard06.c
dmard09.c
dmard10.c iio: accel: Add driver for dmard10 3-axis Accelerometer 2016-10-11 19:38:32 +01:00
hid-sensor-accel-3d.c
Kconfig iio: accel: st_accel: add support to lng2dm 2016-11-01 18:50:02 +00:00
kxcjk-1013.c
kxsd9-i2c.c iio: accel: kxsd9: Deploy system and runtime PM 2016-09-18 11:35:59 +01:00
kxsd9-spi.c iio: accel: kxsd9: Deploy system and runtime PM 2016-09-18 11:35:59 +01:00
kxsd9.c iio: accel: kxsd9: Support reading a mounting matrix 2016-09-18 11:36:32 +01:00
kxsd9.h iio: accel: kxsd9: Deploy system and runtime PM 2016-09-18 11:35:59 +01:00
Makefile staging:iio:accel:sca3000 Move out of staging. 2016-10-23 19:34:07 +01:00
mc3230.c iio: accel: Add driver for the mCube MC3230 3-axis accelerometer 2016-09-18 13:25:38 +01:00
mma7455_core.c
mma7455_i2c.c
mma7455_spi.c
mma7455.h
mma7660.c iio: accel: mma7660: fix non static symbol warning 2016-09-24 16:25:34 +01:00
mma8452.c iio: accel: mma8452: claim direct mode during write raw 2016-10-23 19:33:54 +01:00
mma9551_core.c
mma9551_core.h
mma9551.c
mma9553.c
mxc4005.c
mxc6255.c
sca3000.c staging:iio:accel:sca3000 Move out of staging. 2016-10-23 19:34:07 +01:00
ssp_accel_sensor.c iio: common: ssp_sensors: accel: constify iio_info structures 2016-09-18 11:56:08 +01:00
st_accel_buffer.c
st_accel_core.c iio: accel: st_accel: fix LIS3LV02 reading and scaling 2016-12-31 14:35:04 +00:00
st_accel_i2c.c iio: accel: st_accel: add support to lng2dm 2016-11-01 18:50:02 +00:00
st_accel_spi.c iio: accel: st_accel: add support to lng2dm 2016-11-01 18:50:02 +00:00
st_accel.h iio: accel: st_accel: add support to lng2dm 2016-11-01 18:50:02 +00:00
stk8ba50.c
stk8312.c