summaryrefslogtreecommitdiffstats
path: root/drivers/staging/iio/trigger.h
diff options
context:
space:
mode:
authorJonathan Cameron2011-05-18 15:42:22 +0200
committerGreg Kroah-Hartman2011-05-20 01:15:02 +0200
commit59c85e82c2e7a672cb4342dc5ccf9df8a3a14f73 (patch)
tree7df58c13e2254bf55692a20841bc3553583d11ef /drivers/staging/iio/trigger.h
parentstaging:iio: iio_event_interfaces - clean out unused elements (diff)
downloadkernel-qcow2-linux-59c85e82c2e7a672cb4342dc5ccf9df8a3a14f73.tar.gz
kernel-qcow2-linux-59c85e82c2e7a672cb4342dc5ccf9df8a3a14f73.tar.xz
kernel-qcow2-linux-59c85e82c2e7a672cb4342dc5ccf9df8a3a14f73.zip
staging:iio:trigger handle name attr in core, remove old alloc and register any control_attrs via struct device
As the majority of triggers don't actually have any other control_attrs lets use the fact that struct device has a groups element when we do need to have these attributes registered. A vargs function is used to cut down on lots of building strings in every single driver just in order to pass them into the allocate. Also iio_allocate_trigger_named -> iio_allocate_trigger as there is no unamed version any more, so that is now just confusing. Blackfin tested and fixed by Michael Hennerich. V2: Elements from Michael Hennerich's patches for the ade7758 Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/iio/trigger.h')
-rw-r--r--drivers/staging/iio/trigger.h26
1 files changed, 8 insertions, 18 deletions
diff --git a/drivers/staging/iio/trigger.h b/drivers/staging/iio/trigger.h
index 5efa0d50b720..7faa31a2421e 100644
--- a/drivers/staging/iio/trigger.h
+++ b/drivers/staging/iio/trigger.h
@@ -24,12 +24,16 @@ struct iio_subirq {
* @private_data: [DRIVER] device specific data
* @list: [INTERN] used in maintenance of global trigger list
* @alloc_list: [DRIVER] used for driver specific trigger list
- * @control_attrs: [DRIVER] sysfs attributes relevant to trigger type
* @owner: [DRIVER] used to monitor usage count of the trigger.
* @use_count: use count for the trigger
* @set_trigger_state: [DRIVER] switch on/off the trigger on demand
* @try_reenable: function to reenable the trigger when the
* use count is zero (may be NULL)
+ * @subirq_chip: [INTERN] associate 'virtual' irq chip.
+ * @subirq_base: [INTERN] base number for irqs provided by trigger.
+ * @subirqs: [INTERN] information about the 'child' irqs.
+ * @pool: [INTERN] bitmap of irqs currently in use.
+ * @pool_lock: [INTERN] protection of the irq pool.
**/
struct iio_trigger {
int id;
@@ -39,7 +43,6 @@ struct iio_trigger {
void *private_data;
struct list_head list;
struct list_head alloc_list;
- const struct attribute_group *control_attrs;
struct module *owner;
int use_count;
@@ -72,20 +75,6 @@ static inline void iio_get_trigger(struct iio_trigger *trig)
};
/**
- * iio_trigger_read_name() - sysfs access function to get the trigger name
- * @dev: the system device
- * @attr: device attributes for the device
- * @buf: output buffer to store the trigger name
- **/
-ssize_t iio_trigger_read_name(struct device *dev,
- struct device_attribute *attr,
- char *buf);
-
-#define IIO_TRIGGER_NAME_ATTR DEVICE_ATTR(name, S_IRUGO, \
- iio_trigger_read_name, \
- NULL);
-
-/**
* iio_trigger_register() - register a trigger with the IIO core
* @trig_info: trigger to be registered
**/
@@ -154,6 +143,7 @@ static inline void iio_trigger_put_irq(struct iio_trigger *trig, int irq)
* @h: the function that is actually run on trigger
* @thread: threaded interrupt part
* @type: the type of interrupt (basically if oneshot)
+ * @name: name used to identify the trigger consumer.
* @irq: the corresponding irq as allocated from the
* trigger pool
* @timestamp: some devices need a timestamp grabbed as soon
@@ -179,8 +169,8 @@ irqreturn_t iio_pollfunc_store_time(int irq, void *p);
int iio_triggered_ring_postenable(struct iio_dev *indio_dev);
int iio_triggered_ring_predisable(struct iio_dev *indio_dev);
-struct iio_trigger *iio_allocate_trigger(void);
-struct iio_trigger *iio_allocate_trigger_named(const char *name);
+struct iio_trigger *iio_allocate_trigger(const char *fmt, ...)
+ __attribute__((format(printf, 1, 2)));
void iio_free_trigger(struct iio_trigger *trig);
#endif /* _IIO_TRIGGER_H_ */