linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Beniamin Bia <beniamin.bia@analog.com>
To: <jic23@kernel.org>
Cc: <linux-iio@vger.kernel.org>, Beniamin Bia <beniamin.bia@analog.com>
Subject: [PATCH 3/5] iio: adc: ad7606: Allow reconfigration after reset
Date: Wed, 3 Jul 2019 17:36:46 +0300	[thread overview]
Message-ID: <20190703143648.24402-3-beniamin.bia@analog.com> (raw)
In-Reply-To: <20190703143648.24402-1-beniamin.bia@analog.com>

According to datasheet, ad7616 require at least 15ms after a restart
to fully reconfigure and being able to receive new commands via spi.

Signed-off-by: Beniamin Bia <beniamin.bia@analog.com>
---
 drivers/iio/adc/ad7606.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/iio/adc/ad7606.c b/drivers/iio/adc/ad7606.c
index 9eec3db01a17..a6034cf7238a 100644
--- a/drivers/iio/adc/ad7606.c
+++ b/drivers/iio/adc/ad7606.c
@@ -594,6 +594,10 @@ int ad7606_probe(struct device *dev, int irq, void __iomem *base_address,
 	if (ret)
 		dev_warn(st->dev, "failed to RESET: no RESET GPIO specified\n");
 
+	/* AD7616 requires al least 15ms to reconfigure after a reset */
+	if (msleep_interruptible(15))
+		return -ERESTARTSYS;
+
 	st->write_scale = ad7606_write_scale_hw;
 	st->write_os = ad7606_write_os_hw;
 
-- 
2.17.1


  parent reply	other threads:[~2019-07-03 13:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-03 14:36 [PATCH 1/5] iio: adc: ad7606: Move common channel definition to header Beniamin Bia
2019-07-03 14:36 ` [PATCH 2/5] iio: adc: ad7606: Move spi dependent features to spi file Beniamin Bia
2019-07-03 14:36 ` Beniamin Bia [this message]
2019-07-03 14:36 ` [PATCH 4/5] iio: adc: ad7606: Add support for software mode for ad7616 Beniamin Bia
2019-07-14 15:54   ` Jonathan Cameron
2019-07-03 14:36 ` [PATCH 5/5] iio: adc: ad7606: Add debug " Beniamin Bia
2019-07-14 15:57   ` Jonathan Cameron
2019-07-18  6:27 [PATCH 1/5] iio: adc: ad7606: Move common channel definition to header Beniamin Bia
2019-07-18  6:27 ` [PATCH 3/5] iio: adc: ad7606: Allow reconfigration after reset Beniamin Bia
2019-07-28  7:57   ` Jonathan Cameron

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=20190703143648.24402-3-beniamin.bia@analog.com \
    --to=beniamin.bia@analog.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.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).