Linux IIO development
 help / color / mirror / Atom feed
From: David Lechner <dlechner@baylibre.com>
To: Angelo Dureghello <adureghello@baylibre.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Michael Hennerich <Michael.Hennerich@analog.com>,
	Jonathan Cameron <jic23@kernel.org>, Nuno Sa <nuno.sa@analog.com>
Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 6/9] iio: dac: ad3552r-hs: use instruction mode for configuration
Date: Fri, 10 Jan 2025 09:37:20 -0600	[thread overview]
Message-ID: <bacd718d-4e6c-48d7-860f-e6de26bed416@baylibre.com> (raw)
In-Reply-To: <20250110-wip-bl-ad3552r-axi-v0-iio-testing-carlos-v3-6-ab42aef0d840@baylibre.com>

On 1/10/25 4:24 AM, Angelo Dureghello wrote:
> From: Angelo Dureghello <adureghello@baylibre.com>
> 
> Use "instruction" mode over initial configuration and all other
> non-streaming operations.
> 
> DAC boots in streaming mode as default, and the driver is not
> changing this mode.
> 
> Instruction r/w is still working becouse instruction is processed

s/becouse/because/

> from the DAC after chip select is deasserted, this works until
> loop mode is 0 or greater than the instruction size.
> 
> All initial operations should be more safely done in instruction
> mode, a mode provided for this.
> 
> Signed-off-by: Angelo Dureghello <adureghello@baylibre.com>
> ---
>  drivers/iio/dac/ad3552r-hs.c | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
> 
> diff --git a/drivers/iio/dac/ad3552r-hs.c b/drivers/iio/dac/ad3552r-hs.c
> index 27949f207d42..991b11702273 100644
> --- a/drivers/iio/dac/ad3552r-hs.c
> +++ b/drivers/iio/dac/ad3552r-hs.c
> @@ -132,6 +132,13 @@ static int ad3552r_hs_buffer_postenable(struct iio_dev *indio_dev)
>  		return -EINVAL;
>  	}
>  
> +	/* Primary region access, set streaming mode (now in SPI + SDR). */
> +	ret = ad3552r_qspi_update_reg_bits(st,
> +					   AD3552R_REG_ADDR_INTERFACE_CONFIG_B,
> +					   AD3552R_MASK_SINGLE_INST, 0, 1);
> +	if (ret)
> +		return ret;

Do we need to undo this operation before we return in the case of an error
later in this function?

> +
>  	ret = st->data->bus_reg_write(st->back, AD3552R_REG_ADDR_STREAM_MODE,
>  				      loop_len, 1);
>  	if (ret)

  reply	other threads:[~2025-01-10 15:37 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-10 10:24 [PATCH v3 0/9] iio: ad3552r-hs: add support for ad3541/42r Angelo Dureghello Angelo Dureghello
2025-01-10 10:24 ` [PATCH v3 1/9] iio: dac: ad3552r-common: fix ad3541/2r ranges Angelo Dureghello
2025-01-13 15:56   ` Nuno Sá
2025-01-10 10:24 ` [PATCH v3 2/9] iio: dac: ad3552r-hs: clear reset status flag Angelo Dureghello
2025-01-12 15:04   ` Jonathan Cameron
2025-01-13 15:58     ` Nuno Sá
2025-01-13 16:57       ` Angelo Dureghello
2025-01-10 10:24 ` [PATCH v3 3/9] iio: dac: adi-axi-dac: modify stream enable Angelo Dureghello
2025-01-13 16:00   ` Nuno Sá
2025-01-10 10:24 ` [PATCH v3 4/9] iio: dac: adi-axi-dac: add bus mode setup Angelo Dureghello
2025-01-13 16:05   ` Nuno Sá
2025-01-10 10:24 ` [PATCH v3 5/9] iio: dac: ad3552r-hs: fix message on wrong chip id Angelo Dureghello
2025-01-13 16:07   ` Nuno Sá
2025-01-10 10:24 ` [PATCH v3 6/9] iio: dac: ad3552r-hs: use instruction mode for configuration Angelo Dureghello
2025-01-10 15:37   ` David Lechner [this message]
2025-01-13 16:08     ` Nuno Sá
2025-01-10 10:24 ` [PATCH v3 7/9] iio: dac: ad3552r: share model data structures Angelo Dureghello
2025-01-10 15:39   ` David Lechner
2025-01-13 16:10   ` Nuno Sá
2025-01-10 10:24 ` [PATCH v3 8/9] iio: dac: ad3552r-hs: add ad3541/2r support Angelo Dureghello
2025-01-10 16:12   ` David Lechner
2025-01-12 15:06   ` Jonathan Cameron
2025-01-10 10:24 ` [PATCH v3 9/9] iio: dac: ad3552r-hs: update function name (non functional) Angelo Dureghello
2025-01-10 16:14   ` David Lechner
2025-01-13 16:11   ` Nuno Sá
2025-01-13 20:55     ` Angelo Dureghello

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=bacd718d-4e6c-48d7-860f-e6de26bed416@baylibre.com \
    --to=dlechner@baylibre.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=adureghello@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    /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