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 if (!indio_dev->info->write_event_config) in iio_ev_state_store()
291 ret = indio_dev->info->write_event_config(indio_dev, in iio_ev_state_store()
302 struct iio_dev *indio_dev = dev_to_iio_dev(dev); in iio_ev_state_show() local
306 if (!indio_dev->info->read_event_config) in iio_ev_state_show()
309 val = indio_dev->info->read_event_config(indio_dev, in iio_ev_state_show()
322 struct iio_dev *indio_dev = dev_to_iio_dev(dev); in iio_ev_value_show() local
327 if (!indio_dev->info->read_event_value) in iio_ev_value_show()
330 ret = indio_dev->info->read_event_value(indio_dev, in iio_ev_value_show()
346 struct iio_dev *indio_dev = dev_to_iio_dev(dev); in iio_ev_value_store() local
351 if (!indio_dev->info->write_event_value) in iio_ev_value_store()
357 ret = indio_dev->info->write_event_value(indio_dev, in iio_ev_value_store()
371 struct iio_dev *indio_dev = dev_to_iio_dev(dev); in iio_ev_label_show() local
374 if (indio_dev->info->read_event_label) in iio_ev_label_show()
375 return indio_dev->info->read_event_label(indio_dev, in iio_ev_label_show()
382 static int iio_device_add_event(struct iio_dev *indio_dev, in iio_device_add_event() argument
387 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_device_add_event()
421 (i << 16) | spec_index, shared_by, &indio_dev->dev, in iio_device_add_event()
438 static int iio_device_add_event_label(struct iio_dev *indio_dev, in iio_device_add_event_label() argument
444 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_device_add_event_label()
448 if (!indio_dev->info->read_event_label) in iio_device_add_event_label()
462 spec_index, IIO_SEPARATE, &indio_dev->dev, NULL, in iio_device_add_event_label()
473 static int iio_device_add_event_sysfs(struct iio_dev *indio_dev, in iio_device_add_event_sysfs() argument
484 ret = iio_device_add_event(indio_dev, chan, i, type, dir, in iio_device_add_event_sysfs()
490 ret = iio_device_add_event(indio_dev, chan, i, type, dir, in iio_device_add_event_sysfs()
497 ret = iio_device_add_event(indio_dev, chan, i, type, dir, in iio_device_add_event_sysfs()
504 ret = iio_device_add_event(indio_dev, chan, i, type, dir, in iio_device_add_event_sysfs()
511 ret = iio_device_add_event_label(indio_dev, chan, i, type, dir); in iio_device_add_event_sysfs()
520 static inline int __iio_add_event_config_attrs(struct iio_dev *indio_dev) in __iio_add_event_config_attrs() argument
525 for (j = 0; j < indio_dev->num_channels; j++) { in __iio_add_event_config_attrs()
526 ret = iio_device_add_event_sysfs(indio_dev, in __iio_add_event_config_attrs()
527 &indio_dev->channels[j]); in __iio_add_event_config_attrs()
535 static bool iio_check_for_dynamic_events(struct iio_dev *indio_dev) in iio_check_for_dynamic_events() argument
539 for (j = 0; j < indio_dev->num_channels; j++) { in iio_check_for_dynamic_events()
540 if (indio_dev->channels[j].num_event_specs != 0) in iio_check_for_dynamic_events()
553 static long iio_event_ioctl(struct iio_dev *indio_dev, struct file *filp, in iio_event_ioctl() argument
560 fd = iio_event_getfd(indio_dev); in iio_event_ioctl()
572 int iio_device_register_eventset(struct iio_dev *indio_dev) in iio_device_register_eventset() argument
574 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_device_register_eventset()
580 if (!(indio_dev->info->event_attrs || in iio_device_register_eventset()
581 iio_check_for_dynamic_events(indio_dev))) in iio_device_register_eventset()
593 if (indio_dev->info->event_attrs != NULL) { in iio_device_register_eventset()
594 attr = indio_dev->info->event_attrs->attrs; in iio_device_register_eventset()
599 if (indio_dev->channels) { in iio_device_register_eventset()
600 ret = __iio_add_event_config_attrs(indio_dev); in iio_device_register_eventset()
614 if (indio_dev->info->event_attrs) in iio_device_register_eventset()
616 indio_dev->info->event_attrs->attrs, in iio_device_register_eventset()
623 ret = iio_device_register_sysfs_group(indio_dev, &ev_int->group); in iio_device_register_eventset()
628 iio_device_ioctl_handler_register(&iio_dev_opaque->indio_dev, in iio_device_register_eventset()
649 void iio_device_wakeup_eventset(struct iio_dev *indio_dev) in iio_device_wakeup_eventset() argument
651 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_device_wakeup_eventset()
658 void iio_device_unregister_eventset(struct iio_dev *indio_dev) in iio_device_unregister_eventset() argument
660 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_device_unregister_eventset()