• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 Rockchip Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef CONFIG_H_
18 #define CONFIG_H_
19 
20 #include "alsa_audio.h"
21 
22 #define DEVICES_0 0
23 struct RouteCfgInfo {
24     const char *controlName;   // name of control.
25     const char *stringVal;  // value of control, which type is stream.
26     const int32_t intVal[2];    // left and right value of control, which type are int32_t.
27 };
28 
29 struct PathRoute {
30     const int32_t sndCard;
31     const int32_t devices;
32     const struct RouteCfgInfo *controls;
33     const unsigned ctlsNums;
34 };
35 
36 struct PathRouteCfgTable {
37     const struct PathRoute speakNormal;
38     const struct PathRoute headphoneNormal;
39     const struct PathRoute HdmiNormal;
40     const struct PathRoute speakerHeadphoneNormal;
41     const struct PathRoute mainMicCapture;
42     const struct PathRoute handsFreeMicCapture;
43     const struct PathRoute playbackOff;
44     const struct PathRoute captureOff;
45 };
46 
47 struct TinyalsaSndCardCfg {
48     const char *sndCardName;
49     struct PathRouteCfgTable *pathRouteMap;
50 };
51 
52 struct PathRouteCfgTable* GetHdmiConfigTable(void);
53 struct PathRouteCfgTable* GetDefaultConfigTable(void);
54 
55 #endif // _CONFIG_H_
56