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)
commita7b8829d242b1a58107e9c02b09e93aec446d55c
tree95f3fd426b135148789c66f2f066b83cd91ab912
parent631b010abc5b57009c6a8328f51492665f6ef310
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: ddc05fa28606 (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