iio: move 3-wire spi initialization to st_sensors_spi

Some devices need to be configured with special bit in order to
use spi 3-wire. This was done during device identification phase.
Instead, let's move this part as spi specific.
Doing this the check_device_support function becomes a simple
device id check, so let's rename it.

Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
此提交包含在:
Denis Ciocca
2019-07-18 15:53:52 -07:00
提交者 Jonathan Cameron
父節點 570c2c55ef
當前提交 1ecd245e0e
共有 12 個檔案被更改,包括 97 行新增71 行删除

查看文件

@@ -400,9 +400,7 @@ int st_gyro_common_probe(struct iio_dev *indio_dev)
if (err)
return err;
err = st_sensors_check_device_support(indio_dev,
ARRAY_SIZE(st_gyro_sensors_settings),
st_gyro_sensors_settings);
err = st_sensors_verify_id(indio_dev);
if (err < 0)
goto st_gyro_power_off;

查看文件

@@ -91,7 +91,9 @@ static int st_gyro_spi_probe(struct spi_device *spi)
gdata = iio_priv(indio_dev);
gdata->sensor_settings = (struct st_sensor_settings *)settings;
st_sensors_spi_configure(indio_dev, spi, gdata);
err = st_sensors_spi_configure(indio_dev, spi);
if (err < 0)
return err;
err = st_gyro_common_probe(indio_dev);
if (err < 0)