Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
iio_simple_dummy.h
Go to the documentation of this file.
1 
11 #include <linux/kernel.h>
12 
14 
29  int dac_val;
32  int accel_val;
35  struct mutex lock;
36 #ifdef CONFIG_IIO_SIMPLE_DUMMY_EVENTS
37  int event_irq;
38  int event_val;
39  bool event_en;
40 #endif /* CONFIG_IIO_SIMPLE_DUMMY_EVENTS */
41 };
42 
43 #ifdef CONFIG_IIO_SIMPLE_DUMMY_EVENTS
44 
45 struct iio_dev;
46 
47 int iio_simple_dummy_read_event_config(struct iio_dev *indio_dev,
48  u64 event_code);
49 
50 int iio_simple_dummy_write_event_config(struct iio_dev *indio_dev,
52  int state);
53 
54 int iio_simple_dummy_read_event_value(struct iio_dev *indio_dev,
56  int *val);
57 
58 int iio_simple_dummy_write_event_value(struct iio_dev *indio_dev,
60  int val);
61 
62 int iio_simple_dummy_events_register(struct iio_dev *indio_dev);
63 int iio_simple_dummy_events_unregister(struct iio_dev *indio_dev);
64 
65 #else /* Stubs for when events are disabled at compile time */
66 
67 static inline int
69 {
70  return 0;
71 };
72 
73 static inline int
75 {
76  return 0;
77 };
78 
79 #endif /* CONFIG_IIO_SIMPLE_DUMMY_EVENTS*/
80 
95 };
96 
97 #ifdef CONFIG_IIO_SIMPLE_DUMMY_BUFFER
98 int iio_simple_dummy_configure_buffer(struct iio_dev *indio_dev,
99  const struct iio_chan_spec *channels, unsigned int num_channels);
100 void iio_simple_dummy_unconfigure_buffer(struct iio_dev *indio_dev);
101 #else
102 static inline int iio_simple_dummy_configure_buffer(struct iio_dev *indio_dev,
103  const struct iio_chan_spec *channels, unsigned int num_channels)
104 {
105  return 0;
106 };
107 static inline
108 void iio_simple_dummy_unconfigure_buffer(struct iio_dev *indio_dev)
109 {};
110 #endif /* CONFIG_IIO_SIMPLE_DUMMY_BUFFER */