]> git.baikalelectronics.ru Git - kernel.git/commit
iio: accel: st_accel: add SPI-3wire support
authorLorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Wed, 5 Jul 2017 18:30:01 +0000 (20:30 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Thu, 6 Jul 2017 18:32:29 +0000 (19:32 +0100)
commitfe364c66291e2bb3fb2549fdc636a6b1de63cdc6
tree95f3fd426b135148789c66f2f066b83cd91ab912
parent52a2fa3cf487a0a657a928a6976203e6343b08cf
iio: accel: st_accel: add SPI-3wire support

Add SPI Serial Interface Mode (SIM) register information
in st_sensor_settings look up table to support devices
(like LSM303AGR accel sensor) that allow just SPI-3wire
communication mode. SIM mode has to be configured before any
other operation since it is not enabled by default and the driver
is not able to read without that configuration

Whilst a fairly substantial patch, the actual logic is simple and it
is better to have the generic fix than a band aid.

Fixes: af43076e2028 (iio: st-accel: add support for lsm303agr accel)
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/accel/st_accel_core.c
drivers/iio/common/st_sensors/st_sensors_core.c
include/linux/iio/common/st_sensors.h
include/linux/platform_data/st_sensors_pdata.h