All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: ludovic.desroches@microchip.com
Cc: Eugen Hristev - M18282 <Eugen.Hristev@microchip.com>,
	Alexandru Ardelean <alexandru.ardelean@analog.com>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 1/2] iio: at91-sama5d2_adc: split at91_adc_current_chan_is_touch() helper
Date: Sat, 25 Apr 2020 16:06:18 +0100	[thread overview]
Message-ID: <20200425160618.292e4c34@archlinux> (raw)
In-Reply-To: <20200419100943.voa26ggjr4wa6uce@ROU-LT-M43218B.mchp-main.com>

On Sun, 19 Apr 2020 12:09:43 +0200
ludovic.desroches@microchip.com wrote:

> On Sat, Apr 18, 2020 at 06:58:53PM +0100, Jonathan Cameron wrote:
> > EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> > 
> > On Wed, 15 Apr 2020 08:43:52 +0200
> > ludovic.desroches@microchip.com wrote:
> >   
> > > On Tue, Apr 14, 2020 at 12:22:45PM +0000, Eugen Hristev - M18282 wrote:  
> > > > On 13.04.2020 20:05, Jonathan Cameron wrote:  
> > > > > On Wed, 4 Mar 2020 10:42:18 +0200
> > > > > Alexandru Ardelean <alexandru.ardelean@analog.com> wrote:
> > > > >  
> > > > >> This change moves the logic to check if the current channel is the
> > > > >> touchscreen channel to a separate helper.
> > > > >> This reduces some code duplication, but the main intent is to re-use this
> > > > >> in the next patches.
> > > > >>
> > > > >> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>  
> > > > > Eugen / Ludovic,
> > > > >
> > > > > Have you had a chance to look at this series?  
> > > >
> > > > Hi Jonathan,
> > > >
> > > > Does the patch apply correctly for you ?  
> > >
> > > No issue on my side to apply them (v5.7-rc1 and next).
> > >  
> > > > I will try to test it , if I manage to apply it.
> > > > I can only test the ADC though because at this moment I do not have a
> > > > touchscreen at disposal.  
> > >
> > > Same here, not able to test the touchscreen but it doesn't seem very risky.
> > >  
> > > >
> > > > Meanwhile, the code looks good for me,
> > > >
> > > > Reviewed-by: Eugen Hristev <eugen.hristev@microchip.com>  
> > >
> > > You can add mine as well:
> > >
> > > Reviewed-by: Ludovic Desroches <ludovic.desroches@microchip.com>  
> > 
> > For both of you - tags for both patches or just this one?  
> 
> Sorry both patches for me, I just replied to patch 2/2 to ease the collection
> of tags.
> 
> Ludovic

Hi All,

Some considerable fuzz due to Engen's patches going in first but the resulting diff
looks right etc so I think I fixed it up correctly.

Both patches applied to the togreg branch of iio.git and pushed out as
testing for the autobuilders to play with it.

Thanks,

Jonathan


