diff mbox series

[3/4] iio: ABI: add ABI file for the LTC2672 DAC

Message ID 20240412032102.136071-4-kimseer.paller@analog.com (mailing list archive)
State Changes Requested
Headers show
Series Add driver for LTC2664 and LTC2672 | expand

Commit Message

Paller, Kim Seer April 12, 2024, 3:21 a.m. UTC
Define the sysfs interface for toggle capable channels.

Toggle enabled channels will have:

 * out_currentY_toggle_en
 * out_currentY_raw0
 * out_currentY_raw1
 * out_currentY_symbol

The common interface present in all channels is:

 * out_currentY_raw (not present in toggle enabled channels)
 * out_currentY_raw_available
 * out_currentY_powerdown
 * out_currentY_scale
 * out_currentY_offset

Co-developed-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com>
---
 .../ABI/testing/sysfs-bus-iio-dac-ltc2672     | 30 +++++++++++++++++++
 MAINTAINERS                                   |  1 +
 2 files changed, 31 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-dac-ltc2672

Comments

Jonathan Cameron April 13, 2024, 3:26 p.m. UTC | #1
On Fri, 12 Apr 2024 11:21:01 +0800
Kim Seer Paller <kimseer.paller@analog.com> wrote:

> Define the sysfs interface for toggle capable channels.
> 
> Toggle enabled channels will have:
> 
>  * out_currentY_toggle_en
>  * out_currentY_raw0
>  * out_currentY_raw1
>  * out_currentY_symbol
> 
> The common interface present in all channels is:
> 
>  * out_currentY_raw (not present in toggle enabled channels)
>  * out_currentY_raw_available
>  * out_currentY_powerdown
>  * out_currentY_scale
>  * out_currentY_offset
> 
> Co-developed-by: Michael Hennerich <michael.hennerich@analog.com>
> Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
> Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com>
> ---
>  .../ABI/testing/sysfs-bus-iio-dac-ltc2672     | 30 +++++++++++++++++++

You can only have per device ABI defined if that is the only user
of the ABI.  That may actually be true here but given I've asked you to generalize
the voltage equivalent, I think we've shown this is general enough that the current
version should also be raised to sysfs-bus-iio-dac

