Linux-IIO Archive mirror
 help / color / mirror / Atom feed
From: David Lechner <dlechner@baylibre.com>
To: nuno.sa@analog.com
Cc: linux-iio@vger.kernel.org, Lars-Peter Clausen <lars@metafoo.de>,
	 Michael Hennerich <Michael.Hennerich@analog.com>,
	Jonathan Cameron <jic23@kernel.org>
Subject: Re: [PATCH] iio: adc: adi-axi-adc: make sure DRP is locked on enable
Date: Tue, 7 May 2024 16:50:15 -0500	[thread overview]
Message-ID: <CAMknhBFLtf5KKoVaMPm18=8wNW_zvLq-iFt2R-zwcHuFQ-LUBQ@mail.gmail.com> (raw)
In-Reply-To: <20240506-dev-axi-adc-drp-v1-1-8d6a856f909e@analog.com>

On Mon, May 6, 2024 at 9:50 AM Nuno Sa via B4 Relay
<devnull+nuno.sa.analog.com@kernel.org> wrote:
>
> From: Nuno Sa <nuno.sa@analog.com>
>
> We enabling the core, make sure DRP (Dynamic Reconfiguration Port)

s/We/When/

> is locked. Most of the designs don't really use it but we still get the
> lock bit set. So let's do it all the time so the code is generic.
>
> While at it add proper mutex guards as we should not be able to disable
> the core in the middle of enabling it. Also reduce the timeout time to 1
> microsecond as it seems to be enough and goes in line with what we have
> on the similar DAC core (adi-axi-dac).
>
> Signed-off-by: Nuno Sa <nuno.sa@analog.com>
> ---
>  drivers/iio/adc/adi-axi-adc.c | 17 ++++++++++++++++-
>  1 file changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iio/adc/adi-axi-adc.c b/drivers/iio/adc/adi-axi-adc.c
> index 0cf0d81358fd5..782d8813bb43b 100644
> --- a/drivers/iio/adc/adi-axi-adc.c
> +++ b/drivers/iio/adc/adi-axi-adc.c
> @@ -42,6 +42,9 @@
>  #define ADI_AXI_ADC_REG_CTRL                   0x0044
>  #define    ADI_AXI_ADC_CTRL_DDR_EDGESEL_MASK   BIT(1)
>
> +#define AXI_ADC_DRP_STATUS                     0x0074

call it AXI_ADC_REG_DRP_STATUS for consistency?

> +#define   AXI_ADC_DRP_LOCKED                   BIT(17)
> +
>  /* ADC Channel controls */
>
>  #define ADI_AXI_REG_CHAN_CTRL(c)               (0x0400 + (c) * 0x40)

      reply	other threads:[~2024-05-07 21:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-06 14:50 [PATCH] iio: adc: adi-axi-adc: make sure DRP is locked on enable Nuno Sa via B4 Relay
2024-05-07 21:50 ` David Lechner [this message]

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='CAMknhBFLtf5KKoVaMPm18=8wNW_zvLq-iFt2R-zwcHuFQ-LUBQ@mail.gmail.com' \
    --to=dlechner@baylibre.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).