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()
268 struct iio_dev *indio_dev = dev_to_iio_dev(dev); in iio_ev_state_store() local
277 ret = indio_dev->info->write_event_config(indio_dev, in iio_ev_state_store()
288 struct iio_dev *indio_dev = dev_to_iio_dev(dev); in iio_ev_state_show() local
292 val = indio_dev->info->read_event_config(indio_dev, in iio_ev_state_show()
305 struct iio_dev *indio_dev = dev_to_iio_dev(dev); in iio_ev_value_show() local
310 ret = indio_dev->info->read_event_value(indio_dev, in iio_ev_value_show()
326 struct iio_dev *indio_dev = dev_to_iio_dev(dev); in iio_ev_value_store() local
331 if (!indio_dev->info->write_event_value) in iio_ev_value_store()
337 ret = indio_dev->info->write_event_value(indio_dev, in iio_ev_value_store()
347 static int iio_device_add_event(struct iio_dev *indio_dev, in iio_device_add_event() argument
352 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_device_add_event()
385 (i << 16) | spec_index, shared_by, &indio_dev->dev, in iio_device_add_event()
401 static int iio_device_add_event_sysfs(struct iio_dev *indio_dev, in iio_device_add_event_sysfs() argument
412 ret = iio_device_add_event(indio_dev, chan, i, type, dir, in iio_device_add_event_sysfs()
418 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()
443 static inline int __iio_add_event_config_attrs(struct iio_dev *indio_dev) in __iio_add_event_config_attrs() argument
448 for (j = 0; j < indio_dev->num_channels; j++) { in __iio_add_event_config_attrs()
449 ret = iio_device_add_event_sysfs(indio_dev, in __iio_add_event_config_attrs()
450 &indio_dev->channels[j]); in __iio_add_event_config_attrs()
458 static bool iio_check_for_dynamic_events(struct iio_dev *indio_dev) in iio_check_for_dynamic_events() argument
462 for (j = 0; j < indio_dev->num_channels; j++) { in iio_check_for_dynamic_events()
463 if (indio_dev->channels[j].num_event_specs != 0) in iio_check_for_dynamic_events()
477 int iio_device_register_eventset(struct iio_dev *indio_dev) in iio_device_register_eventset() argument
479 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_device_register_eventset()
485 if (!(indio_dev->info->event_attrs || in iio_device_register_eventset()
486 iio_check_for_dynamic_events(indio_dev))) in iio_device_register_eventset()
498 if (indio_dev->info->event_attrs != NULL) { in iio_device_register_eventset()
499 attr = indio_dev->info->event_attrs->attrs; in iio_device_register_eventset()
504 if (indio_dev->channels) { in iio_device_register_eventset()
505 ret = __iio_add_event_config_attrs(indio_dev); in iio_device_register_eventset()
519 if (indio_dev->info->event_attrs) in iio_device_register_eventset()
521 indio_dev->info->event_attrs->attrs, in iio_device_register_eventset()
527 indio_dev->groups[indio_dev->groupcounter++] = &ev_int->group; in iio_device_register_eventset()
545 void iio_device_wakeup_eventset(struct iio_dev *indio_dev) in iio_device_wakeup_eventset() argument
547 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_device_wakeup_eventset()
554 void iio_device_unregister_eventset(struct iio_dev *indio_dev) in iio_device_unregister_eventset() argument
556 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_device_unregister_eventset()