Lines Matching refs:indio_dev

66 int iio_push_event(struct iio_dev *indio_dev, u64 ev_code, s64 timestamp)  in iio_push_event()  argument
68 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_push_event()
102 struct iio_dev *indio_dev = filep->private_data; in iio_event_poll() local
103 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_event_poll()
107 if (!indio_dev->info) in iio_event_poll()
123 struct iio_dev *indio_dev = filep->private_data; in iio_event_chrdev_read() local
124 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_event_chrdev_read()
129 if (!indio_dev->info) in iio_event_chrdev_read()
142 indio_dev->info == NULL); in iio_event_chrdev_read()
145 if (indio_dev->info == NULL) in iio_event_chrdev_read()
173 struct iio_dev *indio_dev = filep->private_data; in iio_event_chrdev_release() local
174 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_event_chrdev_release()
179 iio_device_put(indio_dev); in iio_event_chrdev_release()
192 static int iio_event_getfd(struct iio_dev *indio_dev) in iio_event_getfd() argument
194 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_event_getfd()
210 iio_device_get(indio_dev); in iio_event_getfd()
213 indio_dev, O_RDONLY | O_CLOEXEC); in iio_event_getfd()
216 iio_device_put(indio_dev); in iio_event_getfd()
279 struct iio_dev *indio_dev = dev_to_iio_dev(dev); in iio_ev_state_store() local
288 ret = indio_dev->info->write_event_config(indio_dev, in iio_ev_state_store()
299 struct iio_dev *indio_dev = dev_to_iio_dev(dev); in iio_ev_state_show() local
303 val = indio_dev->info->read_event_config(indio_dev, in iio_ev_state_show()
316 struct iio_dev *indio_dev = dev_to_iio_dev(dev); in iio_ev_value_show() local
321 ret = indio_dev->info->read_event_value(indio_dev, in iio_ev_value_show()
337 struct iio_dev *indio_dev = dev_to_iio_dev(dev); in iio_ev_value_store() local
342 if (!indio_dev->info->write_event_value) in iio_ev_value_store()
348 ret = indio_dev->info->write_event_value(indio_dev, in iio_ev_value_store()
358 static int iio_device_add_event(struct iio_dev *indio_dev, in iio_device_add_event() argument
363 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_device_add_event()
397 (i << 16) | spec_index, shared_by, &indio_dev->dev, in iio_device_add_event()
414 static int iio_device_add_event_sysfs(struct iio_dev *indio_dev, in iio_device_add_event_sysfs() argument
425 ret = iio_device_add_event(indio_dev, chan, i, type, dir, in iio_device_add_event_sysfs()
431 ret = iio_device_add_event(indio_dev, chan, i, type, dir, in iio_device_add_event_sysfs()
438 ret = iio_device_add_event(indio_dev, chan, i, type, dir, in iio_device_add_event_sysfs()
445 ret = iio_device_add_event(indio_dev, chan, i, type, dir, in iio_device_add_event_sysfs()
456 static inline int __iio_add_event_config_attrs(struct iio_dev *indio_dev) in __iio_add_event_config_attrs() argument
461 for (j = 0; j < indio_dev->num_channels; j++) { in __iio_add_event_config_attrs()
462 ret = iio_device_add_event_sysfs(indio_dev, in __iio_add_event_config_attrs()
463 &indio_dev->channels[j]); in __iio_add_event_config_attrs()
471 static bool iio_check_for_dynamic_events(struct iio_dev *indio_dev) in iio_check_for_dynamic_events() argument
475 for (j = 0; j < indio_dev->num_channels; j++) { in iio_check_for_dynamic_events()
476 if (indio_dev->channels[j].num_event_specs != 0) in iio_check_for_dynamic_events()
489 static long iio_event_ioctl(struct iio_dev *indio_dev, struct file *filp, in iio_event_ioctl() argument
496 fd = iio_event_getfd(indio_dev); in iio_event_ioctl()
508 int iio_device_register_eventset(struct iio_dev *indio_dev) in iio_device_register_eventset() argument
510 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_device_register_eventset()
516 if (!(indio_dev->info->event_attrs || in iio_device_register_eventset()
517 iio_check_for_dynamic_events(indio_dev))) in iio_device_register_eventset()
529 if (indio_dev->info->event_attrs != NULL) { in iio_device_register_eventset()
530 attr = indio_dev->info->event_attrs->attrs; in iio_device_register_eventset()
535 if (indio_dev->channels) { in iio_device_register_eventset()
536 ret = __iio_add_event_config_attrs(indio_dev); in iio_device_register_eventset()
550 if (indio_dev->info->event_attrs) in iio_device_register_eventset()
552 indio_dev->info->event_attrs->attrs, in iio_device_register_eventset()
559 ret = iio_device_register_sysfs_group(indio_dev, &ev_int->group); in iio_device_register_eventset()
564 iio_device_ioctl_handler_register(&iio_dev_opaque->indio_dev, in iio_device_register_eventset()
585 void iio_device_wakeup_eventset(struct iio_dev *indio_dev) in iio_device_wakeup_eventset() argument
587 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_device_wakeup_eventset()
594 void iio_device_unregister_eventset(struct iio_dev *indio_dev) in iio_device_unregister_eventset() argument
596 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_device_unregister_eventset()