4 * Copyright (c) 2021 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
24 #include <tizen-audio.h>
25 #include <hal/hal-common-interface.h>
27 static int audio_alc5658_init(void **data)
29 hal_backend_audio_funcs *funcs;
31 funcs = calloc(1, sizeof(hal_backend_audio_funcs));
35 funcs->init = audio_init;
36 funcs->deinit = audio_deinit;
38 funcs->get_volume_level_max = audio_get_volume_level_max;
39 funcs->get_volume_level = audio_get_volume_level;
40 funcs->set_volume_level = audio_set_volume_level;
41 funcs->get_volume_value = audio_get_volume_value;
42 funcs->get_volume_mute = audio_get_volume_mute;
43 funcs->set_volume_mute = audio_set_volume_mute;
44 funcs->set_volume_ratio = audio_set_volume_ratio;
45 funcs->notify_ducking_activation_changed = audio_notify_ducking_activation_changed;
47 funcs->update_route = audio_update_route;
48 funcs->update_route_option = audio_update_route_option;
50 funcs->notify_stream_connection_changed = audio_notify_stream_connection_changed;
52 funcs->pcm_open = audio_pcm_open;
53 funcs->pcm_start = audio_pcm_start;
54 funcs->pcm_stop = audio_pcm_stop;
55 funcs->pcm_close = audio_pcm_close;
56 funcs->pcm_avail = audio_pcm_avail;
57 funcs->pcm_write = audio_pcm_write;
58 funcs->pcm_read = audio_pcm_read;
59 funcs->pcm_get_fd = audio_pcm_get_fd;
60 funcs->pcm_recover = audio_pcm_recover;
61 funcs->pcm_get_params = audio_pcm_get_params;
62 funcs->pcm_set_params = audio_pcm_set_params;
64 funcs->add_message_cb = audio_add_message_cb;
65 funcs->remove_message_cb = audio_remove_message_cb;
67 *data = (void *)funcs;
72 static int audio_alc5658_exit(void *data)
82 hal_backend hal_backend_audio_data = {
83 .name = "audio-alc5658",
85 .abi_version = HAL_ABI_VERSION_TIZEN_6_5,
86 .init = audio_alc5658_init,
87 .exit = audio_alc5658_exit,