static int close_dev(struct cras_iodev *iodev) { struct hfp_io *hfpio = (struct hfp_io *)iodev; hfp_info_rm_iodev(hfpio->info, iodev); if (hfp_info_running(hfpio->info) && !hfp_info_has_iodev(hfpio->info)) { hfp_info_stop(hfpio->info); hfp_set_call_status(hfpio->slc, 0); } cras_iodev_free_format(iodev); cras_iodev_free_audio_area(iodev); return 0; }
static int close_record_dev(struct cras_iodev *iodev) { struct loopback_iodev *loopdev = (struct loopback_iodev *)iodev; struct byte_buffer *sbuf = loopdev->sample_buffer; struct cras_iodev *edev; cras_iodev_free_format(iodev); cras_iodev_free_audio_area(iodev); buf_reset(sbuf); edev = cras_iodev_list_get_first_enabled_iodev(CRAS_STREAM_OUTPUT); register_loopback_hook(loopdev->loopback_type, edev, NULL, NULL); cras_iodev_list_set_device_enabled_callback(NULL, NULL, (void *)iodev); return 0; }