/* * audio-hal * * Copyright (c) 2021 Samsung Electronics Co., Ltd. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #include #include #include #include #include #include static int audio_sc7727_init(void **data) { hal_backend_audio_funcs *funcs; funcs = calloc(1, sizeof(hal_backend_audio_funcs)); if (!funcs) return -ENOMEM; funcs->init = audio_init; funcs->deinit = audio_deinit; funcs->get_volume_level_max = audio_get_volume_level_max; funcs->get_volume_level = audio_get_volume_level; funcs->set_volume_level = audio_set_volume_level; funcs->get_volume_value = audio_get_volume_value; funcs->get_volume_mute = audio_get_volume_mute; funcs->set_volume_mute = audio_set_volume_mute; funcs->set_volume_ratio = audio_set_volume_ratio; funcs->notify_ducking_activation_changed = audio_notify_ducking_activation_changed; funcs->update_route = audio_update_route; funcs->update_route_option = audio_update_route_option; funcs->notify_stream_connection_changed = audio_notify_stream_connection_changed; funcs->pcm_open = audio_pcm_open; funcs->pcm_start = audio_pcm_start; funcs->pcm_stop = audio_pcm_stop; funcs->pcm_close = audio_pcm_close; funcs->pcm_avail = audio_pcm_avail; funcs->pcm_write = audio_pcm_write; funcs->pcm_read = audio_pcm_read; funcs->pcm_get_fd = audio_pcm_get_fd; funcs->pcm_recover = audio_pcm_recover; funcs->pcm_get_params = audio_pcm_get_params; funcs->pcm_set_params = audio_pcm_set_params; funcs->add_message_cb = audio_add_message_cb; funcs->remove_message_cb = audio_remove_message_cb; *data = (void *)funcs; return 0; } static int audio_sc7727_exit(void *data) { if (!data) return -EINVAL; free(data); return 0; } hal_backend hal_backend_audio_data = { .name = "audio-sc7727", .vendor = "sprd", .abi_version = HAL_ABI_VERSION_TIZEN_6_5, .init = audio_sc7727_init, .exit = audio_sc7727_exit, };