• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1root {
2    platform {
3        template codec_controller {
4            match_attr = "";
5            serviceName = "";
6            codecDaiName = "";
7        }
8        controller_0x120c1030 :: codec_controller {
9            match_attr = "hdf_codec_driver";
10            serviceName = "codec_service_0";
11            codecDaiName = "codec_dai";
12            regConfig {
13                 /* reg: register address
14                    rreg: register address
15                    shift: shift bits
16                    rshift: rshift bits
17                    min: min value
18                    max: max value
19                    mask: mask of value
20                    invert: enum InvertVal 0-uninvert 1-invert
21                    value: value
22                */
23
24                /* reg, value */
25                initSeqConfig = [
26                    0x13,    0xf4,
27                    0x15,    0x0f,
28                    0x17,    0x40,
29                    0x18,    0xc8,
30                    0x1e,    0x00,
31                    0x27,    0x70,
32                    0x29,    0x66,
33                    0x2f,    0x0f,
34                    0x30,    0x06,
35                    0x35,    0x02,
36                    0x38,    0x11,
37                    0x3d,    0x80,
38                    0x3e,    0x0f,
39                    0x3f,    0x11,
40                    0x40,    0xa5,
41                    0x41,    0x7f,
42                    0x42,    0x04,
43                    0x43,    0x58,
44                    0x44,    0x2d,
45                    0x45,    0x0c,
46                    0x46,    0xa5,
47                    0x47,    0x00,
48                    0x48,    0x00,
49                    0x4b,    0x0f,
50                    0x4c,    0x20,
51                    0x4e,    0x0f,
52                    0x4f,    0x00,
53                ];
54
55                controlsConfig = [
56                    /*
57                        "Master Playback Volume",
58                        "Master Capture Volume",
59                        "Playback Mute",
60                        "Capture Mute",
61                        "Mic Left Gain",
62                        "Mic Right Gain",
63                        "External Codec Enable",
64                        "Internally Codec Enable",
65                        "Render Channel Mode",
66                        "Captrue Channel Mode"
67                    */
68
69                    /*
70                        iface
71                        0:virtual dac devic
72                        1:virtual adc device
73                        2:virtual adc device
74                        3:virtual mixer device
75                        4:Codec device
76                        5:PGA device
77                        6:AIAO device
78                    */
79
80                    /*array index, iface, enable*/
81                    0,  0,  1,
82                    1,  1,  1,
83                    2,  0,  1,
84                    3,  1,  1,
85                    4,  2,  1,
86                    5,  2,  1,
87                    8,  6,  0,
88                    9,  6,  0,
89                ];
90
91                /* reg, rreg, shift, rshift, min, max, mask, invert, value */
92                ctrlParamsSeqConfig = [
93                    0x31,    0x32,    0,    0,    0x00,    0xFF,   0xFF,   1,    0x00, // DACL/R Playback Volume
94                    0x1a,    0x1b,    0,    0,    0x00,    0xFF,   0xFF,   1,    0x00, // ADCL/R Capture Volume
95                    0x38,    0x38,    0,    0,    0x0,     0x1,    0x1,    0,    0x0,  // DAC Playback Mute
96                    0x18,    0x18,    7,    6,    0x0,     0x1,    0x1,    0,    0x0, // ADCL/R Capture Mute
97                    0x29,    0x29,    4,    4,    0x0,     0xF,    0xF,    0,    0x9,  // Mic Left Gain
98                    0x29,    0x29,    0,    0,    0x0,     0xF,    0xF,    0,    0x9,  // Mic Right Gain
99                    0xFF,    0xFF,    0,    0,    0x00,    0xFF,   0xFF,   0,    0x00, // Render Channel Mode
100                    0xFF,    0xFF,    0,    0,    0x00,    0xFF,   0xFF,   0,    0x00, // Captrue Channel Mode
101                ];
102
103                /* reg, rreg, shift, rshift, min, max, mask, invert, value */
104                daiStartupSeqConfig = [
105                    0x2F,    0x2F,    0,    0,    0x0,    0xFF,    0xFF,    0,    0x00, // PWD_ON
106                    0x38,    0x38,    0,    0,    0x0,    0xFF,    0xFF,    0,    0x10,
107                ];
108
109                /* reg, rreg, shift, rshift, min, max, mask, invert, value */
110                daiParamsSeqConfig = [
111                    0x45,    0x45,    0,     0,    0x0,   0xFF,    0xFF,   0,     0x0C, // PLL_PREDIV_BIT
112                    0x35,    0x35,    0,     0,    0x0,   0x7,     0x7,    0,     0x2, // DAC_Sample_rate
113                    0x1e,    0x1e,    0,     0,    0x0,   0x7,     0x7,    0,     0x2, // ADC_Sample_rate
114                    0x4e,    0x4e,    0,     0,    0x0,   0x17,    0x1F,   0,     0x0F,  // TX_datawidth
115                    0x4b,    0x4b,    0,     0,    0x0,   0x17,    0x1F,   0,     0x0F  // RX_datawidth
116                ];
117
118                ctrlSapmParamsSeqConfig = [
119                    0xFF,    0xFF,    0,     0,    0x00,    0xFF,    0xFF,    0,    0x00,     //LPGA MIC 0 -- connect MIC
120                    0xFF,    0xFF,    0,     0,    0x00,    0xFF,    0xFF,    0,    0x00,     //RPGA MIC 0 -- connect MIC
121                    0xFF,    0xFF,    0,     0,    0x00,    0xFF,    0xFF,    0,    0x00,     //dacl to dacr mixer
122                    0xFF,    0xFF,    0,     0,    0x00,    0xFF,    0xFF,    0,    0x00,     //dacr to dacl mixer
123                ];
124        		/*
125                 电源管理组件配置
126                 componentName: 功能名称,{"ADCL", "ADCR", "DACL", "DACR", "LPGA", "RPGA", "SPKL", "SPKR", "MIC"} 数组索引。
127                 sapmType,compNameIndex,reg, mask,shift,invert, kcontrolNews,kcontrolsNum
128                */
129                sapmComponent = [
130                    10,    0,    0xFF,    0xFF,    0,     0,     0,     0, //ADCL
131                    10,    1,    0xFF,    0xFF,    0,     0,     0,     0, //ADCR
132                    11,    2,    0xFF,    0xFF,    0,     0,     0,     0, //DACL
133                    11,    3,    0xFF,    0xFF,    0,     0,     0,     0, //DACR
134                    15,    6,    0xFF,    0xFF,    0,     0,     0,     0, //SPKL
135                    15,    7,    0xFF,    0xFF,    0,     0,     0,     0, //SPKR
136                    0,     8,    0xFF,    0xFF,    0,     0,     0,     0  //MIC
137                ];
138
139                /*array index, iface, enable*/
140                sapmConfig = [
141                    0,    5,    1,
142                    1,    5,    1,
143                    2,    0,    1,
144                    3,    0,    1
145                ];
146
147
148            }
149        }
150        controller_0x120c1031 :: codec_controller {
151            match_attr = "hdf_codec_driver_ex";
152            serviceName = "codec_service_1";
153            codecDaiName = "rk817_dai";
154
155
156        }
157    }
158}
159