From: Mircea Caprioru <mircea.caprioru@analog.com>
To: <jic23@kernel.org>
Cc: <Michael.Hennerich@analog.com>, <knaack.h@gmx.de>,
<lars@metafoo.de>, <pmeerw@pmeerw.net>,
<gregkh@linuxfoundation.org>, <linux-kernel@vger.kernel.org>,
<linux-iio@vger.kernel.org>, <devel@driverdev.osuosl.org>,
Mircea Caprioru <mircea.caprioru@analog.com>
Subject: [PATCH 2/2] staging: iio: adc: ad7192: Add clock output option
Date: Thu, 6 Dec 2018 11:10:52 +0200 [thread overview]
Message-ID: <20181206091052.7644-2-mircea.caprioru@analog.com> (raw)
In-Reply-To: <20181206091052.7644-1-mircea.caprioru@analog.com>
When using the internal clock the device has an option in which the clock
output is available on MCLK2 pin. This patch adds a dt binding for enabling
this property.
Signed-off-by: Mircea Caprioru <mircea.caprioru@analog.com>
---
drivers/staging/iio/adc/ad7192.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c
index 8a4e6ede42b3..a11c8a82bb7c 100644
--- a/drivers/staging/iio/adc/ad7192.c
+++ b/drivers/staging/iio/adc/ad7192.c
@@ -611,6 +611,10 @@ static const struct iio_chan_spec ad7193_channels[] = {
static int ad7192_clock_select(struct spi_device *spi, struct ad7192_state *st)
{
int ret;
+ bool clock_out_en;
+
+ clock_out_en = of_property_read_bool(spi->dev.of_node,
+ "adi,int-clock-output-enable");
st->clock_sel = AD7192_CLK_EXT_MCLK2;
st->mclk = devm_clk_get(&spi->dev, "clk");
@@ -626,7 +630,10 @@ static int ad7192_clock_select(struct spi_device *spi, struct ad7192_state *st)
return PTR_ERR(st->mclk);
/* use internal clock */
- st->clock_sel = AD7192_CLK_INT;
+ if (!clock_out_en)
+ st->clock_sel = AD7192_CLK_INT;
+ else
+ st->clock_sel = AD7192_CLK_INT_CO;
st->fclk = AD7192_INT_FREQ_MHZ;
}
}
--
2.17.1
next prev parent reply other threads:[~2018-12-06 9:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-06 9:10 [PATCH 1/2] staging: iio: adc: ad7192: Add clock for external clock reference Mircea Caprioru
2018-12-06 9:10 ` Mircea Caprioru [this message]
2018-12-08 15:32 ` [PATCH 2/2] staging: iio: adc: ad7192: Add clock output option Jonathan Cameron
2018-12-08 15:29 ` [PATCH 1/2] staging: iio: adc: ad7192: Add clock for external clock reference Jonathan Cameron
2018-12-14 1:39 ` Stephen Boyd
2018-12-16 10:07 ` Jonathan Cameron
2019-01-24 22:41 ` Stephen Boyd
2019-01-25 8:16 ` Alexandru Ardelean
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=20181206091052.7644-2-mircea.caprioru@analog.com \
--to=mircea.caprioru@analog.com \
--cc=Michael.Hennerich@analog.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
/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