]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iio: adc: add helpers for parsing ADC nodes
authorMatti Vaittinen <mazziesaccount@gmail.com>
Mon, 24 Mar 2025 07:13:03 +0000 (09:13 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Tue, 22 Apr 2025 18:09:52 +0000 (19:09 +0100)
commitf3a8f870fa9c84b34aad4c72c8d0a1213ba13a36
tree54657f137418d1c265b2d0c8b65c51dc6e974fb1
parentf24303631489d250f330373a59b3412103a93b67
iio: adc: add helpers for parsing ADC nodes

There are ADC ICs which may have some of the AIN pins usable for other
functions. These ICs may have some of the AIN pins wired so that they
should not be used for ADC.

A common way of marking pins that can be used as ADC inputs is to add
corresponding channel@N nodes in the device tree as described in the ADC
      binding yaml.

Add couple of helper functions which can be used to retrieve the channel
information from the device node.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Link: https://patch.msgid.link/f1d8b3e15237947738912c0d297b3e1e21d8b03e.1742560649.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/Kconfig
drivers/iio/adc/Makefile
drivers/iio/adc/industrialio-adc.c [new file with mode: 0644]
include/linux/iio/adc-helpers.h [new file with mode: 0644]