linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Jorge Marques <jorge.marques@analog.com>
Cc: "Lars-Peter Clausen" <lars@metafoo.de>,
	"Michael Hennerich" <Michael.Hennerich@analog.com>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Jonathan Corbet" <corbet@lwn.net>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org
Subject: Re: [PATCH 2/7] docs: iio: New docs for ad4062 driver
Date: Sat, 18 Oct 2025 16:21:13 +0100	[thread overview]
Message-ID: <20251018162113.002d92f7@jic23-huawei> (raw)
In-Reply-To: <20251013-staging-ad4062-v1-2-0f8ce7fef50c@analog.com>

On Mon, 13 Oct 2025 09:28:00 +0200
Jorge Marques <jorge.marques@analog.com> wrote:

> This adds a new page to document how to use the ad4062 ADC driver.
> 
> Signed-off-by: Jorge Marques <jorge.marques@analog.com>
Hi Jorge,

Various comments inline.

Thanks,

Jonathan

> ---
>  Documentation/iio/ad4062.rst | 89 ++++++++++++++++++++++++++++++++++++++++++++
>  MAINTAINERS                  |  1 +
>  2 files changed, 90 insertions(+)
> 
> diff --git a/Documentation/iio/ad4062.rst b/Documentation/iio/ad4062.rst
> new file mode 100644
> index 0000000000000000000000000000000000000000..b486d7fe1916d2963c94581be3696cf58d51ca48
> --- /dev/null
> +++ b/Documentation/iio/ad4062.rst
> @@ -0,0 +1,89 @@
> +.. SPDX-License-Identifier: GPL-2.0-only
> +
> +=============
> +AD4062 driver
> +=============
> +
> +ADC driver for Analog Devices Inc. AD4060/AD4062 devices. The module name is
> +``ad4062``.
> +
> +Supported devices
> +=================
> +
> +The following chips are supported by this driver:
> +
> +* `AD4060 <https://www.analog.com/AD4060>`_
> +* `AD4062 <https://www.analog.com/AD4062>`_
> +
> +Wiring modes
> +============
> +
> +The ADC is interfaced through an I3C bus, and contains two programmable GPIOs.
This raises a question on whether it makes sense for the binding to support providing
gpios from the start (as alternative to interrupts).  Seems like the two pins
are completely interchangeable so one might well be 'left' for use by some other
device that needs a gpio pin.

I don't mind that much if we want to leave the binding support for that for later
but in the ideal case we'd have it from the start (even if the driver doesn't
support it until we have a user).

> +
> +The ADC convert-start happens on the SDA rising edge of the I3C stop (P) bit
> +at the end of the read command.
> +
> +The two programmable GPIOS are optional and have a role assigned if present in
> +the devicetree:
> +
> +- GP1: Is assigned the role of Data Ready signal.

I assume that's only the case if GP1 is provided?  If GP0 is the only one
we should allow use that for data ready.  As long as the DT allows that it is
permissible for the driver to not do so for now.

> +
> +Device attributes
> +=================
> +
> +The ADC contains only one channel with following attributes:
> +
> +.. list-table:: Channel attributes
> +   :header-rows: 1
> +
> +   * - Attribute
> +     - Description
> +   * - ``in_voltage_calibscale``
> +     - Sets the scale factor to multiply the raw value.
That's confusing.  This should be hardware 'tweak' to compensate for
calibration or similar.  The text doesn't make it clear where that multiply
is happening. Sounds too much like _scale.

> +   * - ``in_voltage_oversampling_ratio``
> +     - Sets device's burst averaging mode to over sample using the
> +       internal sample rate. Value 1 disable the burst averaging mode.
> +   * - ``in_voltage_oversampling_ratio_available``
> +     - List of available oversampling values.
> +   * - ``in_voltage_raw``
> +     - Returns the raw ADC voltage value.
> +   * - ``in_voltage_scale``
> +     - Returs the channel scale in reference to the reference voltage

Spell check needed.  Also this describes why it might take different values
but not the bit users care about which is the standard ABI thing of
Real value in mV = _raw * _scale 

> +       ``ref-supply``.
> +
> +Also contain the following device attributes:
> +
> +.. list-table:: Device attributes
> +   :header-rows: 1
> +
> +   * - Attribute
> +     - Description
> +   * - ``samling_frequency``

