[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <cover.1740421248.git.mazziesaccount@gmail.com>
Date: Mon, 24 Feb 2025 20:32:03 +0200
From: Matti Vaittinen <mazziesaccount@...il.com>
To: Matti Vaittinen <mazziesaccount@...il.com>,
Matti Vaittinen <matti.vaittinen@...rohmeurope.com>
Cc: Jonathan Cameron <jic23@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Daniel Scally <djrscally@...il.com>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Danilo Krummrich <dakr@...nel.org>,
Matti Vaittinen <mazziesaccount@...il.com>,
Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>,
Chen-Yu Tsai <wens@...e.org>,
Jernej Skrabec <jernej.skrabec@...il.com>,
Samuel Holland <samuel@...lland.org>,
Hugo Villeneuve <hvilleneuve@...onoff.com>,
Nuno Sa <nuno.sa@...log.com>, David Lechner <dlechner@...libre.com>,
Javier Carrasco <javier.carrasco.cruz@...il.com>,
Guillaume Stols <gstols@...libre.com>,
Olivier Moysan <olivier.moysan@...s.st.com>,
Dumitru Ceclan <mitrutzceclan@...il.com>,
Trevor Gamblin <tgamblin@...libre.com>,
Matteo Martelli <matteomartelli3@...il.com>,
Alisa-Dariana Roman <alisadariana@...il.com>,
Ramona Alexandra Nechita <ramona.nechita@...log.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
linux-iio@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-acpi@...r.kernel.org,
linux-renesas-soc@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-sunxi@...ts.linux.dev,
Linus Walleij <linus.walleij@...aro.org>
Subject: [PATCH v4 00/10] Support ROHM BD79124 ADC
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
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists