linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 00/10] Support ROHM BD79124 ADC
@ 2025-02-24 18:32 Matti Vaittinen
  2025-02-24 18:32 ` [PATCH v4 01/10] dt-bindings: ROHM BD79124 ADC/GPO Matti Vaittinen
                   ` (9 more replies)
  0 siblings, 10 replies; 53+ messages in thread
From: Matti Vaittinen @ 2025-02-24 18:32 UTC (permalink / raw)
  To: Matti Vaittinen, Matti Vaittinen
  Cc: Jonathan Cameron, Lars-Peter Clausen, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Andy Shevchenko, Daniel Scally,
	Heikki Krogerus, Sakari Ailus, Greg Kroah-Hartman,
	Rafael J. Wysocki, Danilo Krummrich, Matti Vaittinen,
	Lad Prabhakar, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
	Hugo Villeneuve, Nuno Sa, David Lechner, Javier Carrasco,
	Guillaume Stols, Olivier Moysan, Dumitru Ceclan, Trevor Gamblin,
	Matteo Martelli, Alisa-Dariana Roman, Ramona Alexandra Nechita,
	AngeloGioacchino Del Regno, linux-iio, devicetree, linux-kernel,
	linux-acpi, linux-renesas-soc, linux-arm-kernel, linux-sunxi,
	Linus Walleij

