diff mbox series

[2/3] iio: adc: at91-sama5d2_adc: remove predisable/postenable hooks

Message ID 20200522104632.517470-2-alexandru.ardelean@analog.com (mailing list archive)
State New, archived
Headers show
Series [1/3] iio: Move attach/detach of the poll func to the core | expand

Commit Message

Alexandru Ardelean May 22, 2020, 10:46 a.m. UTC
This should be squashed into the first patch, but it's the more peculiar of
the changes.
I am not sure whether this is correct. The touchscreen channels shouldn't
be enabled by the IIO framework. So, we may need a different way to handle
those if needed.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
---
 drivers/iio/adc/at91-sama5d2_adc.c | 18 ------------------
 1 file changed, 18 deletions(-)

Comments

Jonathan Cameron May 24, 2020, 1:54 p.m. UTC | #1
On Fri, 22 May 2020 13:46:31 +0300
Alexandru Ardelean <alexandru.ardelean@analog.com> wrote:

> This should be squashed into the first patch, but it's the more peculiar of
> the changes.
> I am not sure whether this is correct. The touchscreen channels shouldn't
> be enabled by the IIO framework. So, we may need a different way to handle
> those if needed.
> 
> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>

Hmm. Unfortunately I can't remember exactly what is going on here.

From a quick look my suspicion is we can handle this using the same
'is it a triggered buffer' test as you now have in the core code.

The touchscreen path operates as a non triggered buffer (I think...)

I'm definitely looking for an ack and preferably a tested-by for this
one.  You are right - it's non obvious!

Jonathan

> ---
>  drivers/iio/adc/at91-sama5d2_adc.c | 18 ------------------
>  1 file changed, 18 deletions(-)
> 
> diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c
> index 9abbbdcc7420..f71071096392 100644
> --- a/drivers/iio/adc/at91-sama5d2_adc.c
> +++ b/drivers/iio/adc/at91-sama5d2_adc.c
> @@ -937,14 +937,6 @@ static int at91_adc_buffer_preenable(struct iio_dev *indio_dev)
>  	return 0;
>  }
>  
> -static int at91_adc_buffer_postenable(struct iio_dev *indio_dev)
> -{
> -	if (at91_adc_current_chan_is_touch(indio_dev))
> -		return 0;
> -
> -	return iio_triggered_buffer_postenable(indio_dev);
> -}
> -
>  static int at91_adc_buffer_postdisable(struct iio_dev *indio_dev)
>  {
>  	struct at91_adc_state *st = iio_priv(indio_dev);
> @@ -995,19 +987,9 @@ static int at91_adc_buffer_postdisable(struct iio_dev *indio_dev)
>  	return 0;
>  }
>  
> -static int at91_adc_buffer_predisable(struct iio_dev *indio_dev)
> -{
> -	if (at91_adc_current_chan_is_touch(indio_dev))
> -		return 0;
> -
> -	return iio_triggered_buffer_predisable(indio_dev);
> -}
> -
>  static const struct iio_buffer_setup_ops at91_buffer_setup_ops = {
>  	.preenable = &at91_adc_buffer_preenable,
>  	.postdisable = &at91_adc_buffer_postdisable,
> -	.postenable = &at91_adc_buffer_postenable,
> -	.predisable = &at91_adc_buffer_predisable,
>  };
>  
>  static struct iio_trigger *at91_adc_allocate_trigger(struct iio_dev *indio,
diff mbox series

Patch

diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c
index 9abbbdcc7420..f71071096392 100644
--- a/drivers/iio/adc/at91-sama5d2_adc.c
+++ b/drivers/iio/adc/at91-sama5d2_adc.c
@@ -937,14 +937,6 @@  static int at91_adc_buffer_preenable(struct iio_dev *indio_dev)
 	return 0;
 }
 
-static int at91_adc_buffer_postenable(struct iio_dev *indio_dev)
-{
-	if (at91_adc_current_chan_is_touch(indio_dev))
-		return 0;
-
-	return iio_triggered_buffer_postenable(indio_dev);
-}
-
 static int at91_adc_buffer_postdisable(struct iio_dev *indio_dev)
 {
 	struct at91_adc_state *st = iio_priv(indio_dev);
@@ -995,19 +987,9 @@  static int at91_adc_buffer_postdisable(struct iio_dev *indio_dev)
 	return 0;
 }
 
-static int at91_adc_buffer_predisable(struct iio_dev *indio_dev)
-{
-	if (at91_adc_current_chan_is_touch(indio_dev))
-		return 0;
-
-	return iio_triggered_buffer_predisable(indio_dev);
-}
-
 static const struct iio_buffer_setup_ops at91_buffer_setup_ops = {
 	.preenable = &at91_adc_buffer_preenable,
 	.postdisable = &at91_adc_buffer_postdisable,
-	.postenable = &at91_adc_buffer_postenable,
-	.predisable = &at91_adc_buffer_predisable,
 };
 
 static struct iio_trigger *at91_adc_allocate_trigger(struct iio_dev *indio,