]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: introduce the FAULT event type
authorGuillaume Ranquet <granquet@baylibre.com>
Mon, 27 Jan 2025 13:59:32 +0000 (14:59 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 8 Feb 2025 15:16:29 +0000 (15:16 +0000)
Add a new event type to describe an hardware failure.

Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Signed-off-by: Guillaume Ranquet <granquet@baylibre.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20250127-ad4111_openwire-v5-1-ef2db05c384f@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/industrialio-event.c
include/uapi/linux/iio/types.h
tools/iio/iio_event_monitor.c

index db06501b0e61a91e3b06345b418504803f4aefb5..06295cfc2da8b1df17061cf58ade38d88020359e 100644 (file)
@@ -232,6 +232,7 @@ static const char * const iio_ev_type_text[] = {
        [IIO_EV_TYPE_CHANGE] = "change",
        [IIO_EV_TYPE_MAG_REFERENCED] = "mag_referenced",
        [IIO_EV_TYPE_GESTURE] = "gesture",
+       [IIO_EV_TYPE_FAULT] = "fault",
 };
 
 static const char * const iio_ev_dir_text[] = {
@@ -240,6 +241,7 @@ static const char * const iio_ev_dir_text[] = {
        [IIO_EV_DIR_FALLING] = "falling",
        [IIO_EV_DIR_SINGLETAP] = "singletap",
        [IIO_EV_DIR_DOUBLETAP] = "doubletap",
+       [IIO_EV_DIR_FAULT_OPENWIRE] = "openwire",
 };
 
 static const char * const iio_ev_info_text[] = {
index 12886d4465e4896aedce837c2df63c78f83a5496..3eb0821af7a40e29544fbcc67c48e085507e13d0 100644 (file)
@@ -119,6 +119,7 @@ enum iio_event_type {
        IIO_EV_TYPE_CHANGE,
        IIO_EV_TYPE_MAG_REFERENCED,
        IIO_EV_TYPE_GESTURE,
+       IIO_EV_TYPE_FAULT,
 };
 
 enum iio_event_direction {
@@ -128,6 +129,7 @@ enum iio_event_direction {
        IIO_EV_DIR_NONE,
        IIO_EV_DIR_SINGLETAP,
        IIO_EV_DIR_DOUBLETAP,
+       IIO_EV_DIR_FAULT_OPENWIRE,
 };
 
 #endif /* _UAPI_IIO_TYPES_H_ */
index cccf62ea2b8f9b55a83a4960c1a60087c7b053f3..eab7b082f19db8703aca55af7dbf4f1d624aa3af 100644 (file)
@@ -75,6 +75,7 @@ static const char * const iio_ev_type_text[] = {
        [IIO_EV_TYPE_CHANGE] = "change",
        [IIO_EV_TYPE_MAG_REFERENCED] = "mag_referenced",
        [IIO_EV_TYPE_GESTURE] = "gesture",
+       [IIO_EV_TYPE_FAULT] = "fault",
 };
 
 static const char * const iio_ev_dir_text[] = {
@@ -83,6 +84,7 @@ static const char * const iio_ev_dir_text[] = {
        [IIO_EV_DIR_FALLING] = "falling",
        [IIO_EV_DIR_SINGLETAP] = "singletap",
        [IIO_EV_DIR_DOUBLETAP] = "doubletap",
+       [IIO_EV_DIR_FAULT_OPENWIRE] = "openwire",
 };
 
 static const char * const iio_modifier_names[] = {
@@ -249,6 +251,7 @@ static bool event_is_known(struct iio_event_data *event)
        case IIO_EV_TYPE_MAG_ADAPTIVE:
        case IIO_EV_TYPE_CHANGE:
        case IIO_EV_TYPE_GESTURE:
+       case IIO_EV_TYPE_FAULT:
                break;
        default:
                return false;
@@ -260,6 +263,7 @@ static bool event_is_known(struct iio_event_data *event)
        case IIO_EV_DIR_FALLING:
        case IIO_EV_DIR_SINGLETAP:
        case IIO_EV_DIR_DOUBLETAP:
+       case IIO_EV_DIR_FAULT_OPENWIRE:
        case IIO_EV_DIR_NONE:
                break;
        default: