Lines Matching refs:hwc
53 struct iio_hw_consumer *hwc, struct iio_dev *indio_dev) in iio_hw_consumer_get_buffer() argument
58 list_for_each_entry(buf, &hwc->buffers, head) { in iio_hw_consumer_get_buffer()
72 list_add_tail(&buf->head, &hwc->buffers); in iio_hw_consumer_get_buffer()
86 struct iio_hw_consumer *hwc; in iio_hw_consumer_alloc() local
90 hwc = kzalloc(sizeof(*hwc), GFP_KERNEL); in iio_hw_consumer_alloc()
91 if (!hwc) in iio_hw_consumer_alloc()
94 INIT_LIST_HEAD(&hwc->buffers); in iio_hw_consumer_alloc()
96 hwc->channels = iio_channel_get_all(dev); in iio_hw_consumer_alloc()
97 if (IS_ERR(hwc->channels)) { in iio_hw_consumer_alloc()
98 ret = PTR_ERR(hwc->channels); in iio_hw_consumer_alloc()
102 chan = &hwc->channels[0]; in iio_hw_consumer_alloc()
104 buf = iio_hw_consumer_get_buffer(hwc, chan->indio_dev); in iio_hw_consumer_alloc()
113 return hwc; in iio_hw_consumer_alloc()
116 list_for_each_entry(buf, &hwc->buffers, head) in iio_hw_consumer_alloc()
118 iio_channel_release_all(hwc->channels); in iio_hw_consumer_alloc()
120 kfree(hwc); in iio_hw_consumer_alloc()
129 void iio_hw_consumer_free(struct iio_hw_consumer *hwc) in iio_hw_consumer_free() argument
133 iio_channel_release_all(hwc->channels); in iio_hw_consumer_free()
134 list_for_each_entry_safe(buf, n, &hwc->buffers, head) in iio_hw_consumer_free()
136 kfree(hwc); in iio_hw_consumer_free()
178 int iio_hw_consumer_enable(struct iio_hw_consumer *hwc) in iio_hw_consumer_enable() argument
183 list_for_each_entry(buf, &hwc->buffers, head) { in iio_hw_consumer_enable()
192 list_for_each_entry_continue_reverse(buf, &hwc->buffers, head) in iio_hw_consumer_enable()
202 void iio_hw_consumer_disable(struct iio_hw_consumer *hwc) in iio_hw_consumer_disable() argument
206 list_for_each_entry(buf, &hwc->buffers, head) in iio_hw_consumer_disable()