Lines Matching refs:st_dev
54 static struct sound_trigger_audio_device *st_dev; variable
62 list_empty(&st_dev->st_ses_list), capture_handle); in get_sound_trigger_info()
63 list_for_each(node, &st_dev->st_ses_list) { in get_sound_trigger_info()
77 if (!st_dev) in audio_hw_call_back()
80 pthread_mutex_lock(&st_dev->lock); in audio_hw_call_back()
97 list_add_tail(&st_dev->st_ses_list, &st_ses_info->list); in audio_hw_call_back()
121 pthread_mutex_unlock(&st_dev->lock); in audio_hw_call_back()
132 if (!st_dev) in audio_extn_sound_trigger_read()
142 pthread_mutex_lock(&st_dev->lock); in audio_extn_sound_trigger_read()
144 pthread_mutex_unlock(&st_dev->lock); in audio_extn_sound_trigger_read()
149 ret = st_dev->st_callback(AUDIO_EVENT_READ_SAMPLES, &event); in audio_extn_sound_trigger_read()
170 if (!st_dev || !in) in audio_extn_sound_trigger_stop_lab()
173 pthread_mutex_lock(&st_dev->lock); in audio_extn_sound_trigger_stop_lab()
175 pthread_mutex_unlock(&st_dev->lock); in audio_extn_sound_trigger_stop_lab()
179 st_dev->st_callback(AUDIO_EVENT_STOP_LAB, &event); in audio_extn_sound_trigger_stop_lab()
187 if (!st_dev || !in) in audio_extn_sound_trigger_check_and_get_session()
190 pthread_mutex_lock(&st_dev->lock); in audio_extn_sound_trigger_check_and_get_session()
193 list_empty(&st_dev->st_ses_list), in->capture_handle); in audio_extn_sound_trigger_check_and_get_session()
194 list_for_each(node, &st_dev->st_ses_list) { in audio_extn_sound_trigger_check_and_get_session()
206 pthread_mutex_unlock(&st_dev->lock); in audio_extn_sound_trigger_check_and_get_session()
214 if (!st_dev) in audio_extn_sound_trigger_update_device_status()
236 st_dev->st_callback(AUDIO_EVENT_CAPTURE_DEVICE_INACTIVE, NULL); in audio_extn_sound_trigger_update_device_status()
239 st_dev->st_callback(AUDIO_EVENT_CAPTURE_DEVICE_ACTIVE, NULL); in audio_extn_sound_trigger_update_device_status()
255 if(!st_dev || !params) { in audio_extn_sound_trigger_set_parameters()
265 st_dev->st_callback(AUDIO_EVENT_SSR, &event); in audio_extn_sound_trigger_set_parameters()
269 st_dev->st_callback(AUDIO_EVENT_SSR, &event); in audio_extn_sound_trigger_set_parameters()
279 st_dev->st_callback(AUDIO_EVENT_SSR, &event); in audio_extn_sound_trigger_set_parameters()
283 st_dev->st_callback(AUDIO_EVENT_SSR, &event); in audio_extn_sound_trigger_set_parameters()
292 st_dev->st_callback(AUDIO_EVENT_NUM_ST_SESSIONS, &event); in audio_extn_sound_trigger_set_parameters()
304 st_dev = (struct sound_trigger_audio_device*) in audio_extn_sound_trigger_init()
306 if (!st_dev) { in audio_extn_sound_trigger_init()
315 st_dev->lib_handle = dlopen(sound_trigger_lib, RTLD_NOW); in audio_extn_sound_trigger_init()
317 if (st_dev->lib_handle == NULL) { in audio_extn_sound_trigger_init()
325 st_dev->st_callback = (sound_trigger_hw_call_back_t) in audio_extn_sound_trigger_init()
326 dlsym(st_dev->lib_handle, "sound_trigger_hw_call_back"); in audio_extn_sound_trigger_init()
328 if (st_dev->st_callback == NULL) { in audio_extn_sound_trigger_init()
334 st_dev->adev = adev; in audio_extn_sound_trigger_init()
335 list_init(&st_dev->st_ses_list); in audio_extn_sound_trigger_init()
340 if (st_dev->lib_handle) in audio_extn_sound_trigger_init()
341 dlclose(st_dev->lib_handle); in audio_extn_sound_trigger_init()
342 free(st_dev); in audio_extn_sound_trigger_init()
343 st_dev = NULL; in audio_extn_sound_trigger_init()
351 if (st_dev && (st_dev->adev == adev) && st_dev->lib_handle) { in audio_extn_sound_trigger_deinit()
352 dlclose(st_dev->lib_handle); in audio_extn_sound_trigger_deinit()
353 free(st_dev); in audio_extn_sound_trigger_deinit()
354 st_dev = NULL; in audio_extn_sound_trigger_deinit()