Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1297336

Re: [PATCH 1/5] iio:adc:at91_adc8xx: introduce new atmel adc driver

From Ludovic Desroches <ludovic.desroches@atmel.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/5] iio:adc:at91_adc8xx: introduce new atmel adc driver
Date 2015-12-23 11:50 +0100
Message-ID <qIP9w-8u4-17@gated-at.bofh.it> (permalink)
References <qI4WZ-4EK-5@gated-at.bofh.it> <qI4X0-4EK-29@gated-at.bofh.it> <qIA0N-7v6-1@gated-at.bofh.it> <qIOQb-8nu-37@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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?

By the way this is not a polled read.

> > > +		st->done = true;
> > > +		wake_up_interruptible(&st->wq_data_available);
> > > +	}
> > > +
> > > +	return IRQ_HANDLED;
> > > +}

Ludovic
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/5] Introduce at91_adc8xx driver Ludovic Desroches <ludovic.desroches@atmel.com> - 2015-12-21 10:30 +0100
  [PATCH 1/5] iio:adc:at91_adc8xx: introduce new atmel adc driver Ludovic Desroches <ludovic.desroches@atmel.com> - 2015-12-21 10:30 +0100
    Re: [PATCH 1/5] iio:adc:at91_adc8xx: introduce new atmel adc driver Jonathan Cameron <jic23@kernel.org> - 2015-12-22 19:40 +0100
      Re: [PATCH 1/5] iio:adc:at91_adc8xx: introduce new atmel adc driver Ludovic Desroches <ludovic.desroches@atmel.com> - 2015-12-23 11:30 +0100
        Re: [PATCH 1/5] iio:adc:at91_adc8xx: introduce new atmel adc driver Ludovic Desroches <ludovic.desroches@atmel.com> - 2015-12-23 11:50 +0100
          Re: [PATCH 1/5] iio:adc:at91_adc8xx: introduce new atmel adc driver Jonathan Cameron <jic23@jic23.retrosnub.co.uk> - 2015-12-23 18:30 +0100
        Re: [PATCH 1/5] iio:adc:at91_adc8xx: introduce new atmel adc driver Jonathan Cameron <jic23@kernel.org> - 2015-12-31 20:30 +0100
    Re: [PATCH 1/5] iio:adc:at91_adc8xx: introduce new atmel adc driver Rob Herring <robh@kernel.org> - 2015-12-23 02:00 +0100
      Re: [PATCH 1/5] iio:adc:at91_adc8xx: introduce new atmel adc driver Ludovic Desroches <ludovic.desroches@atmel.com> - 2015-12-23 11:30 +0100
    Re: [PATCH 1/5] iio:adc:at91_adc8xx: introduce new atmel adc driver Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2015-12-23 11:30 +0100

csiph-web