mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-23 09:56:00 +00:00
iio: st_sensors: make BDU optional
Not all sensors support BDU (block data update) and in fact a bunch of the in-kernel sensor settings do not specify the BDU address field. Make this optional. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:
parent
d2bc431868
commit
bb60646c8b
@ -344,11 +344,13 @@ int st_sensors_init_sensor(struct iio_dev *indio_dev,
|
|||||||
return err;
|
return err;
|
||||||
|
|
||||||
/* set BDU */
|
/* set BDU */
|
||||||
err = st_sensors_write_data_with_mask(indio_dev,
|
if (sdata->sensor_settings->bdu.addr) {
|
||||||
|
err = st_sensors_write_data_with_mask(indio_dev,
|
||||||
sdata->sensor_settings->bdu.addr,
|
sdata->sensor_settings->bdu.addr,
|
||||||
sdata->sensor_settings->bdu.mask, true);
|
sdata->sensor_settings->bdu.mask, true);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
return err;
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
err = st_sensors_set_axis_enable(indio_dev, ST_SENSORS_ENABLE_ALL_AXIS);
|
err = st_sensors_set_axis_enable(indio_dev, ST_SENSORS_ENABLE_ALL_AXIS);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user