Check these.. sampling_frequency.

> +     - Sets the sets the device internal sample rate, used in the burst
> +       averaging mode.

It's not use otherwise?  That's unusual ABI.  I'd expect it to give
the right value at least when burst mode isn't used. Or is burst mode
the only way we do buffered capture?

> +   * - ``sampling_frequency_available``
> +     - Lists the available device internal sample rates.
> +
> +Interrupts
> +==========
> +
> +The interrupts are mapped through the ``interrupt-names`` and ``interrupts``
> +properties.
> +
> +The ``interrupt-names`` ``gp1`` entry sets the role of Data Ready signal.
> +If it is not present, the driver fallback to enabling the same role as an
> +I3C IBI.

It feels like it should be easy to use the other GPO pin in this case if that
is present. 

> +
> +Low-power mode
> +==============
> +
> +The device enters low-power mode on idle to save power. Enabling an event puts
> +the device out of the low-power since the ADC autonomously samples to assert
> +the event condition.
> +
> +Unimplemented features
> +======================
> +
> +- Monitor mode
> +- Trigger mode
> +- Averaging mode
> diff --git a/MAINTAINERS b/MAINTAINERS
> index afbfaeba5387b9fbfa9bf1443a059c47dd596d45..ce012c6c719023d3c0355676a335a55d92cf424c 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -1405,6 +1405,7 @@ M:	Jorge Marques <jorge.marques@analog.com>
>  S:	Supported
>  W:	https://ez.analog.com/linux-software-drivers
>  F:	Documentation/devicetree/bindings/iio/adc/adi,ad4062.yaml
> +F:	Documentation/iio/ad4062.rst
>  
>  ANALOG DEVICES INC AD4080 DRIVER
>  M:	Antoniu Miclaus <antoniu.miclaus@analog.com>
> 


  reply	other threads:[~2025-10-18 15:21 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-13  7:27 [PATCH 0/7] Add support for AD4062 device family Jorge Marques
2025-10-13  7:27 ` [PATCH 1/7] dt-bindings: iio: adc: Add adi,ad4062 Jorge Marques
2025-10-13 19:50   ` Conor Dooley
2025-10-26 16:35     ` Jorge Marques
2025-10-18 15:11   ` Jonathan Cameron
2025-10-26 16:37     ` Jorge Marques
2025-10-13  7:28 ` [PATCH 2/7] docs: iio: New docs for ad4062 driver Jorge Marques
2025-10-18 15:21   ` Jonathan Cameron [this message]
2025-10-28 15:31     ` Jorge Marques
2025-11-02 12:37       ` Jonathan Cameron
2025-11-03 10:19         ` Jorge Marques
2025-11-03 12:22           ` Jorge Marques
2025-11-09 12:16             ` Jonathan Cameron
2025-11-09 12:31           ` Jonathan Cameron
2025-10-13  7:28 ` [PATCH 3/7] iio: adc: Add support for ad4062 Jorge Marques
2025-10-18 16:10   ` Jonathan Cameron
2025-11-23 19:48     ` Jorge Marques
2025-11-24  7:43       ` Andy Shevchenko
2025-11-24  8:57         ` Jorge Marques
2025-11-24  9:10           ` Andy Shevchenko
2025-12-06 16:31             ` Jonathan Cameron
2025-11-24  9:11           ` Andy Shevchenko
2025-11-24  9:24             ` Jorge Marques
2025-10-13  7:28 ` [PATCH 4/7] docs: iio: ad4062: Add IIO Trigger support Jorge Marques
2025-10-13  7:28 ` [PATCH 5/7] iio: adc: " Jorge Marques
2025-10-18 16:14   ` Jonathan Cameron
2025-11-23 19:48     ` Jorge Marques
2025-10-13  7:28 ` [PATCH 6/7] docs: iio: ad4062: Add IIO Events support Jorge Marques
2025-10-13  7:28 ` [PATCH 7/7] iio: adc: " Jorge Marques
2025-10-18 16:26   ` Jonathan Cameron
2025-11-23 19:48     ` Jorge Marques

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=20251018162113.002d92f7@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jorge.marques@analog.com \
    --cc=krzk+dt@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=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).