Re: [PATCH 4/4] iio: ti_am335x_adc: Add continuous sampling and trigger support

From
Zubair Lutfullah : <hidden>
Date
2013-08-16 22:14:53
Also in
linux-iio, lkml
Reply to
Sebastian Andrzej Siewior, 2013-08-16
On Fri, Aug 16, 2013 at 04:59:49PM +0200, Sebastian Andrzej Siewior wrote:
* Zubair Lutfullah | 2013-08-13 21:05:03 [+0100]:
quoted
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
…
quoted
+static int tiadc_buffer_postdisable(struct iio_dev *indio_dev)
+{
+	struct tiadc_device *adc_dev = iio_priv(indio_dev);
+	int config;
+
+	tiadc_step_config(indio_dev);
+	if (adc_dev->mfd_tscadc->tsc_cell == -1) {
+		config = tiadc_readl(adc_dev, REG_CTRL);
+		tiadc_writel(adc_dev, REG_CTRL, (config | CNTRLREG_TSCSSENB));
+	}
This kind of check is bad. The tsc cell may have been created but the
driver not enabled or loaded. Further you should document why you need
to enable / disable the ADC in this places and only if the TSC part is
not active.

Sebastian
Noted. I'll look into it.

Thanks for pointing it out.

Zubair
Thread (23 messages) 23 messages, 3 authors, last reply 2013-08-20
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help