Lines Matching refs:hfpio
55 struct hfp_io *hfpio = (struct hfp_io *)iodev; in frames_queued() local
57 if (!hfp_info_running(hfpio->info)) in frames_queued()
63 return hfp_buf_queued(hfpio->info, iodev); in frames_queued()
69 struct hfp_io *hfpio = (struct hfp_io *)data; in hfp_packet_size_changed() local
70 struct cras_iodev *iodev = &hfpio->base; in hfp_packet_size_changed()
74 iodev->buffer_size = hfp_buf_size(hfpio->info, iodev); in hfp_packet_size_changed()
75 cras_bt_device_iodev_buffer_size_changed(hfpio->device); in hfp_packet_size_changed()
80 struct hfp_io *hfpio = (struct hfp_io *)iodev; in configure_dev() local
89 if (hfp_info_running(hfpio->info)) in configure_dev()
92 sk = cras_bt_device_sco_connect(hfpio->device); in configure_dev()
96 mtu = cras_bt_device_sco_mtu(hfpio->device, sk); in configure_dev()
99 err = hfp_info_start(sk, mtu, hfpio->info); in configure_dev()
104 hfp_info_add_iodev(hfpio->info, iodev); in configure_dev()
105 hfp_set_call_status(hfpio->slc, 1); in configure_dev()
107 iodev->buffer_size = hfp_buf_size(hfpio->info, iodev); in configure_dev()
117 struct hfp_io *hfpio = (struct hfp_io *)iodev; in close_dev() local
119 hfp_info_rm_iodev(hfpio->info, iodev); in close_dev()
120 if (hfp_info_running(hfpio->info) && !hfp_info_has_iodev(hfpio->info)) { in close_dev()
121 hfp_info_stop(hfpio->info); in close_dev()
122 hfp_set_call_status(hfpio->slc, 0); in close_dev()
133 struct hfp_io *hfpio = (struct hfp_io *)iodev; in set_hfp_volume() local
139 hfp_event_speaker_gain(hfpio->slc, volume); in set_hfp_volume()
153 struct hfp_io *hfpio = (struct hfp_io *)iodev; in get_buffer() local
156 if (!hfp_info_running(hfpio->info)) in get_buffer()
159 hfp_buf_acquire(hfpio->info, iodev, &dst, frames); in get_buffer()
173 struct hfp_io *hfpio = (struct hfp_io *)iodev; in put_buffer() local
175 if (!hfp_info_running(hfpio->info)) in put_buffer()
178 hfp_buf_release(hfpio->info, iodev, nwritten); in put_buffer()
184 struct hfp_io *hfpio = (struct hfp_io *)iodev; in flush_buffer() local
188 nframes = hfp_buf_queued(hfpio->info, iodev); in flush_buffer()
189 hfp_buf_release(hfpio->info, iodev, nframes); in flush_buffer()
199 void hfp_free_resources(struct hfp_io *hfpio) in hfp_free_resources() argument
202 node = hfpio->base.active_node; in hfp_free_resources()
204 cras_iodev_rm_node(&hfpio->base, node); in hfp_free_resources()
207 free(hfpio->base.supported_channel_counts); in hfp_free_resources()
208 free(hfpio->base.supported_rates); in hfp_free_resources()
209 free(hfpio->base.supported_formats); in hfp_free_resources()
210 cras_iodev_free_resources(&hfpio->base); in hfp_free_resources()
220 struct hfp_io *hfpio; in hfp_iodev_create() local
225 hfpio = (struct hfp_io *)calloc(1, sizeof(*hfpio)); in hfp_iodev_create()
226 if (!hfpio) in hfp_iodev_create()
229 iodev = &hfpio->base; in hfp_iodev_create()
232 hfpio->device = device; in hfp_iodev_create()
233 hfpio->slc = slc; in hfp_iodev_create()
272 hfpio->info = info; in hfp_iodev_create()
275 hfpio); in hfp_iodev_create()
280 if (hfpio) { in hfp_iodev_create()
281 hfp_free_resources(hfpio); in hfp_iodev_create()
282 free(hfpio); in hfp_iodev_create()
289 struct hfp_io *hfpio = (struct hfp_io *)iodev; in hfp_iodev_destroy() local
291 cras_bt_device_rm_iodev(hfpio->device, iodev); in hfp_iodev_destroy()
292 hfp_unregister_packet_size_changed_callback(hfpio->info, hfpio); in hfp_iodev_destroy()
293 hfp_free_resources(hfpio); in hfp_iodev_destroy()
294 free(hfpio); in hfp_iodev_destroy()