>  MAINTAINERS                                   |  1 +
>  2 files changed, 31 insertions(+)
>  create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-dac-ltc2672
> 
> diff --git a/Documentation/ABI/testing/sysfs-bus-iio-dac-ltc2672 b/Documentation/ABI/testing/sysfs-bus-iio-dac-ltc2672
> new file mode 100644
> index 000000000..b984d92f7
> --- /dev/null
> +++ b/Documentation/ABI/testing/sysfs-bus-iio-dac-ltc2672
> @@ -0,0 +1,30 @@
> +What:		/sys/bus/iio/devices/iio:deviceX/out_currentY_toggle_en
> +KernelVersion:	5.18
> +Contact:	linux-iio@vger.kernel.org
> +Description:
> +		Toggle enable. Write 1 to enable toggle or 0 to disable it. This is
> +		useful when one wants to change the DAC output codes. The way it should
> +		be done is:
> +
> +		- disable toggle operation;
> +		- change out_currentY_raw0 and out_currentY_raw1;
> +		- enable toggle operation.
> +
> +What:		/sys/bus/iio/devices/iio:deviceX/out_currentY_raw0
> +What:		/sys/bus/iio/devices/iio:deviceX/out_currentY_raw1
> +KernelVersion:	5.18
> +Contact:	linux-iio@vger.kernel.org
> +Description:
> +		It has the same meaning as out_currentY_raw. This attribute is
> +		specific to toggle enabled channels and refers to the DAC output
> +		code in INPUT_A (_raw0) and INPUT_B (_raw1). The same scale and offset
> +		as in out_currentY_raw applies.
> +
> +What:		/sys/bus/iio/devices/iio:deviceX/out_currentY_symbol
> +KernelVersion:	5.18
> +Contact:	linux-iio@vger.kernel.org
> +Description:
> +		Performs a SW toggle. This attribute is specific to toggle
> +		enabled channels and allows to toggle between out_currentY_raw0
> +		and out_currentY_raw1 through software. Writing 0 will select
> +		out_currentY_raw0 while 1 selects out_currentY_raw1.
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 9ed00b364..fba8bacc0 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -12843,6 +12843,7 @@ L:	linux-iio@vger.kernel.org
>  S:	Supported
>  W:	https://ez.analog.com/linux-software-drivers
>  F:	Documentation/ABI/testing/sysfs-bus-iio-dac-ltc2664
> +F:	Documentation/ABI/testing/sysfs-bus-iio-dac-ltc2672
>  F:	Documentation/devicetree/bindings/iio/dac/adi,ltc2664.yaml
>  
>  LTC2688 IIO DAC DRIVER
Paller, Kim Seer April 16, 2024, 2:18 p.m. UTC | #2
> -----Original Message-----
> From: Jonathan Cameron <jic23@kernel.org>
> Sent: Saturday, April 13, 2024 11:27 PM
> To: Paller, Kim Seer <KimSeer.Paller@analog.com>
> Cc: linux-iio@vger.kernel.org; devicetree@vger.kernel.org; linux-
> kernel@vger.kernel.org; Lars-Peter Clausen <lars@metafoo.de>; Rob Herring
> <robh@kernel.org>; Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>;
> Conor Dooley <conor+dt@kernel.org>; Liam Girdwood
> <lgirdwood@gmail.com>; Mark Brown <broonie@kernel.org>; David Lechner
> <dlechner@baylibre.com>; Hennerich, Michael
> <Michael.Hennerich@analog.com>
> Subject: Re: [PATCH 3/4] iio: ABI: add ABI file for the LTC2672 DAC
> 
> [External]
> 
> On Fri, 12 Apr 2024 11:21:01 +0800
> Kim Seer Paller <kimseer.paller@analog.com> wrote:
> 
> > Define the sysfs interface for toggle capable channels.
> >
> > Toggle enabled channels will have:
> >
> >  * out_currentY_toggle_en
> >  * out_currentY_raw0
> >  * out_currentY_raw1
> >  * out_currentY_symbol
> >
> > The common interface present in all channels is:
> >
> >  * out_currentY_raw (not present in toggle enabled channels)
> >  * out_currentY_raw_available
> >  * out_currentY_powerdown
> >  * out_currentY_scale
> >  * out_currentY_offset
> >
> > Co-developed-by: Michael Hennerich <michael.hennerich@analog.com>
> > Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
> > Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com>
> > ---
> >  .../ABI/testing/sysfs-bus-iio-dac-ltc2672     | 30 +++++++++++++++++++
> 
> You can only have per device ABI defined if that is the only user
> of the ABI.  That may actually be true here but given I've asked you to
> generalize
> the voltage equivalent, I think we've shown this is general enough that the
> current
> version should also be raised to sysfs-bus-iio-dac

I'm still getting familiar with ABI documentation. If I understand correctly,
generalizing the documentation to cover both parts would also mean we remove
the overlapping sections from the ltc2688 ABI. Is that the correct approach?
Jonathan Cameron April 20, 2024, 10:23 a.m. UTC | #3
On Tue, 16 Apr 2024 14:18:23 +0000
"Paller, Kim Seer" <KimSeer.Paller@analog.com> wrote:

