Lines Matching refs:st_dev
163 static struct sound_trigger_audio_device *st_dev; variable
171 list_empty(&st_dev->st_ses_list), capture_handle); in get_sound_trigger_info()
172 list_for_each(node, &st_dev->st_ses_list) { in get_sound_trigger_info()
226 if (!st_dev) in audio_hw_call_back()
229 pthread_mutex_lock(&st_dev->lock); in audio_hw_call_back()
246 list_add_tail(&st_dev->st_ses_list, &st_ses_info->list); in audio_hw_call_back()
270 pthread_mutex_unlock(&st_dev->lock); in audio_hw_call_back()
281 if (!st_dev) in audio_extn_sound_trigger_read()
291 pthread_mutex_lock(&st_dev->lock); in audio_extn_sound_trigger_read()
293 pthread_mutex_unlock(&st_dev->lock); in audio_extn_sound_trigger_read()
298 ret = st_dev->st_callback(AUDIO_EVENT_READ_SAMPLES, &event); in audio_extn_sound_trigger_read()
318 if (!st_dev || !in || !in->is_st_session_active) in audio_extn_sound_trigger_stop_lab()
321 pthread_mutex_lock(&st_dev->lock); in audio_extn_sound_trigger_stop_lab()
323 pthread_mutex_unlock(&st_dev->lock); in audio_extn_sound_trigger_stop_lab()
327 st_dev->st_callback(AUDIO_EVENT_STOP_LAB, &event); in audio_extn_sound_trigger_stop_lab()
337 if (!st_dev || !in) in audio_extn_sound_trigger_check_and_get_session()
340 pthread_mutex_lock(&st_dev->lock); in audio_extn_sound_trigger_check_and_get_session()
343 list_empty(&st_dev->st_ses_list), in->capture_handle); in audio_extn_sound_trigger_check_and_get_session()
344 list_for_each(node, &st_dev->st_ses_list) { in audio_extn_sound_trigger_check_and_get_session()
356 pthread_mutex_unlock(&st_dev->lock); in audio_extn_sound_trigger_check_and_get_session()
364 if (!st_dev) in audio_extn_sound_trigger_update_device_status()
386 st_dev->st_callback(AUDIO_EVENT_CAPTURE_DEVICE_INACTIVE, NULL); in audio_extn_sound_trigger_update_device_status()
389 st_dev->st_callback(AUDIO_EVENT_CAPTURE_DEVICE_ACTIVE, NULL); in audio_extn_sound_trigger_update_device_status()
405 if (!st_dev) in audio_extn_sound_trigger_update_stream_status()
408 if (st_dev->sthal_prop_api_version < STHAL_PROP_API_VERSION_1_0) in audio_extn_sound_trigger_update_stream_status()
435 st_dev->st_callback(ev, &ev_info); in audio_extn_sound_trigger_update_stream_status()
447 if(!st_dev || !params) { in audio_extn_sound_trigger_set_parameters()
457 st_dev->st_callback(AUDIO_EVENT_SSR, &event); in audio_extn_sound_trigger_set_parameters()
461 st_dev->st_callback(AUDIO_EVENT_SSR, &event); in audio_extn_sound_trigger_set_parameters()
471 st_dev->st_callback(AUDIO_EVENT_SSR, &event); in audio_extn_sound_trigger_set_parameters()
475 st_dev->st_callback(AUDIO_EVENT_SSR, &event); in audio_extn_sound_trigger_set_parameters()
484 st_dev->st_callback(AUDIO_EVENT_NUM_ST_SESSIONS, &event); in audio_extn_sound_trigger_set_parameters()
491 st_dev->st_callback(AUDIO_EVENT_SSR, &event); in audio_extn_sound_trigger_set_parameters()
494 st_dev->st_callback(AUDIO_EVENT_SSR, &event); in audio_extn_sound_trigger_set_parameters()
509 st_dev = (struct sound_trigger_audio_device*) in audio_extn_sound_trigger_init()
511 if (!st_dev) { in audio_extn_sound_trigger_init()
520 st_dev->lib_handle = dlopen(sound_trigger_lib, RTLD_NOW); in audio_extn_sound_trigger_init()
522 if (st_dev->lib_handle == NULL) { in audio_extn_sound_trigger_init()
529 DLSYM(st_dev->lib_handle, st_dev->st_callback, sound_trigger_hw_call_back, in audio_extn_sound_trigger_init()
534 DLSYM(st_dev->lib_handle, sthal_prop_api_version, in audio_extn_sound_trigger_init()
537 st_dev->sthal_prop_api_version = 0; in audio_extn_sound_trigger_init()
540 st_dev->sthal_prop_api_version = *(int*)sthal_prop_api_version; in audio_extn_sound_trigger_init()
541 if (MAJOR_VERSION(st_dev->sthal_prop_api_version) != in audio_extn_sound_trigger_init()
545 st_dev->sthal_prop_api_version); in audio_extn_sound_trigger_init()
549 st_dev->sthal_prop_api_version); in audio_extn_sound_trigger_init()
552 st_dev->adev = adev; in audio_extn_sound_trigger_init()
553 list_init(&st_dev->st_ses_list); in audio_extn_sound_trigger_init()
554 audio_extn_snd_mon_register_listener(st_dev, stdev_snd_mon_cb); in audio_extn_sound_trigger_init()
559 if (st_dev->lib_handle) in audio_extn_sound_trigger_init()
560 dlclose(st_dev->lib_handle); in audio_extn_sound_trigger_init()
561 free(st_dev); in audio_extn_sound_trigger_init()
562 st_dev = NULL; in audio_extn_sound_trigger_init()
569 if (st_dev && (st_dev->adev == adev) && st_dev->lib_handle) { in audio_extn_sound_trigger_deinit()
570 audio_extn_snd_mon_unregister_listener(st_dev); in audio_extn_sound_trigger_deinit()
571 dlclose(st_dev->lib_handle); in audio_extn_sound_trigger_deinit()
572 free(st_dev); in audio_extn_sound_trigger_deinit()
573 st_dev = NULL; in audio_extn_sound_trigger_deinit()