linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
To: Zubair Lutfullah
	<zubair.lutfullah-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: jic23-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org,
	dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org,
	Russ.Dill-l0cyMroinI0@public.gmane.org
Subject: Re: [PATCH 4/4] iio: ti_am335x_adc: Add continuous sampling and trigger support
Date: Fri, 16 Aug 2013 14:53:40 +0200	[thread overview]
Message-ID: <20130816125340.GC1263@linutronix.de> (raw)
In-Reply-To: <1376424303-22740-5-git-send-email-zubair.lutfullah-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

* Zubair Lutfullah | 2013-08-13 21:05:03 [+0100]:

>diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c
>index 3ceac3e..0d7e313 100644
>--- a/drivers/iio/adc/ti_am335x_adc.c
>+++ b/drivers/iio/adc/ti_am335x_adc.c
>@@ -24,16 +24,28 @@
>+static irqreturn_t tiadc_irq(int irq, void *private)
>+{
>+	struct iio_dev *idev = private;
>+	struct tiadc_device *adc_dev = iio_priv(idev);
>+	unsigned int status, config;
>+	status = tiadc_readl(adc_dev, REG_IRQSTATUS);
>+
>+	/* FIFO Overrun. Clear flag. Disable/Enable ADC to recover */
>+	if (status & IRQENB_FIFO1OVRRUN) {
>+		config = tiadc_readl(adc_dev, REG_CTRL);
>+		config &= ~(CNTRLREG_TSCSSENB);
>+		tiadc_writel(adc_dev, REG_CTRL, config);
>+		tiadc_writel(adc_dev, REG_IRQSTATUS, IRQENB_FIFO1OVRRUN |
>+				IRQENB_FIFO1UNDRFLW | IRQENB_FIFO1THRES);
>+		tiadc_writel(adc_dev, REG_CTRL, (config | CNTRLREG_TSCSSENB));

I have no idea how other handle this but shouldn't you somehow inform
*anyone* that you lost some samples due to this overrun?

>+	} else if (status & IRQENB_FIFO1THRES) {
>+		/* Wake adc_work that pushes FIFO data to iio buffer */
>+		tiadc_writel(adc_dev, REG_IRQCLR, IRQENB_FIFO1THRES);
>+		adc_dev->data_avail = 1;
>+		wake_up_interruptible(&adc_dev->wq_data_avail);
>+	} else
>+		return IRQ_NONE;

Sebastian

  parent reply	other threads:[~2013-08-16 12:53 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-13 20:04 [PATCH 0/4] iio: input: ti_am335x_adc: Add continuous sampling support round 5 Zubair Lutfullah
2013-08-13 20:05 ` [PATCH 1/4] input: ti_am335x_tsc: correct step mask update after IRQ Zubair Lutfullah
2013-08-13 20:05 ` [PATCH 2/4] input: ti_am335x_tsc: Increase sequencer delay time Zubair Lutfullah
     [not found] ` <1376424303-22740-1-git-send-email-zubair.lutfullah-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-08-13 20:05   ` [PATCH 3/4] input: ti_am335x_tsc: Enable shared IRQ for TSC, add overrun and underflow checks Zubair Lutfullah
2013-08-13 20:05 ` [PATCH 4/4] iio: ti_am335x_adc: Add continuous sampling and trigger support Zubair Lutfullah
     [not found]   ` <1376424303-22740-5-git-send-email-zubair.lutfullah-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-08-15 11:43     ` Jonathan Cameron
     [not found]       ` <520CBEC6.8010400-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2013-08-16 10:07         ` Sebastian Andrzej Siewior
     [not found]           ` <20130816100702.GD26895-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
2013-08-16 10:17             ` Sebastian Andrzej Siewior
2013-08-16 11:33             ` Jonathan Cameron
2013-08-16 10:46               ` Sebastian Andrzej Siewior
2013-08-16 21:21                 ` Zubair Lutfullah :
2013-08-17  8:58         ` Zubair Lutfullah :
2013-08-16 12:53     ` Sebastian Andrzej Siewior [this message]
2013-08-16 21:18       ` Zubair Lutfullah :
2013-08-16 13:25     ` Sebastian Andrzej Siewior
2013-08-16 21:13       ` Zubair Lutfullah :
2013-08-16 14:59   ` Sebastian Andrzej Siewior
2013-08-16 21:10     ` Zubair Lutfullah :
2013-08-19 17:12   ` Sebastian Andrzej Siewior
     [not found]     ` <20130819171238.GA31610-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
2013-08-20 16:26       ` Zubair Lutfullah :
2013-08-14 18:57 ` [PATCH 0/4] iio: input: ti_am335x_adc: Add continuous sampling support round 5 Jonathan Cameron
2013-08-14 18:05   ` Sebastian Andrzej Siewior
2013-08-16 21:23   ` Zubair Lutfullah :
  -- strict thread matches above, loose matches on Subject: below --
2013-08-13 16:48 [PATCH 0/4] iio: input: ti_am335x_adc: Add continuous sampling support round 4 Zubair Lutfullah
2013-08-13 16:48 ` [PATCH 4/4] iio: ti_am335x_adc: Add continuous sampling and trigger support Zubair Lutfullah
2013-08-13 17:05   ` Lee Jones

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=20130816125340.GC1263@linutronix.de \
    --to=bigeasy-hfztesqfncyowbw4kg4ksq@public.gmane.org \
    --cc=Russ.Dill-l0cyMroinI0@public.gmane.org \
    --cc=dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=jic23-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org \
    --cc=linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=zubair.lutfullah-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /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).