]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
iio: add IIO_ALTCURRENT channel type
authorAntoniu Miclaus <antoniu.miclaus@analog.com>
Mon, 8 Sep 2025 07:35:21 +0000 (07:35 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 13 Sep 2025 12:47:19 +0000 (13:47 +0100)
Add support for IIO_ALTCURRENT channel type to distinguish AC current
measurements from DC current measurements. This follows the same pattern
as IIO_VOLTAGE and IIO_ALTVOLTAGE.

Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/industrialio-core.c
include/uapi/linux/iio/types.h
tools/iio/iio_event_monitor.c

index 38848d753a33de045d4b4832fae88aca9519414b..4ff2c44f9324fb89b8239a0ac1e90c287ad7f5e0 100644 (file)
@@ -97,6 +97,7 @@ static const char * const iio_chan_type_name_spec[] = {
        [IIO_COLORTEMP] = "colortemp",
        [IIO_CHROMATICITY] = "chromaticity",
        [IIO_ATTENTION] = "attention",
+       [IIO_ALTCURRENT] = "altcurrent",
 };
 
 static const char * const iio_modifier_names[] = {
index 3eb0821af7a40e29544fbcc67c48e085507e13d0..3c3cc1497a1e0e9d7868edf02327dea2b63e5c66 100644 (file)
@@ -52,6 +52,7 @@ enum iio_chan_type {
        IIO_COLORTEMP,
        IIO_CHROMATICITY,
        IIO_ATTENTION,
+       IIO_ALTCURRENT,
 };
 
 enum iio_modifier {
index eab7b082f19db8703aca55af7dbf4f1d624aa3af..d26aff649f3f112031a22bfe80b92d27b2169200 100644 (file)
@@ -64,6 +64,7 @@ static const char * const iio_chan_type_name_spec[] = {
        [IIO_COLORTEMP] = "colortemp",
        [IIO_CHROMATICITY] = "chromaticity",
        [IIO_ATTENTION] = "attention",
+       [IIO_ALTCURRENT] = "altcurrent",
 };
 
 static const char * const iio_ev_type_text[] = {
@@ -187,6 +188,7 @@ static bool event_is_known(struct iio_event_data *event)
        case IIO_COLORTEMP:
        case IIO_CHROMATICITY:
        case IIO_ATTENTION:
+       case IIO_ALTCURRENT:
                break;
        default:
                return false;