8 #include <linux/kernel.h>
9 #include <linux/module.h>
11 #include <linux/slab.h>
12 #include <linux/list.h>
28 static int iio_sysfs_trigger_probe(
int id);
40 ret = iio_sysfs_trigger_probe(input);
47 static int iio_sysfs_trigger_remove(
int id);
59 ret = iio_sysfs_trigger_remove(input);
67 static struct attribute *iio_sysfs_trig_attrs[] = {
68 &dev_attr_add_trigger.attr,
69 &dev_attr_remove_trigger.attr,
74 .attrs = iio_sysfs_trig_attrs,
78 &iio_sysfs_trig_group,
84 static void iio_trigger_sysfs_release(
struct device *dev)
88 static struct device iio_sysfs_trig_dev = {
90 .groups = iio_sysfs_trig_groups,
91 .release = &iio_trigger_sysfs_release,
94 static void iio_sysfs_trigger_work(
struct irq_work *
work)
115 static struct attribute *iio_sysfs_trigger_attrs[] = {
116 &dev_attr_trigger_now.attr,
121 .attrs = iio_sysfs_trigger_attrs,
124 static const struct attribute_group *iio_sysfs_trigger_attr_groups[] = {
125 &iio_sysfs_trigger_attr_group,
133 static int iio_sysfs_trigger_probe(
int id)
137 bool foundit =
false;
160 t->
trig->dev.groups = iio_sysfs_trigger_attr_groups;
161 t->
trig->ops = &iio_sysfs_trigger_ops;
162 t->
trig->dev.parent = &iio_sysfs_trig_dev;
163 t->
trig->private_data =
t;
165 init_irq_work(&t->
work, iio_sysfs_trigger_work);
170 list_add(&t->
l, &iio_sysfs_trig_list);
176 iio_trigger_put(t->
trig);
184 static int iio_sysfs_trigger_remove(
int id)
186 bool foundit =
false;
210 static int __init iio_sysfs_trig_init(
void)
218 static void __exit iio_sysfs_trig_exit(
void)