linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Nuno Sá" <noname.nuno@gmail.com>
To: Antoniu Miclaus <antoniu.miclaus@analog.com>,
	jic23@kernel.org,  robh@kernel.org, conor+dt@kernel.org,
	devicetree@vger.kernel.org,  linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] iio: adc: ad4851: add spi 3-wire support
Date: Fri, 27 Jun 2025 16:52:49 +0100	[thread overview]
Message-ID: <301b3c390b417c1268c0c1d3014d52f8b8660aba.camel@gmail.com> (raw)
In-Reply-To: <20250626104024.8645-2-antoniu.miclaus@analog.com>

On Thu, 2025-06-26 at 13:40 +0300, Antoniu Miclaus wrote:
> Add support for 3-wire configuration within the driver.
> By default 4-wire configuration is used.
> 
> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
> ---

Had to look twice :). Commit message could have been better by saying that reset
value is 3-wire. Anyways:

Reviewed-by: Nuno Sá <nuno.sa@analog.com>

>  drivers/iio/adc/ad4851.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/iio/adc/ad4851.c b/drivers/iio/adc/ad4851.c
> index 31e1e02c0ce3..1ad77f2a4580 100644
> --- a/drivers/iio/adc/ad4851.c
> +++ b/drivers/iio/adc/ad4851.c
> @@ -444,10 +444,12 @@ static int ad4851_setup(struct ad4851_state *st)
>  	if (ret)
>  		return ret;
>  
> -	ret = regmap_write(st->regmap, AD4851_REG_INTERFACE_CONFIG_A,
> -			   AD4851_SDO_ENABLE);
> -	if (ret)
> -		return ret;
> +	if (!(st->spi->mode & SPI_3WIRE)) {
> +		ret = regmap_write(st->regmap, AD4851_REG_INTERFACE_CONFIG_A,
> +				   AD4851_SDO_ENABLE);
> +		if (ret)
> +			return ret;
> +	}
>  
>  	ret = regmap_read(st->regmap, AD4851_REG_PRODUCT_ID_L, &product_id);
>  	if (ret)

  reply	other threads:[~2025-06-27 15:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-26 10:40 [PATCH 1/2] dt-bindings: iio: adc: ad4851: add spi-3wire Antoniu Miclaus
2025-06-26 10:40 ` [PATCH 2/2] iio: adc: ad4851: add spi 3-wire support Antoniu Miclaus
2025-06-27 15:52   ` Nuno Sá [this message]
2025-06-27 21:33 ` [PATCH 1/2] dt-bindings: iio: adc: ad4851: add spi-3wire Rob Herring (Arm)
2025-06-28 15:23 ` 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=301b3c390b417c1268c0c1d3014d52f8b8660aba.camel@gmail.com \
    --to=noname.nuno@gmail.com \
    --cc=antoniu.miclaus@analog.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@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).