From: Ludovic Desroches <ludovic.desroches@atmel.com>
To: Jonathan Cameron <jic23@jic23.retrosnub.co.uk>
Cc: Ludovic Desroches <ludovic.desroches@atmel.com>,
Jonathan Cameron <jic23@kernel.org>, <nicolas.ferre@atmel.com>,
<alexandre.belloni@free-electrons.com>,
<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-iio@vger.kernel.org>, <plagnioj@jcrosoft.com>,
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 1/5] iio:adc:at91_adc8xx: introduce new atmel adc driver
Date: Tue, 5 Jan 2016 14:18:05 +0100 [thread overview]
Message-ID: <20160105131805.GE2334@odux.rfo.atmel.com> (raw)
In-Reply-To: <E2C27D1A-1035-4330-AEF3-C72B87C27FEF@jic23.retrosnub.co.uk>
On Wed, Dec 23, 2015 at 05:21:25PM +0000, Jonathan Cameron wrote:
>
>
> On 23 December 2015 10:48:33 GMT+00:00, Ludovic Desroches <ludovic.desroches@atmel.com> wrote:
> >On Wed, Dec 23, 2015 at 11:27:00AM +0100, Ludovic Desroches wrote:
> >> On Tue, Dec 22, 2015 at 06:34:00PM +0000, Jonathan Cameron wrote:
> >> > On 21/12/15 09:24, Ludovic Desroches wrote:
> >> > > This driver supports the new version of the Atmel ADC device
> >introduced
> >> > > with the SAMA5D2 SoC family.
> >> > >
> >
> >[...]
> >
> >> > > +static irqreturn_t at91_adc_interrupt(int irq, void *private)
> >> > > +{
> >> > > + struct iio_dev *indio = private;
> >> > > + struct at91_adc_state *st = iio_priv(indio);
> >> > > + u32 status = at91_adc_readl(st, ADC_ISR);
> >> > > +
> >> > > + status &= at91_adc_readl(st, ADC_IMR);
> >> > > + if (status & 0xFFF) {
> >> > > + st->last_value = at91_adc_readl(st, st->chan->address);
> >> > If this is a polled read - is there any reason to read this value
> >here
> >> > rather than outside the interrupt?
> >>
> >> No it can be done outside the interrupt. I have taken some parts from
> >the
> >> previous driver but it was reading a register used by all the
> >channels
> >> when it has been designed. So yes there is probably no more reason to
> >> read it into the interrupt.
> >>
> >
> >Thinking about it. Is it really useful to move reading outside the
> >interrupt?
> It avoids needing to know the channel in here, hence simplifying the code a bit.
I am not sure it will simplify the code since the interrupt is cleared
when reading the conversion not the interrupt status register.
> >
> >By the way this is not a polled read.
> I meant that it is an individually requested conversion rather than a free running
> sampling system where the value read might change before it is read out.
> >
> >> > > + st->done = true;
> >> > > + wake_up_interruptible(&st->wq_data_available);
> >> > > + }
> >> > > +
> >> > > + return IRQ_HANDLED;
> >> > > +}
> >
> >Ludovic
> >--
> >To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> >the body of a message to majordomo@vger.kernel.org
> >More majordomo info at http://vger.kernel.org/majordomo-info.html
>
> --
> Sent from my Android device with K-9 Mail. Please excuse my brevity.
next prev parent reply other threads:[~2016-01-05 13:18 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-21 9:24 [PATCH 0/5] Introduce at91_adc8xx driver Ludovic Desroches
2015-12-21 9:24 ` [PATCH 1/5] iio:adc:at91_adc8xx: introduce new atmel adc driver Ludovic Desroches
2015-12-21 9:38 ` Peter Meerwald-Stadler
2015-12-21 10:16 ` Ludovic Desroches
2015-12-21 10:25 ` Ludovic Desroches
2015-12-22 18:34 ` Jonathan Cameron
2015-12-23 10:27 ` Ludovic Desroches
2015-12-23 10:48 ` Ludovic Desroches
2015-12-23 17:21 ` Jonathan Cameron
2016-01-05 13:18 ` Ludovic Desroches [this message]
2015-12-31 19:23 ` Jonathan Cameron
2015-12-23 0:51 ` Rob Herring
2015-12-23 10:29 ` Ludovic Desroches
2015-12-23 10:27 ` Alexandre Belloni
2015-12-21 9:24 ` [PATCH 2/5] MAINTAINERS: add entry for Atmel ADC 8xx driver Ludovic Desroches
2015-12-21 9:24 ` [PATCH 3/5] ARM: at91/dt: sama5d2: add adc device Ludovic Desroches
2015-12-21 9:24 ` [PATCH 4/5] ARM: at91/dt: sama5d2 Xplained: enable the " Ludovic Desroches
2015-12-21 9:24 ` [PATCH 5/5] ARM: at91/defconfig: add sama5d2 adc support in sama5_defconfig Ludovic Desroches
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=20160105131805.GE2334@odux.rfo.atmel.com \
--to=ludovic.desroches@atmel.com \
--cc=alexandre.belloni@free-electrons.com \
--cc=devicetree@vger.kernel.org \
--cc=jic23@jic23.retrosnub.co.uk \
--cc=jic23@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nicolas.ferre@atmel.com \
--cc=plagnioj@jcrosoft.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).