mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Nuno Sá" <noname.nuno@gmail.com>
To: "Angelo Dureghello" <adureghello@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Olivier Moysan" <olivier.moysan@foss.st.com>,
	"Michael Hennerich" <Michael.Hennerich@analog.com>
Cc: linux-iio@vger.kernel.org, linux-doc@vger.kernel.org,
	 linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 4/5] iio: dac: adi-axi-dac: add data source get
Date: Mon, 07 Apr 2025 17:13:43 +0100	[thread overview]
Message-ID: <b0c6eb83a052fe6e1656d47e118b1e70336e38d1.camel@gmail.com> (raw)
In-Reply-To: <20250407-wip-bl-ad3552r-fixes-v3-4-61874065b60f@baylibre.com>

On Mon, 2025-04-07 at 10:52 +0200, Angelo Dureghello wrote:
> From: Angelo Dureghello <adureghello@baylibre.com>
> 
> Add data source getter.
> 
> Signed-off-by: Angelo Dureghello <adureghello@baylibre.com>
> ---

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

>  drivers/iio/dac/adi-axi-dac.c | 30 ++++++++++++++++++++++++++++++
>  1 file changed, 30 insertions(+)
> 
> diff --git a/drivers/iio/dac/adi-axi-dac.c b/drivers/iio/dac/adi-axi-dac.c
> index
> f86acb98b0cffb09bf4d4626f932bf1edc911e2b..8ed5ad1fa24cef649056bc5f4ca80abbf28b
> 9323 100644
> --- a/drivers/iio/dac/adi-axi-dac.c
> +++ b/drivers/iio/dac/adi-axi-dac.c
> @@ -536,6 +536,35 @@ static int axi_dac_data_source_set(struct iio_backend
> *back, unsigned int chan,
>  	}
>  }
>  
> +static int axi_dac_data_source_get(struct iio_backend *back, unsigned int
> chan,
> +				   enum iio_backend_data_source *data)
> +{
> +	struct axi_dac_state *st = iio_backend_get_priv(back);
> +	int ret;
> +	u32 val;
> +
> +	if (chan > AXI_DAC_CHAN_CNTRL_MAX)
> +		return -EINVAL;
> +
> +	ret = regmap_read(st->regmap, AXI_DAC_CHAN_CNTRL_7_REG(chan), &val);
> +	if (ret)
> +		return ret;
> +
> +	switch (val) {
> +	case AXI_DAC_DATA_INTERNAL_TONE:
> +		*data = IIO_BACKEND_INTERNAL_CONTINUOUS_WAVE;
> +		return 0;
> +	case AXI_DAC_DATA_DMA:
> +		*data = IIO_BACKEND_EXTERNAL;
> +		return 0;
> +	case AXI_DAC_DATA_INTERNAL_RAMP_16BIT:
> +		*data = IIO_BACKEND_INTERNAL_RAMP_16BIT;
> +		return 0;
> +	default:
> +		return -EIO;
> +	}
> +}
> +
>  static int axi_dac_set_sample_rate(struct iio_backend *back, unsigned int
> chan,
>  				   u64 sample_rate)
>  {
> @@ -818,6 +847,7 @@ static const struct iio_backend_ops axi_ad3552r_ops = {
>  	.request_buffer = axi_dac_request_buffer,
>  	.free_buffer = axi_dac_free_buffer,
>  	.data_source_set = axi_dac_data_source_set,
> +	.data_source_get = axi_dac_data_source_get,
>  	.ddr_enable = axi_dac_ddr_enable,
>  	.ddr_disable = axi_dac_ddr_disable,
>  	.data_stream_enable = axi_dac_data_stream_enable,

  reply	other threads:[~2025-04-07 16:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-07  8:52 [PATCH v3 0/5] iio: ad3552r-hs: add support for internal ramp generator Angelo Dureghello
2025-04-07  8:52 ` [PATCH v3 1/5] iio: dac: adi-axi-dac: add cntrl chan check Angelo Dureghello
2025-04-07 16:11   ` Nuno Sá
2025-04-07  8:52 ` [PATCH v3 2/5] docs: iio: add documentation for ad3552r driver Angelo Dureghello
2025-04-07  8:52 ` [PATCH v3 3/5] iio: backend: add support for data source get Angelo Dureghello
2025-04-07 16:12   ` Nuno Sá
2025-04-07  8:52 ` [PATCH v3 4/5] iio: dac: adi-axi-dac: add " Angelo Dureghello
2025-04-07 16:13   ` Nuno Sá [this message]
2025-04-07  8:52 ` [PATCH v3 5/5] iio: dac: ad3552r-hs: add support for internal ramp Angelo Dureghello
2025-04-07 16:21   ` Nuno Sá

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=b0c6eb83a052fe6e1656d47e118b1e70336e38d1.camel@gmail.com \
    --to=noname.nuno@gmail.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=adureghello@baylibre.com \
    --cc=corbet@lwn.net \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=olivier.moysan@foss.st.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

all inboxes | Powered by JetHome®