> 
> > 
> > Thanks,
> > 
> > Jonathan
> >   
> > >
> > > Regards
> > >
> > > Ludovic
> > >  
> > > >
> > > > By the way, I do not know if my two pending patches on this driver will
> > > > conflict or not.
> > > >
> > > > Eugen
> > > >  
> > > > >
> > > > > Thanks,
> > > > >
> > > > > Jonathan
> > > > >  
> > > > >> ---
> > > > >>
> > > > >> This patchset continues discussion:
> > > > >>     https://lore.kernel.org/linux-iio/20191023082508.17583-1-alexandru.ardelean@analog.com/
> > > > >> Apologies for the delay.
> > > > >>
> > > > >> Changelog v1 -> v2:
> > > > >> * added patch 'iio: at91-sama5d2_adc: split at91_adc_current_chan_is_touch()
> > > > >>    helper'
> > > > >> * renamed at91_adc_buffer_postenable() -> at91_adc_buffer_preenable()
> > > > >>    - at91_adc_buffer_postenable() - now just calls
> > > > >>      iio_triggered_buffer_postenable() if the channel isn't the touchscreen
> > > > >>      channel
> > > > >> * renamed at91_adc_buffer_predisable() -> at91_adc_buffer_postdisable()
> > > > >>    - at91_adc_buffer_predisable() - now just calls
> > > > >>      iio_triggered_buffer_predisable() if the channel isn't the touchscreen
> > > > >>      channel
> > > > >>
> > > > >>   drivers/iio/adc/at91-sama5d2_adc.c | 31 +++++++++++++++---------------
> > > > >>   1 file changed, 15 insertions(+), 16 deletions(-)
> > > > >>
> > > > >> diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c
> > > > >> index a5c7771227d5..f2a74c47c768 100644
> > > > >> --- a/drivers/iio/adc/at91-sama5d2_adc.c
> > > > >> +++ b/drivers/iio/adc/at91-sama5d2_adc.c
> > > > >> @@ -873,18 +873,24 @@ static int at91_adc_dma_start(struct iio_dev *indio_dev)
> > > > >>        return 0;
> > > > >>   }
> > > > >>
> > > > >> +static bool at91_adc_current_chan_is_touch(struct iio_dev *indio_dev)
> > > > >> +{
> > > > >> +     struct at91_adc_state *st = iio_priv(indio_dev);
> > > > >> +
> > > > >> +     return !!bitmap_subset(indio_dev->active_scan_mask,
> > > > >> +                            &st->touch_st.channels_bitmask,
> > > > >> +                            AT91_SAMA5D2_MAX_CHAN_IDX + 1);
> > > > >> +}
> > > > >> +
> > > > >>   static int at91_adc_buffer_postenable(struct iio_dev *indio_dev)
> > > > >>   {
> > > > >>        int ret;
> > > > >>        struct at91_adc_state *st = iio_priv(indio_dev);
> > > > >>
> > > > >>        /* check if we are enabling triggered buffer or the touchscreen */
> > > > >> -     if (bitmap_subset(indio_dev->active_scan_mask,
> > > > >> -                       &st->touch_st.channels_bitmask,
> > > > >> -                       AT91_SAMA5D2_MAX_CHAN_IDX + 1)) {
> > > > >> -             /* touchscreen enabling */
> > > > >> +     if (at91_adc_current_chan_is_touch(indio_dev))
> > > > >>                return at91_adc_configure_touch(st, true);
> > > > >> -     }
> > > > >> +
> > > > >>        /* if we are not in triggered mode, we cannot enable the buffer. */
> > > > >>        if (!(indio_dev->currentmode & INDIO_ALL_TRIGGERED_MODES))
> > > > >>                return -EINVAL;
> > > > >> @@ -906,12 +912,9 @@ static int at91_adc_buffer_predisable(struct iio_dev *indio_dev)
> > > > >>        u8 bit;
> > > > >>
> > > > >>        /* check if we are disabling triggered buffer or the touchscreen */
> > > > >> -     if (bitmap_subset(indio_dev->active_scan_mask,
> > > > >> -                       &st->touch_st.channels_bitmask,
> > > > >> -                       AT91_SAMA5D2_MAX_CHAN_IDX + 1)) {
> > > > >> -             /* touchscreen disable */
> > > > >> +     if (at91_adc_current_chan_is_touch(indio_dev))
> > > > >>                return at91_adc_configure_touch(st, false);
> > > > >> -     }
> > > > >> +
> > > > >>        /* if we are not in triggered mode, nothing to do here */
> > > > >>        if (!(indio_dev->currentmode & INDIO_ALL_TRIGGERED_MODES))
> > > > >>                return -EINVAL;
> > > > >> @@ -1886,14 +1889,10 @@ static __maybe_unused int at91_adc_resume(struct device *dev)
> > > > >>                return 0;
> > > > >>
> > > > >>        /* check if we are enabling triggered buffer or the touchscreen */
> > > > >> -     if (bitmap_subset(indio_dev->active_scan_mask,
> > > > >> -                       &st->touch_st.channels_bitmask,
> > > > >> -                       AT91_SAMA5D2_MAX_CHAN_IDX + 1)) {
> > > > >> -             /* touchscreen enabling */
> > > > >> +     if (at91_adc_current_chan_is_touch(indio_dev))
> > > > >>                return at91_adc_configure_touch(st, true);
> > > > >> -     } else {
> > > > >> +     else
> > > > >>                return at91_adc_configure_trigger(st->trig, true);
> > > > >> -     }
> > > > >>
> > > > >>        /* not needed but more explicit */
> > > > >>        return 0;  
> > > > >  
> > > >  
> >   


      reply	other threads:[~2020-04-25 15:06 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-04  8:42 [PATCH v2 1/2] iio: at91-sama5d2_adc: split at91_adc_current_chan_is_touch() helper Alexandru Ardelean
2020-03-04  8:42 ` [PATCH v2 2/2] iio: at91-sama5d2_adc: adjust iio_triggered_buffer_{predisable,postenable} positions Alexandru Ardelean
2020-04-19 10:04   ` ludovic.desroches
2020-04-23 10:56     ` Eugen.Hristev
2020-04-13 17:05 ` [PATCH v2 1/2] iio: at91-sama5d2_adc: split at91_adc_current_chan_is_touch() helper Jonathan Cameron
2020-04-14 12:22   ` Eugen.Hristev
2020-04-14 17:45     ` Jonathan Cameron
2020-04-15  6:33       ` Ardelean, Alexandru
2020-04-27 12:20         ` Eugen.Hristev
2020-04-27 13:00           ` Ardelean, Alexandru
2020-04-30  7:30             ` Ardelean, Alexandru
2020-04-30  8:10               ` Ardelean, Alexandru
2020-05-02 17:31                 ` Jonathan Cameron
2020-04-15  6:43     ` ludovic.desroches
2020-04-18 17:58       ` Jonathan Cameron
2020-04-19 10:09         ` ludovic.desroches
2020-04-25 15:06           ` Jonathan Cameron [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200425160618.292e4c34@archlinux \
    --to=jic23@kernel.org \
    --cc=Eugen.Hristev@microchip.com \
    --cc=alexandru.ardelean@analog.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ludovic.desroches@microchip.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.