Skip to content

Commit f15bc37

Browse files
amiclausjic23
authored andcommitted
iio: add IIO_ALTCURRENT channel type
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>
1 parent abe629e commit f15bc37

3 files changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/iio/industrialio-core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ static const char * const iio_chan_type_name_spec[] = {
9797
[IIO_COLORTEMP] = "colortemp",
9898
[IIO_CHROMATICITY] = "chromaticity",
9999
[IIO_ATTENTION] = "attention",
100+
[IIO_ALTCURRENT] = "altcurrent",
100101
};
101102

102103
static const char * const iio_modifier_names[] = {

include/uapi/linux/iio/types.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ enum iio_chan_type {
5252
IIO_COLORTEMP,
5353
IIO_CHROMATICITY,
5454
IIO_ATTENTION,
55+
IIO_ALTCURRENT,
5556
};
5657

5758
enum iio_modifier {

tools/iio/iio_event_monitor.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ static const char * const iio_chan_type_name_spec[] = {
6464
[IIO_COLORTEMP] = "colortemp",
6565
[IIO_CHROMATICITY] = "chromaticity",
6666
[IIO_ATTENTION] = "attention",
67+
[IIO_ALTCURRENT] = "altcurrent",
6768
};
6869

6970
static const char * const iio_ev_type_text[] = {
@@ -187,6 +188,7 @@ static bool event_is_known(struct iio_event_data *event)
187188
case IIO_COLORTEMP:
188189
case IIO_CHROMATICITY:
189190
case IIO_ATTENTION:
191+
case IIO_ALTCURRENT:
190192
break;
191193
default:
192194
return false;

0 commit comments

Comments
 (0)