Lines Matching refs:iio_dev_opaque
309 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_buffer_wakeup_poll() local
313 for (i = 0; i < iio_dev_opaque->attached_buffers_cnt; i++) { in iio_buffer_wakeup_poll()
314 buffer = iio_dev_opaque->attached_buffers[i]; in iio_buffer_wakeup_poll()
341 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_device_detach_buffers() local
345 for (i = 0; i < iio_dev_opaque->attached_buffers_cnt; i++) { in iio_device_detach_buffers()
346 buffer = iio_dev_opaque->attached_buffers[i]; in iio_device_detach_buffers()
350 kfree(iio_dev_opaque->attached_buffers); in iio_device_detach_buffers()
510 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_scan_el_store() local
517 mutex_lock(&iio_dev_opaque->mlock); in iio_scan_el_store()
536 mutex_unlock(&iio_dev_opaque->mlock); in iio_scan_el_store()
558 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_scan_el_ts_store() local
566 mutex_lock(&iio_dev_opaque->mlock); in iio_scan_el_ts_store()
573 mutex_unlock(&iio_dev_opaque->mlock); in iio_scan_el_ts_store()
647 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in length_store() local
659 mutex_lock(&iio_dev_opaque->mlock); in length_store()
671 mutex_unlock(&iio_dev_opaque->mlock); in length_store()
699 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_storage_bytes_for_timestamp() local
702 iio_dev_opaque->scan_index_timestamp); in iio_storage_bytes_for_timestamp()
734 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_buffer_activate() local
737 list_add(&buffer->buffer_list, &iio_dev_opaque->buffer_list); in iio_buffer_activate()
749 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_buffer_deactivate_all() local
753 &iio_dev_opaque->buffer_list, buffer_list) in iio_buffer_deactivate_all()
826 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_verify_update() local
849 list_is_singular(&iio_dev_opaque->buffer_list)) in iio_verify_update()
854 list_for_each_entry(buffer, &iio_dev_opaque->buffer_list, buffer_list) { in iio_verify_update()
875 if (insert_buffer && !list_empty(&iio_dev_opaque->buffer_list)) in iio_verify_update()
895 list_for_each_entry(buffer, &iio_dev_opaque->buffer_list, buffer_list) { in iio_verify_update()
1041 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_update_demux() local
1045 list_for_each_entry(buffer, &iio_dev_opaque->buffer_list, buffer_list) { in iio_update_demux()
1053 list_for_each_entry(buffer, &iio_dev_opaque->buffer_list, buffer_list) in iio_update_demux()
1062 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_enable_buffers() local
1069 iio_dev_opaque->currentmode = config->mode; in iio_enable_buffers()
1099 list_for_each_entry(buffer, &iio_dev_opaque->buffer_list, buffer_list) { in iio_enable_buffers()
1107 if (iio_dev_opaque->currentmode == INDIO_BUFFER_TRIGGERED) { in iio_enable_buffers()
1126 if (iio_dev_opaque->currentmode == INDIO_BUFFER_TRIGGERED) { in iio_enable_buffers()
1131 buffer = list_prepare_entry(tmp, &iio_dev_opaque->buffer_list, buffer_list); in iio_enable_buffers()
1132 list_for_each_entry_continue_reverse(buffer, &iio_dev_opaque->buffer_list, in iio_enable_buffers()
1139 iio_dev_opaque->currentmode = INDIO_DIRECT_MODE; in iio_enable_buffers()
1147 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_disable_buffers() local
1153 if (list_empty(&iio_dev_opaque->buffer_list)) in iio_disable_buffers()
1169 if (iio_dev_opaque->currentmode == INDIO_BUFFER_TRIGGERED) { in iio_disable_buffers()
1174 list_for_each_entry(buffer, &iio_dev_opaque->buffer_list, buffer_list) { in iio_disable_buffers()
1188 iio_dev_opaque->currentmode = INDIO_DIRECT_MODE; in iio_disable_buffers()
1197 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in __iio_update_buffers() local
1222 if (list_empty(&iio_dev_opaque->buffer_list)) in __iio_update_buffers()
1251 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_update_buffers() local
1261 mutex_lock(&iio_dev_opaque->info_exist_lock); in iio_update_buffers()
1262 mutex_lock(&iio_dev_opaque->mlock); in iio_update_buffers()
1283 mutex_unlock(&iio_dev_opaque->mlock); in iio_update_buffers()
1284 mutex_unlock(&iio_dev_opaque->info_exist_lock); in iio_update_buffers()
1302 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in enable_store() local
1310 mutex_lock(&iio_dev_opaque->mlock); in enable_store()
1324 mutex_unlock(&iio_dev_opaque->mlock); in enable_store()
1341 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in watermark_store() local
1352 mutex_lock(&iio_dev_opaque->mlock); in watermark_store()
1366 mutex_unlock(&iio_dev_opaque->mlock); in watermark_store()
1449 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_buffer_register_legacy_sysfs_groups() local
1460 group = &iio_dev_opaque->legacy_buffer_group; in iio_buffer_register_legacy_sysfs_groups()
1477 group = &iio_dev_opaque->legacy_scan_el_group; in iio_buffer_register_legacy_sysfs_groups()
1488 kfree(iio_dev_opaque->legacy_scan_el_group.attrs); in iio_buffer_register_legacy_sysfs_groups()
1490 kfree(iio_dev_opaque->legacy_buffer_group.attrs); in iio_buffer_register_legacy_sysfs_groups()
1497 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_buffer_unregister_legacy_sysfs_groups() local
1499 kfree(iio_dev_opaque->legacy_buffer_group.attrs); in iio_buffer_unregister_legacy_sysfs_groups()
1500 kfree(iio_dev_opaque->legacy_scan_el_group.attrs); in iio_buffer_unregister_legacy_sysfs_groups()
1529 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_device_buffer_getfd() local
1538 if (idx >= iio_dev_opaque->attached_buffers_cnt) in iio_device_buffer_getfd()
1543 buffer = iio_dev_opaque->attached_buffers[idx]; in iio_device_buffer_getfd()
1606 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in __iio_buffer_alloc_sysfs_and_mask() local
1648 iio_dev_opaque->scan_index_timestamp = in __iio_buffer_alloc_sysfs_and_mask()
1746 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_buffers_alloc_sysfs_and_mask() local
1761 if (!iio_dev_opaque->attached_buffers_cnt) in iio_buffers_alloc_sysfs_and_mask()
1764 for (idx = 0; idx < iio_dev_opaque->attached_buffers_cnt; idx++) { in iio_buffers_alloc_sysfs_and_mask()
1765 buffer = iio_dev_opaque->attached_buffers[idx]; in iio_buffers_alloc_sysfs_and_mask()
1771 sz = sizeof(*(iio_dev_opaque->buffer_ioctl_handler)); in iio_buffers_alloc_sysfs_and_mask()
1772 iio_dev_opaque->buffer_ioctl_handler = kzalloc(sz, GFP_KERNEL); in iio_buffers_alloc_sysfs_and_mask()
1773 if (!iio_dev_opaque->buffer_ioctl_handler) { in iio_buffers_alloc_sysfs_and_mask()
1778 iio_dev_opaque->buffer_ioctl_handler->ioctl = iio_device_buffer_ioctl; in iio_buffers_alloc_sysfs_and_mask()
1780 iio_dev_opaque->buffer_ioctl_handler); in iio_buffers_alloc_sysfs_and_mask()
1786 buffer = iio_dev_opaque->attached_buffers[idx]; in iio_buffers_alloc_sysfs_and_mask()
1794 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_buffers_free_sysfs_and_mask() local
1798 if (!iio_dev_opaque->attached_buffers_cnt) in iio_buffers_free_sysfs_and_mask()
1801 iio_device_ioctl_handler_unregister(iio_dev_opaque->buffer_ioctl_handler); in iio_buffers_free_sysfs_and_mask()
1802 kfree(iio_dev_opaque->buffer_ioctl_handler); in iio_buffers_free_sysfs_and_mask()
1804 for (i = iio_dev_opaque->attached_buffers_cnt - 1; i >= 0; i--) { in iio_buffers_free_sysfs_and_mask()
1805 buffer = iio_dev_opaque->attached_buffers[i]; in iio_buffers_free_sysfs_and_mask()
1864 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_push_to_buffers() local
1868 list_for_each_entry(buf, &iio_dev_opaque->buffer_list, buffer_list) { in iio_push_to_buffers()
1896 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_push_to_buffers_with_ts_unaligned() local
1906 if (iio_dev_opaque->bounce_buffer_size != indio_dev->scan_bytes) { in iio_push_to_buffers_with_ts_unaligned()
1910 iio_dev_opaque->bounce_buffer, in iio_push_to_buffers_with_ts_unaligned()
1914 iio_dev_opaque->bounce_buffer = bb; in iio_push_to_buffers_with_ts_unaligned()
1915 iio_dev_opaque->bounce_buffer_size = indio_dev->scan_bytes; in iio_push_to_buffers_with_ts_unaligned()
1917 memcpy(iio_dev_opaque->bounce_buffer, data, data_sz); in iio_push_to_buffers_with_ts_unaligned()
1919 iio_dev_opaque->bounce_buffer, in iio_push_to_buffers_with_ts_unaligned()
1982 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); in iio_device_attach_buffer() local
1983 struct iio_buffer **new, **old = iio_dev_opaque->attached_buffers; in iio_device_attach_buffer()
1984 unsigned int cnt = iio_dev_opaque->attached_buffers_cnt; in iio_device_attach_buffer()
1991 iio_dev_opaque->attached_buffers = new; in iio_device_attach_buffer()
1999 iio_dev_opaque->attached_buffers[cnt - 1] = buffer; in iio_device_attach_buffer()
2000 iio_dev_opaque->attached_buffers_cnt = cnt; in iio_device_attach_buffer()