diff options
author | Octavian Purdila <octavian.purdila@intel.com> | 2015-03-02 21:03:05 +0200 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2015-03-07 19:17:07 +0000 |
commit | 70dddeee8945a0e62525a278ae7b91778f82f765 (patch) | |
tree | f286fe21ec087a95cf3c285604f3114a1aaa24af /drivers/iio/adc/ti_am335x_adc.c | |
parent | abe46b8932dd9a6dfc3698e3eb121809b7b9ed28 (diff) | |
download | talos-obmc-linux-70dddeee8945a0e62525a278ae7b91778f82f765.tar.gz talos-obmc-linux-70dddeee8945a0e62525a278ae7b91778f82f765.zip |
iio: fix drivers that check buffer->scan_mask
If the in-kernel push interface is used we may have a different masks
on the device buffer and the kernel buffer and in this case the device
should generate data for the reunion of the buffers, which is
available at indio_dev->active_scan_mask.
Compiled tested only except for bmc150-accel which was tested at
runtime with the hardware.
Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/adc/ti_am335x_adc.c')
-rw-r--r-- | drivers/iio/adc/ti_am335x_adc.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c index 2e5cc4409f78..a0e7161f040c 100644 --- a/drivers/iio/adc/ti_am335x_adc.c +++ b/drivers/iio/adc/ti_am335x_adc.c @@ -188,12 +188,11 @@ static int tiadc_buffer_preenable(struct iio_dev *indio_dev) static int tiadc_buffer_postenable(struct iio_dev *indio_dev) { struct tiadc_device *adc_dev = iio_priv(indio_dev); - struct iio_buffer *buffer = indio_dev->buffer; unsigned int enb = 0; u8 bit; tiadc_step_config(indio_dev); - for_each_set_bit(bit, buffer->scan_mask, adc_dev->channels) + for_each_set_bit(bit, indio_dev->active_scan_mask, adc_dev->channels) enb |= (get_adc_step_bit(adc_dev, bit) << 1); adc_dev->buffer_en_ch_steps = enb; |