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>
此提交包含在:
@@ -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)
|
||||
|
新增問題並參考
封鎖使用者