aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/iio
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-04-21 05:33:03 -0400
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-04-21 08:44:55 -0400
commit64131a87f2aae2ed9e05d8227c5b009ca6c50d98 (patch)
treefdea23fd59216120bf54a48c60ca24489a733f14 /include/linux/iio
parent676ee36be04985062522804c2de04f0764212be6 (diff)
parent2c33ce009ca2389dbf0535d0672214d09738e35e (diff)
Merge branch 'drm-next-merged' of git://people.freedesktop.org/~airlied/linux into v4l_for_linus
* 'drm-next-merged' of git://people.freedesktop.org/~airlied/linux: (9717 commits) media-bus: Fixup RGB444_1X12, RGB565_1X16, and YUV8_1X24 media bus format hexdump: avoid warning in test function fs: take i_mutex during prepare_binprm for set[ug]id executables smp: Fix error case handling in smp_call_function_*() iommu-common: Fix PARISC compile-time warnings sparc: Make LDC use common iommu poll management functions sparc: Make sparc64 use scalable lib/iommu-common.c functions Break up monolithic iommu table/lock into finer graularity pools and lock sparc: Revert generic IOMMU allocator. tools/power turbostat: correct dumped pkg-cstate-limit value tools/power turbostat: calculate TSC frequency from CPUID(0x15) on SKL tools/power turbostat: correct DRAM RAPL units on recent Xeon processors tools/power turbostat: Initial Skylake support tools/power turbostat: Use $(CURDIR) instead of $(PWD) and add support for O= option in Makefile tools/power turbostat: modprobe msr, if needed tools/power turbostat: dump MSR_TURBO_RATIO_LIMIT2 tools/power turbostat: use new MSR_TURBO_RATIO_LIMIT names Bluetooth: hidp: Fix regression with older userspace and flags validation config: Enable NEED_DMA_MAP_STATE by default when SWIOTLB is selected perf/x86/intel/pt: Fix and clean up error handling in pt_event_add() ... That solves several merge conflicts: Documentation/DocBook/media/v4l/subdev-formats.xml Documentation/devicetree/bindings/vendor-prefixes.txt drivers/staging/media/mn88473/mn88473.c include/linux/kconfig.h include/uapi/linux/media-bus-format.h The ones at subdev-formats.xml and media-bus-format.h are not trivial. That's why we opted to merge from DRM.
Diffstat (limited to 'include/linux/iio')
-rw-r--r--include/linux/iio/buffer.h8
-rw-r--r--include/linux/iio/dac/max517.h2
-rw-r--r--include/linux/iio/events.h30
-rw-r--r--include/linux/iio/iio.h13
-rw-r--r--include/linux/iio/types.h78
5 files changed, 21 insertions, 110 deletions
diff --git a/include/linux/iio/buffer.h b/include/linux/iio/buffer.h
index b65850a41127..eb8622b78ec9 100644
--- a/include/linux/iio/buffer.h
+++ b/include/linux/iio/buffer.h
@@ -21,8 +21,8 @@ struct iio_buffer;
21 * struct iio_buffer_access_funcs - access functions for buffers. 21 * struct iio_buffer_access_funcs - access functions for buffers.
22 * @store_to: actually store stuff to the buffer 22 * @store_to: actually store stuff to the buffer
23 * @read_first_n: try to get a specified number of bytes (must exist) 23 * @read_first_n: try to get a specified number of bytes (must exist)
24 * @data_available: indicates whether data for reading from the buffer is 24 * @data_available: indicates how much data is available for reading from
25 * available. 25 * the buffer.
26 * @request_update: if a parameter change has been marked, update underlying 26 * @request_update: if a parameter change has been marked, update underlying
27 * storage. 27 * storage.
28 * @set_bytes_per_datum:set number of bytes per datum 28 * @set_bytes_per_datum:set number of bytes per datum
@@ -43,7 +43,7 @@ struct iio_buffer_access_funcs {
43 int (*read_first_n)(struct iio_buffer *buffer, 43 int (*read_first_n)(struct iio_buffer *buffer,
44 size_t n, 44 size_t n,
45 char __user *buf); 45 char __user *buf);
46 bool (*data_available)(struct iio_buffer *buffer); 46 size_t (*data_available)(struct iio_buffer *buffer);
47 47
48 int (*request_update)(struct iio_buffer *buffer); 48 int (*request_update)(struct iio_buffer *buffer);
49 49
@@ -72,6 +72,7 @@ struct iio_buffer_access_funcs {
72 * @demux_bounce: [INTERN] buffer for doing gather from incoming scan. 72 * @demux_bounce: [INTERN] buffer for doing gather from incoming scan.
73 * @buffer_list: [INTERN] entry in the devices list of current buffers. 73 * @buffer_list: [INTERN] entry in the devices list of current buffers.
74 * @ref: [INTERN] reference count of the buffer. 74 * @ref: [INTERN] reference count of the buffer.
75 * @watermark: [INTERN] number of datums to wait for poll/read.
75 */ 76 */
76struct iio_buffer { 77struct iio_buffer {
77 int length; 78 int length;
@@ -90,6 +91,7 @@ struct iio_buffer {
90 void *demux_bounce; 91 void *demux_bounce;
91 struct list_head buffer_list; 92 struct list_head buffer_list;
92 struct kref ref; 93 struct kref ref;
94 unsigned int watermark;
93}; 95};
94 96
95/** 97/**
diff --git a/include/linux/iio/dac/max517.h b/include/linux/iio/dac/max517.h
index f6d1d252f08d..7668716cd73c 100644
--- a/include/linux/iio/dac/max517.h
+++ b/include/linux/iio/dac/max517.h
@@ -9,7 +9,7 @@
9#define IIO_DAC_MAX517_H_ 9#define IIO_DAC_MAX517_H_
10 10
11struct max517_platform_data { 11struct max517_platform_data {
12 u16 vref_mv[2]; 12 u16 vref_mv[8];
13}; 13};
14 14
15#endif /* IIO_DAC_MAX517_H_ */ 15#endif /* IIO_DAC_MAX517_H_ */
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 */
22struct 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/iio.h b/include/linux/iio/iio.h
index 80d855061064..d86b753e9b30 100644
--- a/include/linux/iio/iio.h
+++ b/include/linux/iio/iio.h
@@ -338,6 +338,16 @@ struct iio_dev;
338 * provide a custom of_xlate function that reads the 338 * provide a custom of_xlate function that reads the
339 * *args* and returns the appropriate index in registered 339 * *args* and returns the appropriate index in registered
340 * IIO channels array. 340 * IIO channels array.
341 * @hwfifo_set_watermark: function pointer to set the current hardware
342 * fifo watermark level; see hwfifo_* entries in
343 * Documentation/ABI/testing/sysfs-bus-iio for details on
344 * how the hardware fifo operates
345 * @hwfifo_flush_to_buffer: function pointer to flush the samples stored
346 * in the hardware fifo to the device buffer. The driver
347 * should not flush more than count samples. The function
348 * must return the number of samples flushed, 0 if no
349 * samples were flushed or a negative integer if no samples
350 * were flushed and there was an error.
341 **/ 351 **/
342struct iio_info { 352struct iio_info {
343 struct module *driver_module; 353 struct module *driver_module;
@@ -399,6 +409,9 @@ struct iio_info {
399 unsigned *readval); 409 unsigned *readval);
400 int (*of_xlate)(struct iio_dev *indio_dev, 410 int (*of_xlate)(struct iio_dev *indio_dev,
401 const struct of_phandle_args *iiospec); 411 const struct of_phandle_args *iiospec);
412 int (*hwfifo_set_watermark)(struct iio_dev *indio_dev, unsigned val);
413 int (*hwfifo_flush_to_buffer)(struct iio_dev *indio_dev,
414 unsigned count);
402}; 415};
403 416
404/** 417/**
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
13enum 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
40enum 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
75enum 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
84enum iio_event_info { 15enum 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
91enum 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