Skip to content

Add support for AD7091R-2/-4/-8

Marcelo Schmitt linux-devicetree linux-iio lkml 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest11 patches 4 repliesIn review
  2. v415 patches 19 repliesApplied
  3. v313 patches 19 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v27 patches9 repliesSuperseded
v17 patches3 repliesSuperseded

Changes in v5 from the cover letter · 20 lines

- Patch 1: Event callbacks
* Moved to begin of the series to easy backport;
* Reverted to original event attributes;
* Reworked event configuration to do per direction per channel enable/disable;
* Improved commit message;
* Added fixes tag;
* Added Suggested-by tag.
- Patch 2: Enable internal vref
* Added fixes tag and improved commit message;
* Now earlier in the series to easy backport;
* Used regmap_set_bits() to make code more neat.
- Patch 3: Move generic AD7091R code
* event specs moved earlier in patch 1.
- Patch 4: Move chip init data
* Renamed field to make initialization clearer: irq_info -> info_irq.
* Fixed ad7091r_init_info initialization by passing pointers to info structs;
- Patch 10: Add ad7091r8 support
* Moved bitfield.h include to patch event callbacks patch;
* Dropped GPIO consumer include on ad7091r-base.h and added gpio_desc;
* Removed extra space before devm_gpiod_get_optional().

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11iio: adc: ad7091r: Allow users to configure device eventsdrivers/iio/adc/ad7091r-base.c drivers/iio/adc/ad7091r-base.h drivers/iio/adc/ad7091r5.c+166 -240 replies
2/11iio: adc: ad7091r: Enable internal vref if external vref is not supplieddrivers/iio/adc/ad7091r-base.c drivers/iio/adc/ad7091r-base.h+9 -00 replies
3/11iio: adc: ad7091r: Move generic AD7091R code to base driver and header filedrivers/iio/adc/ad7091r-base.c drivers/iio/adc/ad7091r-base.h drivers/iio/adc/ad7091r5.c+42 -370 replies
4/11iio: adc: ad7091r: Move chip init data to container structdrivers/iio/adc/ad7091r-base.c drivers/iio/adc/ad7091r-base.h drivers/iio/adc/ad7091r5.c+55 -300 replies
5/11iio: adc: ad7091r: Remove unneeded probe parametersdrivers/iio/adc/ad7091r-base.c drivers/iio/adc/ad7091r-base.h drivers/iio/adc/ad7091r5.c+7 -90 replies
6/11iio: adc: ad7091r: Set device mode through chip_info callbackdrivers/iio/adc/ad7091r-base.c drivers/iio/adc/ad7091r-base.h drivers/iio/adc/ad7091r5.c+39 -370 replies
7/11iio: adc: ad7091r: Add chip_info callback to get conversion result channeldrivers/iio/adc/ad7091r-base.c drivers/iio/adc/ad7091r-base.h drivers/iio/adc/ad7091r5.c+14 -50 replies
8/11iio: adc: Split AD7091R-5 config symboldrivers/iio/adc/Kconfig drivers/iio/adc/Makefile+6 -10 replies
9/11dt-bindings: iio: Add AD7091R-8Documentation/devicetree/bindings/iio/adc/adi,ad7091r5.yaml+78 -40 replies
10/11iio: adc: Add support for AD7091R-8drivers/iio/adc/Kconfig drivers/iio/adc/Makefile drivers/iio/adc/ad7091r-base.c +2 more+297 -00 replies
11/11MAINTAINERS: Add MAINTAINERS entry for AD7091RMAINTAINERS+8 -03 replies

Reviews trailers per patch

1 of 11 patches has a Reviewed-by or Acked-by.

PatchConor Dooley
1/11
2/11
3/11
4/11
5/11
6/11
7/11
8/11
9/11R-b
10/11
11/11

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH v5 00/11] Add support for AD7091R-2/-4/-8

From: Marcelo Schmitt <[email protected]>

----------------- Updates -----------------

Applied all suggestions.
Only submitting patches not applied on v4:
Patches after ("Align arguments to function call parenthesis").

Change log v4 -> v5:
- Patch 1: Event callbacks
* Moved to begin of the series to easy backport;
* Reverted to original event attributes;
* Reworked event configuration to do per direction per channel enable/disable;
* Improved commit message;
* Added fixes tag;
* Added Suggested-by tag.
- Patch 2: Enable internal vref
* Added fixes tag and improved commit message;
* Now earlier in the series to easy backport;
* Used regmap_set_bits() to make code more neat.
- Patch 3: Move generic AD7091R code
* event specs moved earlier in patch 1.
- Patch 4: Move chip init data
* Renamed field to make initialization clearer: irq_info -> info_irq.
* Fixed ad7091r_init_info initialization by passing pointers to info structs;
- Patch 10: Add ad7091r8 support
* Moved bitfield.h include to patch event callbacks patch;
* Dropped GPIO consumer include on ad7091r-base.h and added gpio_desc;
* Removed extra space before devm_gpiod_get_optional().

So, since we are already fixing a few things here, maybe it's a good time to comment about the event ABI.
I see the event config files under events directory appearing as in_voltage0_thresh_falling_value
in_voltage0_thresh_rising_value
in_voltage1_thresh_falling_value
and so on.
They don't have the _raw part of the name as documented in the IIO ABI [1]. Not sure if that is how it's intended to be, the driver is still missing something, or maybe ABI is somehow outdated.
Anyway, if that is also something to be fixed then let me know I'll have a look at it.

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git/tree/Documentation/ABI/testing/sysfs-bus-iio#n887

Thanks,
Marcelo

----------------- Context -----------------

This series adds support for AD7091R-2/-4/-8 ADCs which can do single shot or sequenced readings. Threshold events are also supported.
Overall, AD7091R-2/-4/-8 are very similar to AD7091R-5 except they use SPI interface.

Changes have been tested with raspberrypi and eval board on raspberrypi kernel 6.7-rc3 from raspberrypi fork.

Marcelo Schmitt (11):
iio: adc: ad7091r: Allow users to configure device events
iio: adc: ad7091r: Enable internal vref if external vref is not
supplied
iio: adc: ad7091r: Move generic AD7091R code to base driver and header
file
iio: adc: ad7091r: Move chip init data to container struct
iio: adc: ad7091r: Remove unneeded probe parameters
iio: adc: ad7091r: Set device mode through chip_info callback
iio: adc: ad7091r: Add chip_info callback to get conversion result
channel
iio: adc: Split AD7091R-5 config symbol
dt-bindings: iio: Add AD7091R-8
iio: adc: Add support for AD7091R-8
MAINTAINERS: Add MAINTAINERS entry for AD7091R

 .../bindings/iio/adc/adi,ad7091r5.yaml        |  82 +++++-
 MAINTAINERS                                   |   8 +
 drivers/iio/adc/Kconfig                       |  16 ++
 drivers/iio/adc/Makefile                      |   4 +-
 drivers/iio/adc/ad7091r-base.c                | 269 +++++++++++------
 drivers/iio/adc/ad7091r-base.h                |  83 +++++-
 drivers/iio/adc/ad7091r5.c                    | 120 ++++----
 drivers/iio/adc/ad7091r8.c                    | 272 ++++++++++++++++++
 8 files changed, 714 insertions(+), 140 deletions(-)
 create mode 100644 drivers/iio/adc/ad7091r8.c
Signature · 1 line
2.42.0