Skip to content

Commit 9f48a3a

Browse files
andrew-mtkkv2019i
authored andcommitted
platform/mtk: Add FS timings for MT818X, MT8195
Add sampling rate Hz to reg value conversion tables for MT8186, MT8188 and MT8195 Signed-off-by: Andrew Perepech <andrew.perepech@mediatek.com>
1 parent 8c4c92c commit 9f48a3a

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

src/platform/mtk/dai.c

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,42 @@ static const struct dai_info mtk_dai_info = {
203203
static unsigned int mtk_afe_fs_timing(unsigned int rate)
204204
{
205205
static const struct { int hz, reg; } rate2reg[] = {
206+
#if defined(CONFIG_SOC_MT8188) || defined(CONFIG_SOC_MT8195)
207+
{ 7350, 16 },
208+
{ 8000, 0 },
209+
{ 11025, 17 },
210+
{ 12000, 1 },
211+
{ 14700, 18 },
212+
{ 16000, 2 },
213+
{ 22050, 19 },
214+
{ 24000, 3 },
215+
{ 29400, 20 },
216+
{ 32000, 4 },
217+
{ 44100, 21 },
218+
{ 48000, 5 },
219+
{ 88200, 22 },
220+
{ 96000, 6 },
221+
{ 176400, 23 },
222+
{ 192000, 7 },
223+
{ 352800, 24 },
224+
{ 384000, 8 },
225+
#elif defined(CONFIG_SOC_MT8186)
226+
{ 8000, 0 },
227+
{ 11025, 1 },
228+
{ 12000, 2 },
229+
{ 16000, 4 },
230+
{ 22050, 5 },
231+
{ 24000, 6 },
232+
{ 32000, 8 },
233+
{ 44100, 9 },
234+
{ 48000, 10 },
235+
{ 88200, 11 },
236+
{ 96000, 12 },
237+
{ 176400, 13 },
238+
{ 192000, 14 },
239+
{ 352800, 7 },
240+
{ 384000, 3 },
241+
#else
206242
{ 8000, 0 },
207243
{ 11025, 1 },
208244
{ 12000, 2 },
@@ -218,6 +254,7 @@ static unsigned int mtk_afe_fs_timing(unsigned int rate)
218254
{ 192000, 18 },
219255
{ 352800, 21 },
220256
{ 384000, 22 },
257+
#endif
221258
};
222259

223260
for (int i = 0; i < ARRAY_SIZE(rate2reg); i++)

0 commit comments

Comments
 (0)