8 #include <linux/kernel.h>
9 #include <linux/module.h>
11 #include <linux/slab.h>
40 #if (MAX_BLACKFIN_GPTIMERS > 3)
47 #if (MAX_BLACKFIN_GPTIMERS > 8)
51 #if (MAX_BLACKFIN_GPTIMERS > 11)
108 if (val <= 4 || val <= st->
duty) {
120 return ret ? ret :
count;
123 static ssize_t iio_bfin_tmr_frequency_show(
struct device *dev,
137 return sprintf(buf,
"%lu\n", val);
141 iio_bfin_tmr_frequency_store);
143 static struct attribute *iio_bfin_tmr_trigger_attrs[] = {
144 &dev_attr_frequency.attr,
148 static const struct attribute_group iio_bfin_tmr_trigger_attr_group = {
149 .attrs = iio_bfin_tmr_trigger_attrs,
152 static const struct attribute_group *iio_bfin_tmr_trigger_attr_groups[] = {
153 &iio_bfin_tmr_trigger_attr_group,
167 static int iio_bfin_tmr_get_number(
int irq)
172 if (iio_bfin_timer_code[i].irq == irq)
180 .set_trigger_state = iio_bfin_tmr_set_state,
203 ret = iio_bfin_tmr_get_number(st->
irq);
216 st->
trig->private_data =
st;
217 st->
trig->ops = &iio_bfin_tmr_trigger_ops;
218 st->
trig->dev.groups = iio_bfin_tmr_trigger_attr_groups;
224 0, st->
trig->name, st);
227 "request IRQ-%d failed", st->
irq);
234 unsigned long long val;
261 dev_info(&pdev->
dev,
"iio trigger Blackfin TMR%d, IRQ-%d",
263 platform_set_drvdata(pdev, st);
271 iio_trigger_put(st->
trig);
287 iio_trigger_put(st->
trig);
295 .name =
"iio_bfin_tmr_trigger",
298 .probe = iio_bfin_tmr_trigger_probe,
299 .remove =
__devexit_p(iio_bfin_tmr_trigger_remove),