diff options
| author | Daniel Baluta <daniel.baluta@intel.com> | 2015-02-10 11:33:51 -0500 |
|---|---|---|
| committer | Jonathan Cameron <jic23@kernel.org> | 2015-02-14 12:05:03 -0500 |
| commit | 293487c8ecc1103f4625cea5e90e1ba0cc89660f (patch) | |
| tree | 2222fda327366ac5a52377f7e62a1ba14f334b9c /include/linux/iio | |
| parent | e257a16e680a27ddc3dcbfc9fd39ad7f9d7ea135 (diff) | |
iio: Export userspace IIO headers
After UAPI header file split [1] all user-kernel interfaces were
placed under include/uapi/.
This patch moves IIO user specific API from:
* include/linux/iio/events.h => include/uapi/linux/iio/events.h
* include/linux/types.h => include/uapi/linux/types.h
Now there is no need for nasty tricks to compile userspace programs
(e.g iio_event_monitor). Just installing the kernel headers with
make headers_install command does the job.
[1] http://lwn.net/Articles/507794/
Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'include/linux/iio')
| -rw-r--r-- | include/linux/iio/events.h | 30 | ||||
| -rw-r--r-- | include/linux/iio/types.h | 78 |
2 files changed, 2 insertions, 106 deletions
diff --git a/include/linux/iio/events.h b/include/linux/iio/events.h index 03fa332ad2a8..8ad87d1c5340 100644 --- a/include/linux/iio/events.h +++ b/include/linux/iio/events.h | |||
| @@ -9,22 +9,8 @@ | |||
| 9 | #ifndef _IIO_EVENTS_H_ | 9 | #ifndef _IIO_EVENTS_H_ |
| 10 | #define _IIO_EVENTS_H_ | 10 | #define _IIO_EVENTS_H_ |
| 11 | 11 | ||
| 12 | #include <linux/ioctl.h> | ||
| 13 | #include <linux/types.h> | ||
| 14 | #include <linux/iio/types.h> | 12 | #include <linux/iio/types.h> |
| 15 | 13 | #include <uapi/linux/iio/events.h> | |
| 16 | /** | ||
| 17 | * struct iio_event_data - The actual event being pushed to userspace | ||
| 18 | * @id: event identifier | ||
| 19 | * @timestamp: best estimate of time of event occurrence (often from | ||
| 20 | * the interrupt handler) | ||
| 21 | */ | ||
| 22 | struct iio_event_data { | ||
| 23 | __u64 id; | ||
| 24 | __s64 timestamp; | ||
| 25 | }; | ||
| 26 | |||
| 27 | #define IIO_GET_EVENT_FD_IOCTL _IOR('i', 0x90, int) | ||
| 28 | 14 | ||
| 29 | /** | 15 | /** |
| 30 | * IIO_EVENT_CODE() - create event identifier | 16 | * IIO_EVENT_CODE() - create event identifier |
| @@ -70,18 +56,4 @@ struct iio_event_data { | |||
| 70 | #define IIO_UNMOD_EVENT_CODE(chan_type, number, type, direction) \ | 56 | #define IIO_UNMOD_EVENT_CODE(chan_type, number, type, direction) \ |
| 71 | IIO_EVENT_CODE(chan_type, 0, 0, direction, type, number, 0, 0) | 57 | IIO_EVENT_CODE(chan_type, 0, 0, direction, type, number, 0, 0) |
| 72 | 58 | ||
| 73 | #define IIO_EVENT_CODE_EXTRACT_TYPE(mask) ((mask >> 56) & 0xFF) | ||
| 74 | |||
| 75 | #define IIO_EVENT_CODE_EXTRACT_DIR(mask) ((mask >> 48) & 0x7F) | ||
| 76 | |||
| 77 | #define IIO_EVENT_CODE_EXTRACT_CHAN_TYPE(mask) ((mask >> 32) & 0xFF) | ||
| 78 | |||
| 79 | /* Event code number extraction depends on which type of event we have. | ||
| 80 | * Perhaps review this function in the future*/ | ||
| 81 | #define IIO_EVENT_CODE_EXTRACT_CHAN(mask) ((__s16)(mask & 0xFFFF)) | ||
| 82 | #define IIO_EVENT_CODE_EXTRACT_CHAN2(mask) ((__s16)(((mask) >> 16) & 0xFFFF)) | ||
| 83 | |||
| 84 | #define IIO_EVENT_CODE_EXTRACT_MODIFIER(mask) ((mask >> 40) & 0xFF) | ||
| 85 | #define IIO_EVENT_CODE_EXTRACT_DIFF(mask) (((mask) >> 55) & 0x1) | ||
| 86 | |||
| 87 | #endif | 59 | #endif |
diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h index 580ed5bdb3fa..942b6de68e2f 100644 --- a/include/linux/iio/types.h +++ b/include/linux/iio/types.h | |||
| @@ -10,76 +10,7 @@ | |||
| 10 | #ifndef _IIO_TYPES_H_ | 10 | #ifndef _IIO_TYPES_H_ |
| 11 | #define _IIO_TYPES_H_ | 11 | #define _IIO_TYPES_H_ |
| 12 | 12 | ||
| 13 | enum iio_chan_type { | 13 | #include <uapi/linux/iio/types.h> |
| 14 | IIO_VOLTAGE, | ||
| 15 | IIO_CURRENT, | ||
| 16 | IIO_POWER, | ||
| 17 | IIO_ACCEL, | ||
| 18 | IIO_ANGL_VEL, | ||
| 19 | IIO_MAGN, | ||
| 20 | IIO_LIGHT, | ||
| 21 | IIO_INTENSITY, | ||
| 22 | IIO_PROXIMITY, | ||
| 23 | IIO_TEMP, | ||
| 24 | IIO_INCLI, | ||
| 25 | IIO_ROT, | ||
| 26 | IIO_ANGL, | ||
| 27 | IIO_TIMESTAMP, | ||
| 28 | IIO_CAPACITANCE, | ||
| 29 | IIO_ALTVOLTAGE, | ||
| 30 | IIO_CCT, | ||
| 31 | IIO_PRESSURE, | ||
| 32 | IIO_HUMIDITYRELATIVE, | ||
| 33 | IIO_ACTIVITY, | ||
| 34 | IIO_STEPS, | ||
| 35 | IIO_ENERGY, | ||
| 36 | IIO_DISTANCE, | ||
| 37 | IIO_VELOCITY, | ||
| 38 | }; | ||
| 39 | |||
| 40 | enum iio_modifier { | ||
| 41 | IIO_NO_MOD, | ||
| 42 | IIO_MOD_X, | ||
| 43 | IIO_MOD_Y, | ||
| 44 | IIO_MOD_Z, | ||
| 45 | IIO_MOD_X_AND_Y, | ||
| 46 | IIO_MOD_X_AND_Z, | ||
| 47 | IIO_MOD_Y_AND_Z, | ||
| 48 | IIO_MOD_X_AND_Y_AND_Z, | ||
| 49 | IIO_MOD_X_OR_Y, | ||
| 50 | IIO_MOD_X_OR_Z, | ||
| 51 | IIO_MOD_Y_OR_Z, | ||
| 52 | IIO_MOD_X_OR_Y_OR_Z, | ||
| 53 | IIO_MOD_LIGHT_BOTH, | ||
| 54 | IIO_MOD_LIGHT_IR, | ||
| 55 | IIO_MOD_ROOT_SUM_SQUARED_X_Y, | ||
| 56 | IIO_MOD_SUM_SQUARED_X_Y_Z, | ||
| 57 | IIO_MOD_LIGHT_CLEAR, | ||
| 58 | IIO_MOD_LIGHT_RED, | ||
| 59 | IIO_MOD_LIGHT_GREEN, | ||
| 60 | IIO_MOD_LIGHT_BLUE, | ||
| 61 | IIO_MOD_QUATERNION, | ||
| 62 | IIO_MOD_TEMP_AMBIENT, | ||
| 63 | IIO_MOD_TEMP_OBJECT, | ||
| 64 | IIO_MOD_NORTH_MAGN, | ||
| 65 | IIO_MOD_NORTH_TRUE, | ||
| 66 | IIO_MOD_NORTH_MAGN_TILT_COMP, | ||
| 67 | IIO_MOD_NORTH_TRUE_TILT_COMP, | ||
| 68 | IIO_MOD_RUNNING, | ||
| 69 | IIO_MOD_JOGGING, | ||
| 70 | IIO_MOD_WALKING, | ||
| 71 | IIO_MOD_STILL, | ||
| 72 | IIO_MOD_ROOT_SUM_SQUARED_X_Y_Z, | ||
| 73 | }; | ||
| 74 | |||
| 75 | enum iio_event_type { | ||
| 76 | IIO_EV_TYPE_THRESH, | ||
| 77 | IIO_EV_TYPE_MAG, | ||
| 78 | IIO_EV_TYPE_ROC, | ||
| 79 | IIO_EV_TYPE_THRESH_ADAPTIVE, | ||
| 80 | IIO_EV_TYPE_MAG_ADAPTIVE, | ||
| 81 | IIO_EV_TYPE_CHANGE, | ||
| 82 | }; | ||
| 83 | 14 | ||
| 84 | enum iio_event_info { | 15 | enum iio_event_info { |
| 85 | IIO_EV_INFO_ENABLE, | 16 | IIO_EV_INFO_ENABLE, |
| @@ -88,13 +19,6 @@ enum iio_event_info { | |||
| 88 | IIO_EV_INFO_PERIOD, | 19 | IIO_EV_INFO_PERIOD, |
| 89 | }; | 20 | }; |
| 90 | 21 | ||
| 91 | enum iio_event_direction { | ||
| 92 | IIO_EV_DIR_EITHER, | ||
| 93 | IIO_EV_DIR_RISING, | ||
| 94 | IIO_EV_DIR_FALLING, | ||
| 95 | IIO_EV_DIR_NONE, | ||
| 96 | }; | ||
| 97 | |||
| 98 | #define IIO_VAL_INT 1 | 22 | #define IIO_VAL_INT 1 |
| 99 | #define IIO_VAL_INT_PLUS_MICRO 2 | 23 | #define IIO_VAL_INT_PLUS_MICRO 2 |
| 100 | #define IIO_VAL_INT_PLUS_NANO 3 | 24 | #define IIO_VAL_INT_PLUS_NANO 3 |
