Lines Matching refs:indio_dev

64 int iio_push_event(struct iio_dev *indio_dev, u64 ev_code, s64 timestamp)  in iio_push_event()  argument
66 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_push_event()
100 struct iio_dev *indio_dev = filep->private_data; in iio_event_poll() local
101 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_event_poll()
105 if (!indio_dev->info) in iio_event_poll()
121 struct iio_dev *indio_dev = filep->private_data; in iio_event_chrdev_read() local
122 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_event_chrdev_read()
127 if (!indio_dev->info) in iio_event_chrdev_read()
140 indio_dev->info == NULL); in iio_event_chrdev_read()
143 if (indio_dev->info == NULL) in iio_event_chrdev_read()
171 struct iio_dev *indio_dev = filep->private_data; in iio_event_chrdev_release() local
172 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_event_chrdev_release()
177 iio_device_put(indio_dev); in iio_event_chrdev_release()
190 int iio_event_getfd(struct iio_dev *indio_dev) in iio_event_getfd() argument
192 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_event_getfd()
199 fd = mutex_lock_interruptible(&indio_dev->mlock); in iio_event_getfd()
208 iio_device_get(indio_dev); in iio_event_getfd()
211 indio_dev, O_RDONLY | O_CLOEXEC); in iio_event_getfd()
214 iio_device_put(indio_dev); in iio_event_getfd()
220 mutex_unlock(&indio_dev->mlock); in iio_event_getfd()
275 struct iio_dev *indio_dev = dev_to_iio_dev(dev); in iio_ev_state_store() local
284 ret = indio_dev->info->write_event_config(indio_dev, in iio_ev_state_store()
295 struct iio_dev *indio_dev = dev_to_iio_dev(dev); in iio_ev_state_show() local
299 val = indio_dev->info->read_event_config(indio_dev, in iio_ev_state_show()
312 struct iio_dev *indio_dev = dev_to_iio_dev(dev); in iio_ev_value_show() local
317 ret = indio_dev->info->read_event_value(indio_dev, in iio_ev_value_show()
333 struct iio_dev *indio_dev = dev_to_iio_dev(dev); in iio_ev_value_store() local
338 if (!indio_dev->info->write_event_value) in iio_ev_value_store()
344 ret = indio_dev->info->write_event_value(indio_dev, in iio_ev_value_store()
354 static int iio_device_add_event(struct iio_dev *indio_dev, in iio_device_add_event() argument
359 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_device_add_event()
392 (i << 16) | spec_index, shared_by, &indio_dev->dev, in iio_device_add_event()
408 static int iio_device_add_event_sysfs(struct iio_dev *indio_dev, in iio_device_add_event_sysfs() argument
419 ret = iio_device_add_event(indio_dev, chan, i, type, dir, in iio_device_add_event_sysfs()
425 ret = iio_device_add_event(indio_dev, chan, i, type, dir, in iio_device_add_event_sysfs()
432 ret = iio_device_add_event(indio_dev, chan, i, type, dir, in iio_device_add_event_sysfs()
439 ret = iio_device_add_event(indio_dev, chan, i, type, dir, in iio_device_add_event_sysfs()
450 static inline int __iio_add_event_config_attrs(struct iio_dev *indio_dev) in __iio_add_event_config_attrs() argument
455 for (j = 0; j < indio_dev->num_channels; j++) { in __iio_add_event_config_attrs()
456 ret = iio_device_add_event_sysfs(indio_dev, in __iio_add_event_config_attrs()
457 &indio_dev->channels[j]); in __iio_add_event_config_attrs()
465 static bool iio_check_for_dynamic_events(struct iio_dev *indio_dev) in iio_check_for_dynamic_events() argument
469 for (j = 0; j < indio_dev->num_channels; j++) { in iio_check_for_dynamic_events()
470 if (indio_dev->channels[j].num_event_specs != 0) in iio_check_for_dynamic_events()
484 int iio_device_register_eventset(struct iio_dev *indio_dev) in iio_device_register_eventset() argument
486 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_device_register_eventset()
492 if (!(indio_dev->info->event_attrs || in iio_device_register_eventset()
493 iio_check_for_dynamic_events(indio_dev))) in iio_device_register_eventset()
505 if (indio_dev->info->event_attrs != NULL) { in iio_device_register_eventset()
506 attr = indio_dev->info->event_attrs->attrs; in iio_device_register_eventset()
511 if (indio_dev->channels) { in iio_device_register_eventset()
512 ret = __iio_add_event_config_attrs(indio_dev); in iio_device_register_eventset()
526 if (indio_dev->info->event_attrs) in iio_device_register_eventset()
528 indio_dev->info->event_attrs->attrs, in iio_device_register_eventset()
534 indio_dev->groups[indio_dev->groupcounter++] = &ev_int->group; in iio_device_register_eventset()
552 void iio_device_wakeup_eventset(struct iio_dev *indio_dev) in iio_device_wakeup_eventset() argument
554 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_device_wakeup_eventset()
561 void iio_device_unregister_eventset(struct iio_dev *indio_dev) in iio_device_unregister_eventset() argument
563 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_device_unregister_eventset()