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>
pull/1354/merge
Antoniu Miclaus 2025-09-08 07:35:21 +00:00 committed by Jonathan Cameron
parent abe629ebda
commit f15bc37d8c
3 changed files with 4 additions and 0 deletions

View 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[] = {

View File

@ -52,6 +52,7 @@ enum iio_chan_type {
IIO_COLORTEMP,
IIO_CHROMATICITY,
IIO_ATTENTION,
IIO_ALTCURRENT,
};
enum iio_modifier {

View 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;