blob: 162a4272164395df4bd586ba60e1c4878cba8ea7 [file] [log] [blame]
From 5fc755070f0a7bcc612e82065cff0b3d60b51577 Mon Sep 17 00:00:00 2001
From: Paul Cercueil <paul@crapouillou.net>
Date: Wed, 17 Nov 2021 09:57:09 +0000
Subject: [PATCH] iio.h: Protect against inclusion of <linux/iio/types.h>
Add the missing enums from <linux/iio/types.h> and protect all of them
from double-definition by wrapping them with the header's protect
guards.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
iio.h | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/iio.h b/iio.h
index ccc83be..84b7286 100644
--- a/iio.h
+++ b/iio.h
@@ -84,6 +84,13 @@ struct iio_context_info;
struct iio_scan_context;
struct iio_scan_block;
+/*
+ * <linux/iio/types.h> header guard to protect these enums from being defined
+ * twice
+ */
+#ifndef _IIO_TYPES_H_
+#define _IIO_TYPES_H_
+
/**
* @enum iio_chan_type
* @brief IIO channel type
@@ -185,6 +192,24 @@ enum iio_modifier {
IIO_MOD_O2,
};
+enum iio_event_type {
+ IIO_EV_TYPE_THRESH,
+ IIO_EV_TYPE_MAG,
+ IIO_EV_TYPE_ROC,
+ IIO_EV_TYPE_THRESH_ADAPTIVE,
+ IIO_EV_TYPE_MAG_ADAPTIVE,
+ IIO_EV_TYPE_CHANGE,
+};
+
+enum iio_event_direction {
+ IIO_EV_DIR_EITHER,
+ IIO_EV_DIR_RISING,
+ IIO_EV_DIR_FALLING,
+ IIO_EV_DIR_NONE,
+};
+
+#endif /* _IIO_TYPES_H_ */
+
/* ---------------------------------------------------------------------------*/
/* ------------------------- Scan functions ----------------------------------*/
/** @defgroup Scan Functions for scanning available contexts
--
2.34.0.rc2.393.gf8c9666880-goog