> > -----Original Message-----
> > From: Jonathan Cameron <jic23@kernel.org>
> > Sent: Saturday, April 13, 2024 11:27 PM
> > To: Paller, Kim Seer <KimSeer.Paller@analog.com>
> > Cc: linux-iio@vger.kernel.org; devicetree@vger.kernel.org; linux-
> > kernel@vger.kernel.org; Lars-Peter Clausen <lars@metafoo.de>; Rob Herring
> > <robh@kernel.org>; Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>;
> > Conor Dooley <conor+dt@kernel.org>; Liam Girdwood
> > <lgirdwood@gmail.com>; Mark Brown <broonie@kernel.org>; David Lechner
> > <dlechner@baylibre.com>; Hennerich, Michael
> > <Michael.Hennerich@analog.com>
> > Subject: Re: [PATCH 3/4] iio: ABI: add ABI file for the LTC2672 DAC
> > 
> > [External]
> > 
> > On Fri, 12 Apr 2024 11:21:01 +0800
> > Kim Seer Paller <kimseer.paller@analog.com> wrote:
> >   
> > > Define the sysfs interface for toggle capable channels.
> > >
> > > Toggle enabled channels will have:
> > >
> > >  * out_currentY_toggle_en
> > >  * out_currentY_raw0
> > >  * out_currentY_raw1
> > >  * out_currentY_symbol
> > >
> > > The common interface present in all channels is:
> > >
> > >  * out_currentY_raw (not present in toggle enabled channels)
> > >  * out_currentY_raw_available
> > >  * out_currentY_powerdown
> > >  * out_currentY_scale
> > >  * out_currentY_offset
> > >
> > > Co-developed-by: Michael Hennerich <michael.hennerich@analog.com>
> > > Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
> > > Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com>
> > > ---
> > >  .../ABI/testing/sysfs-bus-iio-dac-ltc2672     | 30 +++++++++++++++++++  
> > 
> > You can only have per device ABI defined if that is the only user
> > of the ABI.  That may actually be true here but given I've asked you to
> > generalize
> > the voltage equivalent, I think we've shown this is general enough that the
> > current
> > version should also be raised to sysfs-bus-iio-dac  
> 
> I'm still getting familiar with ABI documentation. If I understand correctly,
> generalizing the documentation to cover both parts would also mean we remove
> the overlapping sections from the ltc2688 ABI. Is that the correct approach?
> 
> 

Yes.  To test this build the html docs. IIRC that will complain about duplicate
ABI definitions.  I'm sure there is a way to test just ABI docs build but
I've never really looked into it.

Jonathan
diff mbox series

Patch

diff --git a/Documentation/ABI/testing/sysfs-bus-iio-dac-ltc2672 b/Documentation/ABI/testing/sysfs-bus-iio-dac-ltc2672
new file mode 100644
index 000000000..b984d92f7
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-bus-iio-dac-ltc2672
@@ -0,0 +1,30 @@ 
+What:		/sys/bus/iio/devices/iio:deviceX/out_currentY_toggle_en
+KernelVersion:	5.18
+Contact:	linux-iio@vger.kernel.org
+Description:
+		Toggle enable. Write 1 to enable toggle or 0 to disable it. This is
+		useful when one wants to change the DAC output codes. The way it should
+		be done is:
+
+		- disable toggle operation;
+		- change out_currentY_raw0 and out_currentY_raw1;
+		- enable toggle operation.
+
+What:		/sys/bus/iio/devices/iio:deviceX/out_currentY_raw0
+What:		/sys/bus/iio/devices/iio:deviceX/out_currentY_raw1
+KernelVersion:	5.18
+Contact:	linux-iio@vger.kernel.org
+Description:
+		It has the same meaning as out_currentY_raw. This attribute is
+		specific to toggle enabled channels and refers to the DAC output
+		code in INPUT_A (_raw0) and INPUT_B (_raw1). The same scale and offset
+		as in out_currentY_raw applies.
+
+What:		/sys/bus/iio/devices/iio:deviceX/out_currentY_symbol
+KernelVersion:	5.18
+Contact:	linux-iio@vger.kernel.org
+Description:
+		Performs a SW toggle. This attribute is specific to toggle
+		enabled channels and allows to toggle between out_currentY_raw0
+		and out_currentY_raw1 through software. Writing 0 will select
+		out_currentY_raw0 while 1 selects out_currentY_raw1.
diff --git a/MAINTAINERS b/MAINTAINERS
index 9ed00b364..fba8bacc0 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -12843,6 +12843,7 @@  L:	linux-iio@vger.kernel.org
 S:	Supported
 W:	https://ez.analog.com/linux-software-drivers
 F:	Documentation/ABI/testing/sysfs-bus-iio-dac-ltc2664
+F:	Documentation/ABI/testing/sysfs-bus-iio-dac-ltc2672
 F:	Documentation/devicetree/bindings/iio/dac/adi,ltc2664.yaml
 
 LTC2688 IIO DAC DRIVER