aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/iio/trigger.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/iio/trigger.h')
-rw-r--r--include/linux/iio/trigger.h26
1 files changed, 24 insertions, 2 deletions
diff --git a/include/linux/iio/trigger.h b/include/linux/iio/trigger.h
index c66e0a96f6e8..3869c525b052 100644
--- a/include/linux/iio/trigger.h
+++ b/include/linux/iio/trigger.h
@@ -44,7 +44,6 @@ struct iio_trigger_ops {
44 * @id: [INTERN] unique id number 44 * @id: [INTERN] unique id number
45 * @name: [DRIVER] unique name 45 * @name: [DRIVER] unique name
46 * @dev: [DRIVER] associated device (if relevant) 46 * @dev: [DRIVER] associated device (if relevant)
47 * @private_data: [DRIVER] device specific data
48 * @list: [INTERN] used in maintenance of global trigger list 47 * @list: [INTERN] used in maintenance of global trigger list
49 * @alloc_list: [DRIVER] used for driver specific trigger list 48 * @alloc_list: [DRIVER] used for driver specific trigger list
50 * @use_count: use count for the trigger 49 * @use_count: use count for the trigger
@@ -60,7 +59,6 @@ struct iio_trigger {
60 const char *name; 59 const char *name;
61 struct device dev; 60 struct device dev;
62 61
63 void *private_data;
64 struct list_head list; 62 struct list_head list;
65 struct list_head alloc_list; 63 struct list_head alloc_list;
66 int use_count; 64 int use_count;
@@ -92,6 +90,30 @@ static inline void iio_trigger_get(struct iio_trigger *trig)
92} 90}
93 91
94/** 92/**
93 * iio_device_set_drvdata() - Set trigger driver data
94 * @trig: IIO trigger structure
95 * @data: Driver specific data
96 *
97 * Allows to attach an arbitrary pointer to an IIO trigger, which can later be
98 * retrieved by iio_trigger_get_drvdata().
99 */
100static inline void iio_trigger_set_drvdata(struct iio_trigger *trig, void *data)
101{
102 dev_set_drvdata(&trig->dev, data);
103}
104
105/**
106 * iio_trigger_get_drvdata() - Get trigger driver data
107 * @trig: IIO trigger structure
108 *
109 * Returns the data previously set with iio_trigger_set_drvdata()
110 */
111static inline void *iio_trigger_get_drvdata(struct iio_trigger *trig)
112{
113 return dev_get_drvdata(&trig->dev);
114}
115
116/**
95 * iio_trigger_register() - register a trigger with the IIO core 117 * iio_trigger_register() - register a trigger with the IIO core
96 * @trig_info: trigger to be registered 118 * @trig_info: trigger to be registered
97 **/ 119 **/