Lines Matching refs:rdev
666 struct stub_radio_device *rdev = (struct stub_radio_device *)dev; in rdev_open_tuner() local
669 ALOGI("%s rdev %p", __func__, rdev); in rdev_open_tuner()
670 pthread_mutex_lock(&rdev->lock); in rdev_open_tuner()
672 if (rdev->tuner != NULL) { in rdev_open_tuner()
683 rdev->tuner = (struct stub_radio_tuner *)calloc(1, sizeof(struct stub_radio_tuner)); in rdev_open_tuner()
684 if (rdev->tuner == NULL) { in rdev_open_tuner()
689 rdev->tuner->interface.set_configuration = tuner_set_configuration; in rdev_open_tuner()
690 rdev->tuner->interface.get_configuration = tuner_get_configuration; in rdev_open_tuner()
691 rdev->tuner->interface.scan = tuner_scan; in rdev_open_tuner()
692 rdev->tuner->interface.step = tuner_step; in rdev_open_tuner()
693 rdev->tuner->interface.tune = tuner_tune; in rdev_open_tuner()
694 rdev->tuner->interface.cancel = tuner_cancel; in rdev_open_tuner()
695 rdev->tuner->interface.get_program_information = tuner_get_program_information; in rdev_open_tuner()
697 rdev->tuner->audio = audio; in rdev_open_tuner()
698 rdev->tuner->callback = callback; in rdev_open_tuner()
699 rdev->tuner->cookie = cookie; in rdev_open_tuner()
701 rdev->tuner->dev = rdev; in rdev_open_tuner()
703 pthread_mutex_init(&rdev->tuner->lock, (const pthread_mutexattr_t *) NULL); in rdev_open_tuner()
704 pthread_cond_init(&rdev->tuner->cond, (const pthread_condattr_t *) NULL); in rdev_open_tuner()
705 pthread_create(&rdev->tuner->callback_thread, (const pthread_attr_t *) NULL, in rdev_open_tuner()
706 callback_thread_loop, rdev->tuner); in rdev_open_tuner()
707 list_init(&rdev->tuner->command_list); in rdev_open_tuner()
709 pthread_mutex_lock(&rdev->tuner->lock); in rdev_open_tuner()
710 send_command_l(rdev->tuner, CMD_CONFIG, thread_cmd_delay_ms[CMD_CONFIG], (void *)config); in rdev_open_tuner()
711 pthread_mutex_unlock(&rdev->tuner->lock); in rdev_open_tuner()
713 *tuner = &rdev->tuner->interface; in rdev_open_tuner()
716 pthread_mutex_unlock(&rdev->lock); in rdev_open_tuner()
724 struct stub_radio_device *rdev = (struct stub_radio_device *)dev; in rdev_close_tuner() local
729 pthread_mutex_lock(&rdev->lock); in rdev_close_tuner()
746 rdev->tuner = NULL; in rdev_close_tuner()
749 pthread_mutex_unlock(&rdev->lock); in rdev_close_tuner()
755 struct stub_radio_device *rdev = (struct stub_radio_device *)device; in rdev_close() local
756 if (rdev != NULL) { in rdev_close()
757 free(rdev->tuner); in rdev_close()
759 free(rdev); in rdev_close()
766 struct stub_radio_device *rdev; in rdev_open() local
771 rdev = calloc(1, sizeof(struct stub_radio_device)); in rdev_open()
772 if (!rdev) in rdev_open()
775 rdev->device.common.tag = HARDWARE_DEVICE_TAG; in rdev_open()
776 rdev->device.common.version = RADIO_DEVICE_API_VERSION_1_0; in rdev_open()
777 rdev->device.common.module = (struct hw_module_t *) module; in rdev_open()
778 rdev->device.common.close = rdev_close; in rdev_open()
779 rdev->device.get_properties = rdev_get_properties; in rdev_open()
780 rdev->device.open_tuner = rdev_open_tuner; in rdev_open()
781 rdev->device.close_tuner = rdev_close_tuner; in rdev_open()
783 pthread_mutex_init(&rdev->lock, (const pthread_mutexattr_t *) NULL); in rdev_open()
785 *device = &rdev->device.common; in rdev_open()