From: Jonathan Cameron <jic23@kernel.org>
To: Beniamin Bia <beniamin.bia@analog.com>
Cc: <linux-iio@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<knaack.h@gmx.de>, <pmeerw@pmeerw.net>,
<Michael.Hennerich@analog.com>, <biabeniamin@outlook.com>,
Dragos Bogdan <dragos.bogdan@analog.com>
Subject: Re: [PATCH 2/4] iio: adc: ad7476: Add IIO_CHAN_INFO_RAW for AD7091R
Date: Sun, 15 Mar 2020 13:16:56 +0000 [thread overview]
Message-ID: <20200315131656.5baa8a42@archlinux> (raw)
In-Reply-To: <20200311084328.17680-2-beniamin.bia@analog.com>
On Wed, 11 Mar 2020 10:43:26 +0200
Beniamin Bia <beniamin.bia@analog.com> wrote:
> From: Dragos Bogdan <dragos.bogdan@analog.com>
>
> When CONVST signal is generated internally, IIO_CHAN_INFO_RAW can be
> made available for AD7091R for single reads. This patch enables it and
> makes supporting more devices by this driver easier.
>
> Signed-off-by: Dragos Bogdan <dragos.bogdan@analog.com>
> Signed-off-by: Beniamin Bia <beniamin.bia@analog.com>
Applied.
Thanks,
Jonathan
> ---
> drivers/iio/adc/ad7476.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/iio/adc/ad7476.c b/drivers/iio/adc/ad7476.c
> index 32e857dfec9c..3b48073dd62d 100644
> --- a/drivers/iio/adc/ad7476.c
> +++ b/drivers/iio/adc/ad7476.c
> @@ -29,6 +29,8 @@ struct ad7476_state;
> struct ad7476_chip_info {
> unsigned int int_vref_uv;
> struct iio_chan_spec channel[2];
> + /* channels used when convst gpio is defined */
> + struct iio_chan_spec convst_channel[2];
> void (*reset)(struct ad7476_state *);
> };
>
> @@ -109,6 +111,8 @@ static int ad7476_scan_direct(struct ad7476_state *st)
> {
> int ret;
>
> + ad7091_convst(st);
> +
> ret = spi_sync(st->spi, &st->msg);
> if (ret)
> return ret;
> @@ -176,6 +180,8 @@ static int ad7476_read_raw(struct iio_dev *indio_dev,
> #define AD7940_CHAN(bits) _AD7476_CHAN((bits), 15 - (bits), \
> BIT(IIO_CHAN_INFO_RAW))
> #define AD7091R_CHAN(bits) _AD7476_CHAN((bits), 16 - (bits), 0)
> +#define AD7091R_CONVST_CHAN(bits) _AD7476_CHAN((bits), 16 - (bits), \
> + BIT(IIO_CHAN_INFO_RAW))
> #define ADS786X_CHAN(bits) _AD7476_CHAN((bits), 12 - (bits), \
> BIT(IIO_CHAN_INFO_RAW))
>
> @@ -183,6 +189,8 @@ static const struct ad7476_chip_info ad7476_chip_info_tbl[] = {
> [ID_AD7091R] = {
> .channel[0] = AD7091R_CHAN(12),
> .channel[1] = IIO_CHAN_SOFT_TIMESTAMP(1),
> + .convst_channel[0] = AD7091R_CONVST_CHAN(12),
> + .convst_channel[1] = IIO_CHAN_SOFT_TIMESTAMP(1),
> .reset = ad7091_reset,
> },
> [ID_AD7276] = {
> @@ -288,6 +296,9 @@ static int ad7476_probe(struct spi_device *spi)
> indio_dev->channels = st->chip_info->channel;
> indio_dev->num_channels = 2;
> indio_dev->info = &ad7476_info;
> +
> + if (st->convst_gpio && st->chip_info->convst_channel)
> + indio_dev->channels = st->chip_info->convst_channel;
> /* Setup default message */
>
> st->xfer.rx_buf = &st->data;
next prev parent reply other threads:[~2020-03-15 13:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-11 8:43 [PATCH 1/4] iio: adc: ad7476: Generate CONVST signal internally Beniamin Bia
2020-03-11 8:43 ` [PATCH 2/4] iio: adc: ad7476: Add IIO_CHAN_INFO_RAW for AD7091R Beniamin Bia
2020-03-15 13:16 ` Jonathan Cameron [this message]
2020-03-11 8:43 ` [PATCH 3/4] iio: adc: ad7476: Add AD7091 support Beniamin Bia
2020-03-15 13:17 ` Jonathan Cameron
2020-03-11 8:43 ` [PATCH 4/4] iio: adc: ad7476: implement devm_add_action_or_reset Beniamin Bia
2020-03-15 13:18 ` Jonathan Cameron
2020-03-15 13:15 ` [PATCH 1/4] iio: adc: ad7476: Generate CONVST signal internally 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=20200315131656.5baa8a42@archlinux \
--to=jic23@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=beniamin.bia@analog.com \
--cc=biabeniamin@outlook.com \
--cc=dragos.bogdan@analog.com \
--cc=knaack.h@gmx.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;
as well as URLs for NNTP newsgroup(s).