linux-rockchip.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: adc: rockchip_saradc: Explicitly disable ADC on probe
@ 2016-07-25 19:39 Guenter Roeck
       [not found] ` <1469475540-26855-1-git-send-email-linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Guenter Roeck @ 2016-07-25 19:39 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Heiko Stuebner, linux-iio-u79uwXL29TY76Z2rM5mHXA,
	linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Caesar Wang,
	dianders-F7+t8E8rja9g9hUCZPvPmw, Guenter Roeck

If the ADC is read for the first time, the caller gets a timeout error,
and the kernel log shows

read channel() error: -110

The ADC may be enabled on boot, and needs to be explicitly disabled
for a read sequence to work (otherwise there is no completion interrupt).
Disaple it explicitly in the probe function.

Fixes: 44d6f2ef94f9 ("iio: adc: add driver for Rockchip saradc")
Signed-off-by: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
---
 drivers/iio/adc/rockchip_saradc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/iio/adc/rockchip_saradc.c b/drivers/iio/adc/rockchip_saradc.c
index f9ad6c2d6821..6aa3271d86b5 100644
--- a/drivers/iio/adc/rockchip_saradc.c
+++ b/drivers/iio/adc/rockchip_saradc.c
@@ -280,6 +280,9 @@ static int rockchip_saradc_probe(struct platform_device *pdev)
 		goto err_pclk;
 	}
 
+	/* Make sure ADC is disabled */
+	writel_relaxed(0, info->regs + SARADC_CTRL);
+
 	platform_set_drvdata(pdev, indio_dev);
 
 	indio_dev->name = dev_name(&pdev->dev);
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-08-15 19:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-25 19:39 [PATCH] iio: adc: rockchip_saradc: Explicitly disable ADC on probe Guenter Roeck
     [not found] ` <1469475540-26855-1-git-send-email-linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2016-07-25 19:41   ` Heiko Stübner
2016-07-26  2:51   ` Caesar Wang
     [not found]     ` <5796D036.1060101-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-07-26  3:22       ` Guenter Roeck
2016-07-26  6:48         ` Caesar Wang
     [not found]         ` <5796D792.4080407-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2016-08-15 18:04           ` Jonathan Cameron
     [not found]             ` <8ebf4c53-21e2-0220-1756-beb57af32304-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2016-08-15 19:52               ` Guenter Roeck

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).