Change path of configuration and license files
[platform/adaptation/spreadtrum/audio-hal-sc7727.git] / tizen-audio-impl.h
1 #ifndef footizenaudioimplfoo
2 #define footizenaudioimplfoo
3
4 /*
5  * audio-hal
6  *
7  * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  */
22
23 /* PCM */
24 audio_return_e _fmradio_pcm_open(audio_hal_s *ah);
25 audio_return_e _fmradio_pcm_close(audio_hal_s *ah);
26 audio_return_e _voice_pcm_open(audio_hal_s *ah);
27 audio_return_e _voice_pcm_close(audio_hal_s *ah, uint32_t direction);
28 audio_return_e _reset_pcm_devices(audio_hal_s *ah);
29 audio_return_e _pcm_open(const char *card, const char *device, uint32_t direction, void *sample_spec, uint32_t period_size, uint32_t periods, void **pcm_handle);
30 audio_return_e _pcm_start(void *pcm_handle);
31 audio_return_e _pcm_stop(void *pcm_handle);
32 audio_return_e _pcm_close(void *pcm_handle);
33 audio_return_e _pcm_avail(void *pcm_handle, uint32_t *avail);
34 audio_return_e _pcm_write(void *pcm_handle, const void *buffer, uint32_t frames);
35 audio_return_e _pcm_read(void *pcm_handle, void *buffer, uint32_t frames);
36 audio_return_e _pcm_get_fd(void *pcm_handle, int *fd);
37 audio_return_e _pcm_recover(void *pcm_handle, int revents);
38 audio_return_e _pcm_get_params(void *pcm_handle, uint32_t direction, void **sample_spec, uint32_t *period_size, uint32_t *periods);
39 audio_return_e _pcm_set_params(void *pcm_handle, uint32_t direction, void *sample_spec, uint32_t period_size, uint32_t periods);
40 audio_return_e _pcm_set_sw_params(snd_pcm_t *pcm, snd_pcm_uframes_t avail_min, uint8_t period_event);
41 audio_return_e _pcm_set_hw_params(snd_pcm_t *pcm, audio_pcm_sample_spec_s *sample_spec, uint8_t *use_mmap, snd_pcm_uframes_t *period_size, snd_pcm_uframes_t *buffer_size);
42
43 /* Control */
44 #define VBC_TD_CHANNELID                     0  /*  cp [3g] */
45 #define VBC_ARM_CHANNELID                    2  /*  ap */
46 #define MIXER_VBC_SWITCH                     "VBC Switch"
47 #define PIN_SWITCH_IIS0_SYS_SEL              "IIS0 pin select"
48 #define PIN_SWITCH_IIS0_AP_ID                0
49 #define PIN_SWITCH_IIS0_CP0_ID               1
50 #define PIN_SWITCH_IIS0_CP1_ID               2
51 #define PIN_SWITCH_IIS0_CP2_ID               3
52 #define PIN_SWITCH_IIS0_VBC_ID               4
53 #define PIN_SWITCH_BT_IIS_SYS_SEL            "BT IIS pin select"
54 #define PIN_SWITCH_BT_IIS_CP0_IIS0_ID        0
55 #define PIN_SWITCH_BT_IIS_CP1_IIS0_ID        4
56 #define PIN_SWITCH_BT_IIS_AP_IIS0_ID         8
57 #define PIN_SWITCH_BT_IIS_CON_SWITCH         "BT IIS con switch"
58 #define MIXER_FMRADIO_L_VOLUME               "VBC STR DG Set"
59 #define MIXER_FMRADIO_R_VOLUME               "VBC STL DG Set"
60 #define MIXER_FMRADIO_MUTE                   "Digital FM Function"
61 #define FMRADIO_MUTE_ON                   0
62 #define FMRADIO_MUTE_OFF                  1
63 audio_return_e _mixer_control_init(audio_hal_s *ah);
64 audio_return_e _mixer_control_deinit(audio_hal_s *ah);
65 audio_return_e _mixer_control_set_param(audio_hal_s *ah, const char* ctl_name, snd_ctl_elem_value_t* value, int size);
66 audio_return_e _mixer_control_set_value(audio_hal_s *ah, const char *ctl_name, int val);
67 audio_return_e _mixer_control_set_value_string(audio_hal_s *ah, const char* ctl_name, const char* value);
68 audio_return_e _mixer_control_get_value(audio_hal_s *ah, const char *ctl_name, int *val);
69 audio_return_e _mixer_control_get_element(audio_hal_s *ah, const char *ctl_name, snd_hctl_elem_t **elem);
70
71 /* UCM  */
72 audio_return_e _ucm_init(audio_hal_s *ah);
73 audio_return_e _ucm_deinit(audio_hal_s *ah);
74 audio_return_e _ucm_get_device_name(audio_hal_s *ah, const char *use_case, audio_direction_e direction, const char **value);
75 #define _ucm_update_use_case _ucm_set_use_case
76 audio_return_e _ucm_set_use_case(audio_hal_s *ah, const char *verb, const char *devices[], const char *modifiers[]);
77 audio_return_e _ucm_set_devices(audio_hal_s *ah, const char *verb, const char *devices[]);
78 audio_return_e _ucm_set_modifiers(audio_hal_s *ah, const char *verb, const char *modifiers[]);
79 audio_return_e _ucm_get_verb(audio_hal_s *ah, const char **value);
80 audio_return_e _ucm_reset_use_case(audio_hal_s *ah);
81
82 #endif