Lines Matching refs:rdev

628     struct stub_radio_device *rdev = (struct stub_radio_device *)dev;  in rdev_get_properties()  local
644 struct stub_radio_device *rdev = (struct stub_radio_device *)dev; in rdev_open_tuner() local
647 ALOGI("%s rdev %p", __func__, rdev); in rdev_open_tuner()
648 pthread_mutex_lock(&rdev->lock); in rdev_open_tuner()
650 if (rdev->tuner != NULL) { in rdev_open_tuner()
660 rdev->tuner = (struct stub_radio_tuner *)calloc(1, sizeof(struct stub_radio_tuner)); in rdev_open_tuner()
661 if (rdev->tuner == NULL) { in rdev_open_tuner()
666 rdev->tuner->interface.set_configuration = tuner_set_configuration; in rdev_open_tuner()
667 rdev->tuner->interface.get_configuration = tuner_get_configuration; in rdev_open_tuner()
668 rdev->tuner->interface.scan = tuner_scan; in rdev_open_tuner()
669 rdev->tuner->interface.step = tuner_step; in rdev_open_tuner()
670 rdev->tuner->interface.tune = tuner_tune; in rdev_open_tuner()
671 rdev->tuner->interface.cancel = tuner_cancel; in rdev_open_tuner()
672 rdev->tuner->interface.get_program_information = tuner_get_program_information; in rdev_open_tuner()
674 rdev->tuner->audio = audio; in rdev_open_tuner()
675 rdev->tuner->callback = callback; in rdev_open_tuner()
676 rdev->tuner->cookie = cookie; in rdev_open_tuner()
678 rdev->tuner->dev = rdev; in rdev_open_tuner()
680 pthread_mutex_init(&rdev->tuner->lock, (const pthread_mutexattr_t *) NULL); in rdev_open_tuner()
681 pthread_cond_init(&rdev->tuner->cond, (const pthread_condattr_t *) NULL); in rdev_open_tuner()
682 pthread_create(&rdev->tuner->callback_thread, (const pthread_attr_t *) NULL, in rdev_open_tuner()
683 callback_thread_loop, rdev->tuner); in rdev_open_tuner()
684 list_init(&rdev->tuner->command_list); in rdev_open_tuner()
686 pthread_mutex_lock(&rdev->tuner->lock); in rdev_open_tuner()
687 send_command_l(rdev->tuner, CMD_CONFIG, 500, (void *)config); in rdev_open_tuner()
688 pthread_mutex_unlock(&rdev->tuner->lock); in rdev_open_tuner()
690 *tuner = &rdev->tuner->interface; in rdev_open_tuner()
693 pthread_mutex_unlock(&rdev->lock); in rdev_open_tuner()
701 struct stub_radio_device *rdev = (struct stub_radio_device *)dev; in rdev_close_tuner() local
706 pthread_mutex_lock(&rdev->lock); in rdev_close_tuner()
723 rdev->tuner = NULL; in rdev_close_tuner()
726 pthread_mutex_unlock(&rdev->lock); in rdev_close_tuner()
732 struct stub_radio_device *rdev = (struct stub_radio_device *)device; in rdev_close() local
733 if (rdev != NULL) { in rdev_close()
734 free(rdev->tuner); in rdev_close()
736 free(rdev); in rdev_close()
743 struct stub_radio_device *rdev; in rdev_open() local
749 rdev = calloc(1, sizeof(struct stub_radio_device)); in rdev_open()
750 if (!rdev) in rdev_open()
753 rdev->device.common.tag = HARDWARE_DEVICE_TAG; in rdev_open()
754 rdev->device.common.version = RADIO_DEVICE_API_VERSION_1_0; in rdev_open()
755 rdev->device.common.module = (struct hw_module_t *) module; in rdev_open()
756 rdev->device.common.close = rdev_close; in rdev_open()
757 rdev->device.get_properties = rdev_get_properties; in rdev_open()
758 rdev->device.open_tuner = rdev_open_tuner; in rdev_open()
759 rdev->device.close_tuner = rdev_close_tuner; in rdev_open()
761 pthread_mutex_init(&rdev->lock, (const pthread_mutexattr_t *) NULL); in rdev_open()
763 *device = &rdev->device.common; in rdev_open()