]> git.baikalelectronics.ru Git - kernel.git/commit
iio: at91-sama5d2_adc: adjust iio_triggered_buffer_{predisable,postenable} positions
authorAlexandru Ardelean <alexandru.ardelean@analog.com>
Wed, 4 Mar 2020 08:42:19 +0000 (10:42 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 25 Apr 2020 15:04:19 +0000 (16:04 +0100)
commit7cd796019915088a998c5e832b19b19f56891aa3
tree274218f58efd0d4ff95e62c1bc13b75845e1dbff
parentb81004b398b7645dc119499acca892bd23be817f
iio: at91-sama5d2_adc: adjust iio_triggered_buffer_{predisable,postenable} positions

The iio_triggered_buffer_{predisable,postenable} functions attach/detach
poll functions.

In most cases the iio_triggered_buffer_postenable() should be called first
to attach the poll function, and then the driver can init the data to be
triggered.
In this case it's the other way around: the DMA code should be initialized
before the attaching the poll function and the reverse should be done when
un-initializing.

To make things easier when removing the iio_triggered_buffer_postenable() &
iio_triggered_buffer_predisable() functions from the IIO core API, the DMA
code has been moved into preenable() for init, and postdisable() for
uninit.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Reviewed-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Reviewed-by: Eugen Hristev <eugen.hristev@microchip.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/at91-sama5d2_adc.c