[-- Attachment #1: Type: text/plain, Size: 4227 bytes --]

Support ROHM BD79124 ADC.

This series adds also couple of helper functions for parsing the channel
information from the device tree. There has been some discussion about
how useful these are, and whether they should support also differential
and single ended channel configurations. This version drops support for
those - with the benefit of reduced complexity and easier to use
API.

A few of the patches are examples of drivers which could utilize
these added helpers:
 - 4/9 converts rzg2l_adc to use helpers
 - 5/9 converts sun20i-gpadc to use helpers
 - 6,7/9 makes the ti-ads7924 to respect the channel specification give in
   the device-tree using these helpers.

patch 8/9 is small simplification for the ti-ads7924, and it can be
taken independently from the rest of the series.

NOTE: Patches 4...7 are untested as I lack of relevant HW. They have
been compile tested only.

The ROHM BD79124 ADC itself is quite usual stuff. 12-bit, 8-channel ADC
with threshold monitoring.

Except that:
 - each ADC input pin can be configured as a general purpose output.
 - manually starting an ADC conversion and reading the result would
   require the I2C _master_ to do clock stretching(!) for the duration
   of the conversion... Let's just say this is not well supported.
 - IC supports 'autonomous measurement mode' and storing latest results
   to the result registers. This mode is used by the driver due to the
   "peculiar" I2C when doing manual reads.

Furthermore, the ADC uses this continuous autonomous measuring,
and the IC keeps producing new 'out of window' IRQs if measurements are
out of window - the driver disables the event for 1 seconds when sending
it to user. This prevents generating storm of events

Revision history:
v3 => v4:
 - Drop the ADC helper support for differential channels
 - Drop the ADC helper for getting only channel IDs by fwnode.
 - "Promote" the function counting the number of child nodes with a
   specific name to the property.h (As suggested by Jonathan).
 - Add ADC helpers to a namespace.
 - Rebase on v6.14-rc3
 - More minor changes described in individual patches.
v2 => v3:
 - Restrict BD79124 channel numbers as suggested by Conor and add
   Conor's Reviewed-by tag.
 - Support differential and single-ended inputs
 - Convert couple of existing drivers to use the added ADC helpers
 - Minor fixes based on reviews
Link to v2:
https://lore.kernel.org/all/cover.1738761899.git.mazziesaccount@gmail.com/

RFC v1 => v2:
 - Drop MFD and pinmux.
 - Automatically re-enable events after 1 second.
 - Export fwnode parsing helpers for finding the ADC channels.

---

Matti Vaittinen (10):
  dt-bindings: ROHM BD79124 ADC/GPO
  property: Add device_get_child_node_count_named()
  iio: adc: add helpers for parsing ADC nodes
  iio: adc: rzg2l_adc: Use adc-helpers
  iio: adc: sun20i-gpadc: Use adc-helpers
  iio: adc: ti-ads7924 Drop unnecessary function parameters
  iio: adc: ti-ads7924: Respect device tree config
  iio: adc: Support ROHM BD79124 ADC
  MAINTAINERS: Add IIO ADC helpers
  MAINTAINERS: Add ROHM BD79124 ADC/GPO

 .../bindings/iio/adc/rohm,bd79124.yaml        |  114 ++
 MAINTAINERS                                   |   12 +
 drivers/base/property.c                       |   28 +
 drivers/iio/adc/Kconfig                       |   18 +
 drivers/iio/adc/Makefile                      |    3 +
 drivers/iio/adc/industrialio-adc.c            |   89 ++
 drivers/iio/adc/rohm-bd79124.c                | 1114 +++++++++++++++++
 drivers/iio/adc/rzg2l_adc.c                   |   38 +-
 drivers/iio/adc/sun20i-gpadc-iio.c            |   38 +-
 drivers/iio/adc/ti-ads7924.c                  |   83 +-
 include/linux/iio/adc-helpers.h               |   22 +
 include/linux/property.h                      |    2 +
 12 files changed, 1470 insertions(+), 91 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/iio/adc/rohm,bd79124.yaml
 create mode 100644 drivers/iio/adc/industrialio-adc.c
 create mode 100644 drivers/iio/adc/rohm-bd79124.c
 create mode 100644 include/linux/iio/adc-helpers.h


base-commit: 0ad2507d5d93f39619fc42372c347d6006b64319
-- 
2.48.1


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 53+ messages in thread

end of thread, other threads:[~2025-03-05  1:14 UTC | newest]

Thread overview: 53+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-24 18:32 [PATCH v4 00/10] Support ROHM BD79124 ADC Matti Vaittinen
2025-02-24 18:32 ` [PATCH v4 01/10] dt-bindings: ROHM BD79124 ADC/GPO Matti Vaittinen
2025-02-24 18:32 ` [PATCH v4 02/10] property: Add device_get_child_node_count_named() Matti Vaittinen
2025-02-25  9:40   ` Heikki Krogerus
2025-02-25 10:07     ` Matti Vaittinen
2025-02-25 10:21     ` Andy Shevchenko
2025-02-25 10:29       ` Matti Vaittinen
2025-02-25 10:39         ` Andy Shevchenko
2025-02-25 10:52           ` Matti Vaittinen
2025-02-25 13:29           ` Matti Vaittinen
2025-02-25 13:59             ` Andy Shevchenko
2025-02-26 14:04               ` Matti Vaittinen
2025-02-26 14:11                 ` Andy Shevchenko
2025-02-27  8:01                   ` Matti Vaittinen
2025-02-27 14:49                     ` Andy Shevchenko
2025-02-27 15:05                       ` Matti Vaittinen
2025-02-28 16:59                         ` Rob Herring
2025-03-02 12:21                           ` Matti Vaittinen
2025-02-25 10:56       ` Matti Vaittinen
2025-02-28 17:07   ` Rob Herring
2025-02-28 18:51     ` Andy Shevchenko
2025-03-02 12:22     ` Matti Vaittinen
2025-02-24 18:33 ` [PATCH v4 03/10] iio: adc: add helpers for parsing ADC nodes Matti Vaittinen
2025-02-26  0:26   ` David Lechner
2025-02-26  6:28     ` Matti Vaittinen
2025-02-26 16:10       ` David Lechner
2025-02-27  7:46         ` Matti Vaittinen
2025-03-02  3:20           ` Jonathan Cameron
2025-03-02 12:54             ` Matti Vaittinen
2025-03-04 23:59               ` Jonathan Cameron
2025-03-02  3:35   ` Jonathan Cameron
2025-03-02 13:00     ` Matti Vaittinen
2025-03-02  3:48   ` Jonathan Cameron
2025-03-02 13:01     ` Matti Vaittinen
2025-02-24 18:33 ` [PATCH v4 04/10] iio: adc: rzg2l_adc: Use adc-helpers Matti Vaittinen
2025-03-02  3:40   ` Jonathan Cameron
2025-03-02 13:06     ` Matti Vaittinen
2025-02-24 18:33 ` [PATCH v4 05/10] iio: adc: sun20i-gpadc: " Matti Vaittinen
2025-03-02  3:42   ` Jonathan Cameron
2025-02-24 18:34 ` [PATCH v4 06/10] iio: adc: ti-ads7924 Drop unnecessary function parameters Matti Vaittinen
2025-03-02  3:46   ` Jonathan Cameron
2025-03-03  7:33     ` Matti Vaittinen
2025-02-24 18:34 ` [PATCH v4 07/10] iio: adc: ti-ads7924: Respect device tree config Matti Vaittinen
2025-02-26  0:09   ` David Lechner
2025-02-26  6:39     ` Matti Vaittinen
2025-03-02  3:27       ` Jonathan Cameron
2025-03-02 13:10         ` Matti Vaittinen
2025-03-03 14:57           ` Hugo Villeneuve
2025-02-24 18:34 ` [PATCH v4 08/10] iio: adc: Support ROHM BD79124 ADC Matti Vaittinen
2025-03-02  4:10   ` Jonathan Cameron
2025-03-02 13:15     ` Matti Vaittinen
2025-02-24 18:34 ` [PATCH v4 09/10] MAINTAINERS: Add IIO ADC helpers Matti Vaittinen
2025-02-24 18:34 ` [PATCH v4 10/10] MAINTAINERS: Add ROHM BD79124 ADC/GPO Matti Vaittinen

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).