public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Rodrigo Alencar via B4 Relay
	<devnull+rodrigo.alencar.analog.com@kernel.org>
Cc: rodrigo.alencar@analog.com, linux-iio@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	Lars-Peter Clausen <lars@metafoo.de>,
	Michael Hennerich <Michael.Hennerich@analog.com>,
	David Lechner <dlechner@baylibre.com>,
	Andy Shevchenko <andy@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Philipp Zabel <p.zabel@pengutronix.de>
Subject: Re: [PATCH RFC 4/8] iio: frequency: ad9910: expose sysclk_frequency device attribute
Date: Sun, 1 Mar 2026 13:23:46 +0000	[thread overview]
Message-ID: <20260301132346.00ba1bdd@jic23-huawei> (raw)
In-Reply-To: <20260220-ad9910-iio-driver-v1-4-3b264aa48a10@analog.com>

On Fri, 20 Feb 2026 16:46:08 +0000
Rodrigo Alencar via B4 Relay <devnull+rodrigo.alencar.analog.com@kernel.org> wrote:

> From: Rodrigo Alencar <rodrigo.alencar@analog.com>
> 
> Add read-only sysclk_frequency sysfs attribute. This value is important
> for userspace to calculate values to populate the Parallel Port or the
> RAM data buffer.
> 
> Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com>
Can we not use sampling_frequency (kind of backwards but IIRC we've done it
before) to provide information on what the frequency of the DAC updating is?

Jonathan

> ---
>  drivers/iio/frequency/ad9910.c | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 
> diff --git a/drivers/iio/frequency/ad9910.c b/drivers/iio/frequency/ad9910.c
> index bb280972e84c..a72e3685f676 100644
> --- a/drivers/iio/frequency/ad9910.c
> +++ b/drivers/iio/frequency/ad9910.c
> @@ -789,10 +789,31 @@ static int ad9910_reg_access(struct iio_dev *indio_dev,
>  	return ret;
>  }
>  
> +static ssize_t sysclk_frequency_show(struct device *dev,
> +				     struct device_attribute *attr,
> +				     char *buf)
> +{
> +	struct ad9910_state *st = iio_priv(dev_to_iio_dev(dev));
> +
> +	return sysfs_emit(buf, "%u\n", st->data.sysclk_freq_hz);
> +}
> +
> +static IIO_DEVICE_ATTR_RO(sysclk_frequency, 0);
> +
> +static struct attribute *ad9910_attrs[] = {
> +	&iio_dev_attr_sysclk_frequency.dev_attr.attr,
> +	NULL
> +};
> +
> +static const struct attribute_group ad9910_attrs_group = {
> +	.attrs = ad9910_attrs,
> +};
> +
>  static const struct iio_info ad9910_info = {
>  	.read_raw = ad9910_read_raw,
>  	.write_raw = ad9910_write_raw,
>  	.write_raw_get_fmt = ad9910_write_raw_get_fmt,
> +	.attrs = &ad9910_attrs_group,
>  	.debugfs_reg_access = &ad9910_reg_access,
>  };
>  
> 


  reply	other threads:[~2026-03-01 13:23 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-20 16:46 [PATCH RFC 0/8] AD9910 Direct Digital Synthesizer Rodrigo Alencar via B4 Relay
2026-02-20 16:46 ` [PATCH RFC 1/8] dt-bindings: iio: frequency: add ad9910 Rodrigo Alencar via B4 Relay
2026-02-21 20:43   ` David Lechner
2026-02-21 22:43     ` Conor Dooley
2026-02-22 10:49       ` Rodrigo Alencar
2026-02-22 13:24         ` Conor Dooley
2026-02-22 10:47     ` Rodrigo Alencar
2026-02-22 20:28       ` David Lechner
2026-02-22 20:31       ` Conor Dooley
2026-03-01 12:50   ` Jonathan Cameron
2026-02-20 16:46 ` [PATCH RFC 2/8] iio: frequency: ad9910: initial driver implementation Rodrigo Alencar via B4 Relay
2026-03-01 13:20   ` Jonathan Cameron
2026-02-20 16:46 ` [PATCH RFC 3/8] iio: frequency: ad9910: add simple parallel port mode support Rodrigo Alencar via B4 Relay
2026-02-23  8:27   ` Andy Shevchenko
2026-03-01 13:22   ` Jonathan Cameron
2026-02-20 16:46 ` [PATCH RFC 4/8] iio: frequency: ad9910: expose sysclk_frequency device attribute Rodrigo Alencar via B4 Relay
2026-03-01 13:23   ` Jonathan Cameron [this message]
2026-02-20 16:46 ` [PATCH RFC 5/8] iio: frequency: ad9910: add digital ramp generator support Rodrigo Alencar via B4 Relay
2026-03-01 13:26   ` Jonathan Cameron
2026-02-20 16:46 ` [PATCH RFC 6/8] iio: frequency: ad9910: add RAM mode support Rodrigo Alencar via B4 Relay
2026-03-01 13:31   ` Jonathan Cameron
2026-03-03 15:32     ` Rodrigo Alencar
2026-03-03 17:16       ` Nuno Sá
2026-03-03 17:32         ` Rodrigo Alencar
2026-03-07 14:07     ` Jonathan Cameron
2026-03-10 17:40       ` Rodrigo Alencar
2026-03-11  0:11         ` David Lechner
2026-03-11 13:11           ` Rodrigo Alencar
2026-03-11 16:54             ` Nuno Sá
2026-03-11 17:08               ` Rodrigo Alencar
2026-02-20 16:46 ` [PATCH RFC 7/8] iio: frequency: ad9910: add output shift keying support Rodrigo Alencar via B4 Relay
2026-02-20 16:46 ` [PATCH RFC 8/8] iio: frequency: ad9910: add channel labels Rodrigo Alencar via B4 Relay
2026-02-21 20:16 ` [PATCH RFC 0/8] AD9910 Direct Digital Synthesizer David Lechner
2026-02-22 10:01   ` Rodrigo Alencar
2026-02-22 20:32     ` David Lechner
2026-02-23 10:02       ` Nuno Sá
2026-03-01 13:38         ` Jonathan Cameron
2026-03-02 10:22           ` Rodrigo Alencar
2026-03-07 14:09             ` Jonathan Cameron
2026-03-07 16:50               ` David Lechner
2026-03-07 16:58                 ` Jonathan Cameron
2026-03-07 18:54                   ` Rodrigo Alencar
2026-03-07 20:01                     ` David Lechner
2026-03-08 18:12                       ` Jonathan Cameron
2026-03-09  9:52                         ` Rodrigo Alencar
2026-03-09 13:14                           ` 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=20260301132346.00ba1bdd@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=devnull+rodrigo.alencar.analog.com@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=robh@kernel.org \
    --cc=rodrigo.alencar@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