mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-05-01 21:04:03 +00:00
iio: cros_ec: use devm_iio_triggered_buffer_setup_ext()
This change switches to the new devm_iio_triggered_buffer_setup_ext() function and removes the iio_buffer_set_attrs() call, for assigning the HW FIFO attributes to the buffer. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20200929125949.69934-8-alexandru.ardelean@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
a2f283555b
commit
165aea80e2
1 changed files with 9 additions and 6 deletions
|
@ -353,19 +353,22 @@ int cros_ec_sensors_core_init(struct platform_device *pdev,
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
} else {
|
} else {
|
||||||
|
const struct attribute **fifo_attrs;
|
||||||
|
|
||||||
|
if (has_hw_fifo)
|
||||||
|
fifo_attrs = cros_ec_sensor_fifo_attributes;
|
||||||
|
else
|
||||||
|
fifo_attrs = NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The only way to get samples in buffer is to set a
|
* The only way to get samples in buffer is to set a
|
||||||
* software trigger (systrig, hrtimer).
|
* software trigger (systrig, hrtimer).
|
||||||
*/
|
*/
|
||||||
ret = devm_iio_triggered_buffer_setup(
|
ret = devm_iio_triggered_buffer_setup_ext(
|
||||||
dev, indio_dev, NULL, trigger_capture,
|
dev, indio_dev, NULL, trigger_capture,
|
||||||
NULL);
|
NULL, fifo_attrs);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
if (has_hw_fifo)
|
|
||||||
iio_buffer_set_attrs(indio_dev->buffer,
|
|
||||||
cros_ec_sensor_fifo_attributes);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue