15 #include <linux/kernel.h>
16 #include <linux/module.h>
17 #include <linux/slab.h>
18 #include <linux/rtc.h>
31 static int iio_trig_periodic_rtc_set_state(
struct iio_trigger *trig,
bool state)
76 iio_trig_periodic_read_freq,
77 iio_trig_periodic_write_freq);
79 static struct attribute *iio_trig_prtc_attrs[] = {
80 &dev_attr_frequency.attr,
85 .attrs = iio_trig_prtc_attrs,
89 &iio_trig_prtc_attr_group,
101 .set_trigger_state = &iio_trig_periodic_rtc_set_state,
106 char **
pdata = dev->
dev.platform_data;
113 if (pdata[i] ==
NULL)
118 goto error_free_completed_registrations;
120 list_add(&trig->
alloc_list, &iio_prtc_trigger_list);
122 trig_info = kzalloc(
sizeof(*trig_info),
GFP_KERNEL);
125 goto error_put_trigger_and_remove_from_list;
128 trig->
ops = &iio_prtc_trigger_ops;
134 goto error_free_trig_info;
136 trig_info->
task.func = iio_prtc_trigger_poll;
137 trig_info->
task.private_data = trig;
140 goto error_close_rtc;
141 trig->
dev.groups = iio_trig_prtc_attr_groups;
144 goto error_unregister_rtc_irq;
147 error_unregister_rtc_irq:
151 error_free_trig_info:
153 error_put_trigger_and_remove_from_list:
155 iio_trigger_put(trig);
156 error_free_completed_registrations:
159 &iio_prtc_trigger_list,
177 &iio_prtc_trigger_list,
190 .probe = iio_trig_periodic_rtc_probe,
191 .remove =
__devexit_p(iio_trig_periodic_rtc_remove),
193 .name =
"iio_prtc_trigger",