From patchwork Mon Jul 25 19:39:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 9246391 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5FCF060757 for ; Mon, 25 Jul 2016 19:40:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B4E4212D9 for ; Mon, 25 Jul 2016 19:40:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3D21325819; Mon, 25 Jul 2016 19:40:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9B86B212D9 for ; Mon, 25 Jul 2016 19:40:45 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bRlk1-0004mf-N5; Mon, 25 Jul 2016 19:40:41 +0000 Received: from bh-25.webhostbox.net ([208.91.199.152]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bRljz-0002s5-60 for linux-rockchip@lists.infradead.org; Mon, 25 Jul 2016 19:40:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=roeck-us.net; s=default; h=Message-Id:Date:Subject:Cc:To:From; bh=zvok4cXkrYNfB4gxAQe0Jr4Lb1VbwJlh70hwOZa1h1k=; b=FR9uzBg6m6dJbnDd2i7QHJDFiz OGn4ellQPsw5XQhitTVDzfmBIpGbsh0+zl83dpLZF7Eiw8rq1J/El+uwRw94PeAfJBGnDWqHY7D7Y ZOXvDqf6cZbA6NpukwySaVqD2vnPGiPxm+liE5KYMuHAqI2IS9+KYIGWlmtYILDj8O7LnS7t4OcdH tnYNYd63rWcWsJqVTnXnc/gGsN9SNGxoA63JO5v58bnAcHb8GvUr8Iku2T5x1lUQF2GtQ3kUmWLBw qiH6SdODY0L5ryjw984cONnartX3+wqkju4DGhZfIA9LUdvDTdtUUiDvGyLEhcQLEB9Su9BunAr4N A07zr9cA==; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:57208 helo=localhost) by bh-25.webhostbox.net with esmtpa (Exim 4.86_1) (envelope-from ) id 1bRliQ-003lqd-Hv; Mon, 25 Jul 2016 19:39:04 +0000 From: Guenter Roeck To: Jonathan Cameron Subject: [PATCH] iio: adc: rockchip_saradc: Explicitly disable ADC on probe Date: Mon, 25 Jul 2016 12:39:00 -0700 Message-Id: <1469475540-26855-1-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.5.0 X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - lists.infradead.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: guenter@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160725_124039_321123_9673BC45 X-CRM114-Status: UNSURE ( 6.70 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Heiko Stuebner , linux-iio@vger.kernel.org, dianders@chromium.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Guenter Roeck , Caesar Wang MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Heiko Stuebner --- 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);