1 // SPDX-License-Identifier: GPL-2.0
3 * Mediatek ALSA SoC AFE platform driver for 8195
5 * Copyright (c) 2021 MediaTek Inc.
6 * Author: Bicycle Tsai <bicycle.tsai@mediatek.com>
7 * Trevor Wu <trevor.wu@mediatek.com>
10 #include <linux/delay.h>
11 #include <linux/dma-mapping.h>
12 #include <linux/module.h>
13 #include <linux/mfd/syscon.h>
15 #include <linux/of_address.h>
16 #include <linux/of_platform.h>
17 #include <linux/of_reserved_mem.h>
18 #include <linux/pm_runtime.h>
19 #include <linux/reset.h>
20 #include "mt8195-afe-common.h"
21 #include "mt8195-afe-clk.h"
22 #include "mt8195-reg.h"
23 #include "../common/mtk-afe-platform-driver.h"
24 #include "../common/mtk-afe-fe-dai.h"
26 #define MT8195_MEMIF_BUFFER_BYTES_ALIGN (0x40)
27 #define MT8195_MEMIF_DL7_MAX_PERIOD_SIZE (0x3fff)
29 struct mtk_dai_memif_priv
{
30 unsigned int asys_timing_sel
;
33 static const struct snd_pcm_hardware mt8195_afe_hardware
= {
34 .info
= SNDRV_PCM_INFO_MMAP
|
35 SNDRV_PCM_INFO_INTERLEAVED
|
36 SNDRV_PCM_INFO_MMAP_VALID
,
37 .formats
= SNDRV_PCM_FMTBIT_S16_LE
|
38 SNDRV_PCM_FMTBIT_S24_LE
|
39 SNDRV_PCM_FMTBIT_S32_LE
,
40 .period_bytes_min
= 64,
41 .period_bytes_max
= 256 * 1024,
44 .buffer_bytes_max
= 256 * 2 * 1024,
47 struct mt8195_afe_rate
{
49 unsigned int reg_value
;
52 static const struct mt8195_afe_rate mt8195_afe_rates
[] = {
53 { .rate
= 8000, .reg_value
= 0, },
54 { .rate
= 12000, .reg_value
= 1, },
55 { .rate
= 16000, .reg_value
= 2, },
56 { .rate
= 24000, .reg_value
= 3, },
57 { .rate
= 32000, .reg_value
= 4, },
58 { .rate
= 48000, .reg_value
= 5, },
59 { .rate
= 96000, .reg_value
= 6, },
60 { .rate
= 192000, .reg_value
= 7, },
61 { .rate
= 384000, .reg_value
= 8, },
62 { .rate
= 7350, .reg_value
= 16, },
63 { .rate
= 11025, .reg_value
= 17, },
64 { .rate
= 14700, .reg_value
= 18, },
65 { .rate
= 22050, .reg_value
= 19, },
66 { .rate
= 29400, .reg_value
= 20, },
67 { .rate
= 44100, .reg_value
= 21, },
68 { .rate
= 88200, .reg_value
= 22, },
69 { .rate
= 176400, .reg_value
= 23, },
70 { .rate
= 352800, .reg_value
= 24, },
73 int mt8195_afe_fs_timing(unsigned int rate
)
77 for (i
= 0; i
< ARRAY_SIZE(mt8195_afe_rates
); i
++)
78 if (mt8195_afe_rates
[i
].rate
== rate
)
79 return mt8195_afe_rates
[i
].reg_value
;
84 static int mt8195_memif_fs(struct snd_pcm_substream
*substream
,
87 struct snd_soc_pcm_runtime
*rtd
= snd_soc_substream_to_rtd(substream
);
88 struct snd_soc_component
*component
=
89 snd_soc_rtdcom_lookup(rtd
, AFE_PCM_NAME
);
90 struct mtk_base_afe
*afe
= snd_soc_component_get_drvdata(component
);
91 int id
= snd_soc_rtd_to_cpu(rtd
, 0)->id
;
92 struct mtk_base_afe_memif
*memif
= &afe
->memif
[id
];
93 int fs
= mt8195_afe_fs_timing(rate
);
95 switch (memif
->data
->id
) {
96 case MT8195_AFE_MEMIF_DL10
:
97 fs
= MT8195_ETDM_OUT3_1X_EN
;
99 case MT8195_AFE_MEMIF_UL8
:
100 fs
= MT8195_ETDM_IN1_NX_EN
;
102 case MT8195_AFE_MEMIF_UL3
:
103 fs
= MT8195_ETDM_IN2_NX_EN
;
112 static int mt8195_irq_fs(struct snd_pcm_substream
*substream
,
115 int fs
= mt8195_memif_fs(substream
, rate
);
118 case MT8195_ETDM_IN1_NX_EN
:
119 fs
= MT8195_ETDM_IN1_1X_EN
;
121 case MT8195_ETDM_IN2_NX_EN
:
122 fs
= MT8195_ETDM_IN2_1X_EN
;
138 struct mt8195_afe_channel_merge
{
141 unsigned int sel_shift
;
142 unsigned int sel_maskbit
;
143 unsigned int sel_default
;
144 unsigned int ch_num_shift
;
145 unsigned int ch_num_maskbit
;
146 unsigned int en_shift
;
147 unsigned int en_maskbit
;
148 unsigned int update_cnt_shift
;
149 unsigned int update_cnt_maskbit
;
150 unsigned int update_cnt_default
;
153 static const struct mt8195_afe_channel_merge
154 mt8195_afe_cm
[MT8195_AFE_CM_NUM
] = {
156 .id
= MT8195_AFE_CM0
,
162 .ch_num_maskbit
= 0x3f,
165 .update_cnt_shift
= 16,
166 .update_cnt_maskbit
= 0x1fff,
167 .update_cnt_default
= 0x3,
170 .id
= MT8195_AFE_CM1
,
176 .ch_num_maskbit
= 0x1f,
179 .update_cnt_shift
= 16,
180 .update_cnt_maskbit
= 0x1fff,
181 .update_cnt_default
= 0x3,
184 .id
= MT8195_AFE_CM2
,
190 .ch_num_maskbit
= 0x1f,
193 .update_cnt_shift
= 16,
194 .update_cnt_maskbit
= 0x1fff,
195 .update_cnt_default
= 0x3,
199 static int mt8195_afe_memif_is_ul(int id
)
201 if (id
>= MT8195_AFE_MEMIF_UL_START
&& id
< MT8195_AFE_MEMIF_END
)
207 static const struct mt8195_afe_channel_merge
*
208 mt8195_afe_found_cm(struct snd_soc_dai
*dai
)
210 struct mtk_base_afe
*afe
= snd_soc_dai_get_drvdata(dai
);
213 if (mt8195_afe_memif_is_ul(dai
->id
) == 0)
217 case MT8195_AFE_MEMIF_UL9
:
220 case MT8195_AFE_MEMIF_UL2
:
223 case MT8195_AFE_MEMIF_UL10
:
231 dev_dbg(afe
->dev
, "%s, memif %d cannot find CM!\n",
236 return &mt8195_afe_cm
[id
];
239 static int mt8195_afe_config_cm(struct mtk_base_afe
*afe
,
240 const struct mt8195_afe_channel_merge
*cm
,
241 unsigned int channels
)
246 regmap_update_bits(afe
->regmap
,
248 cm
->sel_maskbit
<< cm
->sel_shift
,
249 cm
->sel_default
<< cm
->sel_shift
);
251 regmap_update_bits(afe
->regmap
,
253 cm
->ch_num_maskbit
<< cm
->ch_num_shift
,
254 (channels
- 1) << cm
->ch_num_shift
);
256 regmap_update_bits(afe
->regmap
,
258 cm
->update_cnt_maskbit
<< cm
->update_cnt_shift
,
259 cm
->update_cnt_default
<< cm
->update_cnt_shift
);
264 static int mt8195_afe_enable_cm(struct mtk_base_afe
*afe
,
265 const struct mt8195_afe_channel_merge
*cm
,
271 regmap_update_bits(afe
->regmap
,
273 cm
->en_maskbit
<< cm
->en_shift
,
274 enable
<< cm
->en_shift
);
280 mt8195_afe_paired_memif_clk_prepare(struct snd_pcm_substream
*substream
,
281 struct snd_soc_dai
*dai
,
284 struct snd_soc_pcm_runtime
*rtd
= snd_soc_substream_to_rtd(substream
);
285 struct mtk_base_afe
*afe
= snd_soc_dai_get_drvdata(dai
);
286 struct mt8195_afe_private
*afe_priv
= afe
->platform_priv
;
287 int id
= snd_soc_rtd_to_cpu(rtd
, 0)->id
;
290 if (id
!= MT8195_AFE_MEMIF_DL8
&& id
!= MT8195_AFE_MEMIF_DL10
)
294 clk_id
= MT8195_CLK_AUD_MEMIF_DL10
;
295 mt8195_afe_prepare_clk(afe
, afe_priv
->clk
[clk_id
]);
296 clk_id
= MT8195_CLK_AUD_MEMIF_DL8
;
297 mt8195_afe_prepare_clk(afe
, afe_priv
->clk
[clk_id
]);
299 clk_id
= MT8195_CLK_AUD_MEMIF_DL8
;
300 mt8195_afe_unprepare_clk(afe
, afe_priv
->clk
[clk_id
]);
301 clk_id
= MT8195_CLK_AUD_MEMIF_DL10
;
302 mt8195_afe_unprepare_clk(afe
, afe_priv
->clk
[clk_id
]);
309 mt8195_afe_paired_memif_clk_enable(struct snd_pcm_substream
*substream
,
310 struct snd_soc_dai
*dai
,
313 struct snd_soc_pcm_runtime
*rtd
= snd_soc_substream_to_rtd(substream
);
314 struct mtk_base_afe
*afe
= snd_soc_dai_get_drvdata(dai
);
315 struct mt8195_afe_private
*afe_priv
= afe
->platform_priv
;
316 int id
= snd_soc_rtd_to_cpu(rtd
, 0)->id
;
319 if (id
!= MT8195_AFE_MEMIF_DL8
&& id
!= MT8195_AFE_MEMIF_DL10
)
324 clk_id
= MT8195_CLK_AUD_MEMIF_DL10
;
325 mt8195_afe_enable_clk_atomic(afe
, afe_priv
->clk
[clk_id
]);
328 clk_id
= MT8195_CLK_AUD_MEMIF_DL8
;
329 mt8195_afe_enable_clk_atomic(afe
, afe_priv
->clk
[clk_id
]);
332 clk_id
= MT8195_CLK_AUD_MEMIF_DL8
;
333 mt8195_afe_disable_clk_atomic(afe
, afe_priv
->clk
[clk_id
]);
335 clk_id
= MT8195_CLK_AUD_MEMIF_DL10
;
336 mt8195_afe_disable_clk_atomic(afe
, afe_priv
->clk
[clk_id
]);
342 static int mt8195_afe_fe_startup(struct snd_pcm_substream
*substream
,
343 struct snd_soc_dai
*dai
)
345 struct snd_soc_pcm_runtime
*rtd
= snd_soc_substream_to_rtd(substream
);
346 struct snd_pcm_runtime
*runtime
= substream
->runtime
;
347 struct mtk_base_afe
*afe
= snd_soc_dai_get_drvdata(dai
);
348 int id
= snd_soc_rtd_to_cpu(rtd
, 0)->id
;
351 mt8195_afe_paired_memif_clk_prepare(substream
, dai
, 1);
353 ret
= mtk_afe_fe_startup(substream
, dai
);
355 snd_pcm_hw_constraint_step(runtime
, 0,
356 SNDRV_PCM_HW_PARAM_BUFFER_BYTES
,
357 MT8195_MEMIF_BUFFER_BYTES_ALIGN
);
359 if (id
!= MT8195_AFE_MEMIF_DL7
)
362 ret
= snd_pcm_hw_constraint_minmax(runtime
,
363 SNDRV_PCM_HW_PARAM_PERIOD_SIZE
,
365 MT8195_MEMIF_DL7_MAX_PERIOD_SIZE
);
367 dev_dbg(afe
->dev
, "hw_constraint_minmax failed\n");
372 static void mt8195_afe_fe_shutdown(struct snd_pcm_substream
*substream
,
373 struct snd_soc_dai
*dai
)
375 mtk_afe_fe_shutdown(substream
, dai
);
376 mt8195_afe_paired_memif_clk_prepare(substream
, dai
, 0);
379 static int mt8195_afe_fe_hw_params(struct snd_pcm_substream
*substream
,
380 struct snd_pcm_hw_params
*params
,
381 struct snd_soc_dai
*dai
)
383 struct snd_soc_pcm_runtime
*rtd
= snd_soc_substream_to_rtd(substream
);
384 struct mtk_base_afe
*afe
= snd_soc_dai_get_drvdata(dai
);
385 int id
= snd_soc_rtd_to_cpu(rtd
, 0)->id
;
386 struct mtk_base_afe_memif
*memif
= &afe
->memif
[id
];
387 const struct mtk_base_memif_data
*data
= memif
->data
;
388 const struct mt8195_afe_channel_merge
*cm
= mt8195_afe_found_cm(dai
);
389 unsigned int ch_num
= params_channels(params
);
391 mt8195_afe_config_cm(afe
, cm
, params_channels(params
));
393 if (data
->ch_num_reg
>= 0) {
394 regmap_update_bits(afe
->regmap
, data
->ch_num_reg
,
395 data
->ch_num_maskbit
<< data
->ch_num_shift
,
396 ch_num
<< data
->ch_num_shift
);
399 return mtk_afe_fe_hw_params(substream
, params
, dai
);
402 static int mt8195_afe_fe_hw_free(struct snd_pcm_substream
*substream
,
403 struct snd_soc_dai
*dai
)
405 return mtk_afe_fe_hw_free(substream
, dai
);
408 static int mt8195_afe_fe_prepare(struct snd_pcm_substream
*substream
,
409 struct snd_soc_dai
*dai
)
411 return mtk_afe_fe_prepare(substream
, dai
);
414 static int mt8195_afe_fe_trigger(struct snd_pcm_substream
*substream
, int cmd
,
415 struct snd_soc_dai
*dai
)
418 struct mtk_base_afe
*afe
= snd_soc_dai_get_drvdata(dai
);
419 const struct mt8195_afe_channel_merge
*cm
= mt8195_afe_found_cm(dai
);
422 case SNDRV_PCM_TRIGGER_START
:
423 case SNDRV_PCM_TRIGGER_RESUME
:
424 mt8195_afe_enable_cm(afe
, cm
, true);
426 case SNDRV_PCM_TRIGGER_STOP
:
427 case SNDRV_PCM_TRIGGER_SUSPEND
:
428 mt8195_afe_enable_cm(afe
, cm
, false);
434 ret
= mtk_afe_fe_trigger(substream
, cmd
, dai
);
437 case SNDRV_PCM_TRIGGER_START
:
438 case SNDRV_PCM_TRIGGER_RESUME
:
439 mt8195_afe_paired_memif_clk_enable(substream
, dai
, 1);
441 case SNDRV_PCM_TRIGGER_STOP
:
442 case SNDRV_PCM_TRIGGER_SUSPEND
:
443 mt8195_afe_paired_memif_clk_enable(substream
, dai
, 0);
452 static int mt8195_afe_fe_set_fmt(struct snd_soc_dai
*dai
, unsigned int fmt
)
457 static const struct snd_soc_dai_ops mt8195_afe_fe_dai_ops
= {
458 .startup
= mt8195_afe_fe_startup
,
459 .shutdown
= mt8195_afe_fe_shutdown
,
460 .hw_params
= mt8195_afe_fe_hw_params
,
461 .hw_free
= mt8195_afe_fe_hw_free
,
462 .prepare
= mt8195_afe_fe_prepare
,
463 .trigger
= mt8195_afe_fe_trigger
,
464 .set_fmt
= mt8195_afe_fe_set_fmt
,
467 #define MTK_PCM_RATES (SNDRV_PCM_RATE_8000_48000 |\
468 SNDRV_PCM_RATE_88200 |\
469 SNDRV_PCM_RATE_96000 |\
470 SNDRV_PCM_RATE_176400 |\
471 SNDRV_PCM_RATE_192000 |\
472 SNDRV_PCM_RATE_352800 |\
473 SNDRV_PCM_RATE_384000)
475 #define MTK_PCM_FORMATS (SNDRV_PCM_FMTBIT_S16_LE |\
476 SNDRV_PCM_FMTBIT_S24_LE |\
477 SNDRV_PCM_FMTBIT_S32_LE)
479 static struct snd_soc_dai_driver mt8195_memif_dai_driver
[] = {
480 /* FE DAIs: memory intefaces to CPU */
483 .id
= MT8195_AFE_MEMIF_DL2
,
485 .stream_name
= "DL2",
488 .rates
= MTK_PCM_RATES
,
489 .formats
= MTK_PCM_FORMATS
,
491 .ops
= &mt8195_afe_fe_dai_ops
,
495 .id
= MT8195_AFE_MEMIF_DL3
,
497 .stream_name
= "DL3",
500 .rates
= MTK_PCM_RATES
,
501 .formats
= MTK_PCM_FORMATS
,
503 .ops
= &mt8195_afe_fe_dai_ops
,
507 .id
= MT8195_AFE_MEMIF_DL6
,
509 .stream_name
= "DL6",
512 .rates
= MTK_PCM_RATES
,
513 .formats
= MTK_PCM_FORMATS
,
515 .ops
= &mt8195_afe_fe_dai_ops
,
519 .id
= MT8195_AFE_MEMIF_DL7
,
521 .stream_name
= "DL7",
524 .rates
= MTK_PCM_RATES
,
525 .formats
= MTK_PCM_FORMATS
,
527 .ops
= &mt8195_afe_fe_dai_ops
,
531 .id
= MT8195_AFE_MEMIF_DL8
,
533 .stream_name
= "DL8",
536 .rates
= MTK_PCM_RATES
,
537 .formats
= MTK_PCM_FORMATS
,
539 .ops
= &mt8195_afe_fe_dai_ops
,
543 .id
= MT8195_AFE_MEMIF_DL10
,
545 .stream_name
= "DL10",
548 .rates
= MTK_PCM_RATES
,
549 .formats
= MTK_PCM_FORMATS
,
551 .ops
= &mt8195_afe_fe_dai_ops
,
555 .id
= MT8195_AFE_MEMIF_DL11
,
557 .stream_name
= "DL11",
560 .rates
= MTK_PCM_RATES
,
561 .formats
= MTK_PCM_FORMATS
,
563 .ops
= &mt8195_afe_fe_dai_ops
,
567 .id
= MT8195_AFE_MEMIF_UL1
,
569 .stream_name
= "UL1",
572 .rates
= MTK_PCM_RATES
,
573 .formats
= MTK_PCM_FORMATS
,
575 .ops
= &mt8195_afe_fe_dai_ops
,
579 .id
= MT8195_AFE_MEMIF_UL2
,
581 .stream_name
= "UL2",
584 .rates
= MTK_PCM_RATES
,
585 .formats
= MTK_PCM_FORMATS
,
587 .ops
= &mt8195_afe_fe_dai_ops
,
591 .id
= MT8195_AFE_MEMIF_UL3
,
593 .stream_name
= "UL3",
596 .rates
= MTK_PCM_RATES
,
597 .formats
= MTK_PCM_FORMATS
,
599 .ops
= &mt8195_afe_fe_dai_ops
,
603 .id
= MT8195_AFE_MEMIF_UL4
,
605 .stream_name
= "UL4",
608 .rates
= MTK_PCM_RATES
,
609 .formats
= MTK_PCM_FORMATS
,
611 .ops
= &mt8195_afe_fe_dai_ops
,
615 .id
= MT8195_AFE_MEMIF_UL5
,
617 .stream_name
= "UL5",
620 .rates
= MTK_PCM_RATES
,
621 .formats
= MTK_PCM_FORMATS
,
623 .ops
= &mt8195_afe_fe_dai_ops
,
627 .id
= MT8195_AFE_MEMIF_UL6
,
629 .stream_name
= "UL6",
632 .rates
= MTK_PCM_RATES
,
633 .formats
= MTK_PCM_FORMATS
,
635 .ops
= &mt8195_afe_fe_dai_ops
,
639 .id
= MT8195_AFE_MEMIF_UL8
,
641 .stream_name
= "UL8",
644 .rates
= MTK_PCM_RATES
,
645 .formats
= MTK_PCM_FORMATS
,
647 .ops
= &mt8195_afe_fe_dai_ops
,
651 .id
= MT8195_AFE_MEMIF_UL9
,
653 .stream_name
= "UL9",
656 .rates
= MTK_PCM_RATES
,
657 .formats
= MTK_PCM_FORMATS
,
659 .ops
= &mt8195_afe_fe_dai_ops
,
663 .id
= MT8195_AFE_MEMIF_UL10
,
665 .stream_name
= "UL10",
668 .rates
= MTK_PCM_RATES
,
669 .formats
= MTK_PCM_FORMATS
,
671 .ops
= &mt8195_afe_fe_dai_ops
,
675 static const struct snd_kcontrol_new o002_mix
[] = {
676 SOC_DAPM_SINGLE_AUTODISABLE("I000 Switch", AFE_CONN2
, 0, 1, 0),
677 SOC_DAPM_SINGLE_AUTODISABLE("I012 Switch", AFE_CONN2
, 12, 1, 0),
678 SOC_DAPM_SINGLE_AUTODISABLE("I020 Switch", AFE_CONN2
, 20, 1, 0),
679 SOC_DAPM_SINGLE_AUTODISABLE("I022 Switch", AFE_CONN2
, 22, 1, 0),
680 SOC_DAPM_SINGLE_AUTODISABLE("I070 Switch", AFE_CONN2_2
, 6, 1, 0),
681 SOC_DAPM_SINGLE_AUTODISABLE("I072 Switch", AFE_CONN2_2
, 8, 1, 0),
682 SOC_DAPM_SINGLE_AUTODISABLE("I168 Switch", AFE_CONN2_5
, 8, 1, 0),
685 static const struct snd_kcontrol_new o003_mix
[] = {
686 SOC_DAPM_SINGLE_AUTODISABLE("I001 Switch", AFE_CONN3
, 1, 1, 0),
687 SOC_DAPM_SINGLE_AUTODISABLE("I013 Switch", AFE_CONN3
, 13, 1, 0),
688 SOC_DAPM_SINGLE_AUTODISABLE("I021 Switch", AFE_CONN3
, 21, 1, 0),
689 SOC_DAPM_SINGLE_AUTODISABLE("I023 Switch", AFE_CONN3
, 23, 1, 0),
690 SOC_DAPM_SINGLE_AUTODISABLE("I071 Switch", AFE_CONN3_2
, 7, 1, 0),
691 SOC_DAPM_SINGLE_AUTODISABLE("I073 Switch", AFE_CONN3_2
, 9, 1, 0),
692 SOC_DAPM_SINGLE_AUTODISABLE("I169 Switch", AFE_CONN3_5
, 9, 1, 0),
695 static const struct snd_kcontrol_new o004_mix
[] = {
696 SOC_DAPM_SINGLE_AUTODISABLE("I000 Switch", AFE_CONN4
, 0, 1, 0),
697 SOC_DAPM_SINGLE_AUTODISABLE("I014 Switch", AFE_CONN4
, 14, 1, 0),
698 SOC_DAPM_SINGLE_AUTODISABLE("I024 Switch", AFE_CONN4
, 24, 1, 0),
699 SOC_DAPM_SINGLE_AUTODISABLE("I074 Switch", AFE_CONN4_2
, 10, 1, 0),
700 SOC_DAPM_SINGLE_AUTODISABLE("I170 Switch", AFE_CONN4_5
, 10, 1, 0),
703 static const struct snd_kcontrol_new o005_mix
[] = {
704 SOC_DAPM_SINGLE_AUTODISABLE("I001 Switch", AFE_CONN5
, 1, 1, 0),
705 SOC_DAPM_SINGLE_AUTODISABLE("I015 Switch", AFE_CONN5
, 15, 1, 0),
706 SOC_DAPM_SINGLE_AUTODISABLE("I025 Switch", AFE_CONN5
, 25, 1, 0),
707 SOC_DAPM_SINGLE_AUTODISABLE("I075 Switch", AFE_CONN5_2
, 11, 1, 0),
708 SOC_DAPM_SINGLE_AUTODISABLE("I171 Switch", AFE_CONN5_5
, 11, 1, 0),
711 static const struct snd_kcontrol_new o006_mix
[] = {
712 SOC_DAPM_SINGLE_AUTODISABLE("I000 Switch", AFE_CONN6
, 0, 1, 0),
713 SOC_DAPM_SINGLE_AUTODISABLE("I016 Switch", AFE_CONN6
, 16, 1, 0),
714 SOC_DAPM_SINGLE_AUTODISABLE("I026 Switch", AFE_CONN6
, 26, 1, 0),
715 SOC_DAPM_SINGLE_AUTODISABLE("I076 Switch", AFE_CONN6_2
, 12, 1, 0),
718 static const struct snd_kcontrol_new o007_mix
[] = {
719 SOC_DAPM_SINGLE_AUTODISABLE("I001 Switch", AFE_CONN7
, 1, 1, 0),
720 SOC_DAPM_SINGLE_AUTODISABLE("I017 Switch", AFE_CONN7
, 17, 1, 0),
721 SOC_DAPM_SINGLE_AUTODISABLE("I027 Switch", AFE_CONN7
, 27, 1, 0),
722 SOC_DAPM_SINGLE_AUTODISABLE("I077 Switch", AFE_CONN7_2
, 13, 1, 0),
725 static const struct snd_kcontrol_new o008_mix
[] = {
726 SOC_DAPM_SINGLE_AUTODISABLE("I018 Switch", AFE_CONN8
, 18, 1, 0),
727 SOC_DAPM_SINGLE_AUTODISABLE("I028 Switch", AFE_CONN8
, 28, 1, 0),
728 SOC_DAPM_SINGLE_AUTODISABLE("I078 Switch", AFE_CONN8_2
, 14, 1, 0),
731 static const struct snd_kcontrol_new o009_mix
[] = {
732 SOC_DAPM_SINGLE_AUTODISABLE("I019 Switch", AFE_CONN9
, 19, 1, 0),
733 SOC_DAPM_SINGLE_AUTODISABLE("I029 Switch", AFE_CONN9
, 29, 1, 0),
734 SOC_DAPM_SINGLE_AUTODISABLE("I079 Switch", AFE_CONN9_2
, 15, 1, 0),
737 static const struct snd_kcontrol_new o010_mix
[] = {
738 SOC_DAPM_SINGLE_AUTODISABLE("I022 Switch", AFE_CONN10
, 22, 1, 0),
739 SOC_DAPM_SINGLE_AUTODISABLE("I030 Switch", AFE_CONN10
, 30, 1, 0),
740 SOC_DAPM_SINGLE_AUTODISABLE("I046 Switch", AFE_CONN10_1
, 14, 1, 0),
741 SOC_DAPM_SINGLE_AUTODISABLE("I072 Switch", AFE_CONN10_2
, 8, 1, 0),
744 static const struct snd_kcontrol_new o011_mix
[] = {
745 SOC_DAPM_SINGLE_AUTODISABLE("I023 Switch", AFE_CONN11
, 23, 1, 0),
746 SOC_DAPM_SINGLE_AUTODISABLE("I031 Switch", AFE_CONN11
, 31, 1, 0),
747 SOC_DAPM_SINGLE_AUTODISABLE("I047 Switch", AFE_CONN11_1
, 15, 1, 0),
748 SOC_DAPM_SINGLE_AUTODISABLE("I073 Switch", AFE_CONN11_2
, 9, 1, 0),
751 static const struct snd_kcontrol_new o012_mix
[] = {
752 SOC_DAPM_SINGLE_AUTODISABLE("I024 Switch", AFE_CONN12
, 24, 1, 0),
753 SOC_DAPM_SINGLE_AUTODISABLE("I032 Switch", AFE_CONN12_1
, 0, 1, 0),
754 SOC_DAPM_SINGLE_AUTODISABLE("I048 Switch", AFE_CONN12_1
, 16, 1, 0),
755 SOC_DAPM_SINGLE_AUTODISABLE("I074 Switch", AFE_CONN12_2
, 10, 1, 0),
758 static const struct snd_kcontrol_new o013_mix
[] = {
759 SOC_DAPM_SINGLE_AUTODISABLE("I025 Switch", AFE_CONN13
, 25, 1, 0),
760 SOC_DAPM_SINGLE_AUTODISABLE("I033 Switch", AFE_CONN13_1
, 1, 1, 0),
761 SOC_DAPM_SINGLE_AUTODISABLE("I049 Switch", AFE_CONN13_1
, 17, 1, 0),
762 SOC_DAPM_SINGLE_AUTODISABLE("I075 Switch", AFE_CONN13_2
, 11, 1, 0),
765 static const struct snd_kcontrol_new o014_mix
[] = {
766 SOC_DAPM_SINGLE_AUTODISABLE("I026 Switch", AFE_CONN14
, 26, 1, 0),
767 SOC_DAPM_SINGLE_AUTODISABLE("I034 Switch", AFE_CONN14_1
, 2, 1, 0),
768 SOC_DAPM_SINGLE_AUTODISABLE("I050 Switch", AFE_CONN14_1
, 18, 1, 0),
769 SOC_DAPM_SINGLE_AUTODISABLE("I076 Switch", AFE_CONN14_2
, 12, 1, 0),
772 static const struct snd_kcontrol_new o015_mix
[] = {
773 SOC_DAPM_SINGLE_AUTODISABLE("I027 Switch", AFE_CONN15
, 27, 1, 0),
774 SOC_DAPM_SINGLE_AUTODISABLE("I035 Switch", AFE_CONN15_1
, 3, 1, 0),
775 SOC_DAPM_SINGLE_AUTODISABLE("I051 Switch", AFE_CONN15_1
, 19, 1, 0),
776 SOC_DAPM_SINGLE_AUTODISABLE("I077 Switch", AFE_CONN15_2
, 13, 1, 0),
779 static const struct snd_kcontrol_new o016_mix
[] = {
780 SOC_DAPM_SINGLE_AUTODISABLE("I028 Switch", AFE_CONN16
, 28, 1, 0),
781 SOC_DAPM_SINGLE_AUTODISABLE("I036 Switch", AFE_CONN16_1
, 4, 1, 0),
782 SOC_DAPM_SINGLE_AUTODISABLE("I052 Switch", AFE_CONN16_1
, 20, 1, 0),
783 SOC_DAPM_SINGLE_AUTODISABLE("I078 Switch", AFE_CONN16_2
, 14, 1, 0),
786 static const struct snd_kcontrol_new o017_mix
[] = {
787 SOC_DAPM_SINGLE_AUTODISABLE("I029 Switch", AFE_CONN17
, 29, 1, 0),
788 SOC_DAPM_SINGLE_AUTODISABLE("I037 Switch", AFE_CONN17_1
, 5, 1, 0),
789 SOC_DAPM_SINGLE_AUTODISABLE("I053 Switch", AFE_CONN17_1
, 21, 1, 0),
790 SOC_DAPM_SINGLE_AUTODISABLE("I079 Switch", AFE_CONN17_2
, 15, 1, 0),
793 static const struct snd_kcontrol_new o018_mix
[] = {
794 SOC_DAPM_SINGLE_AUTODISABLE("I038 Switch", AFE_CONN18_1
, 6, 1, 0),
795 SOC_DAPM_SINGLE_AUTODISABLE("I080 Switch", AFE_CONN18_2
, 16, 1, 0),
798 static const struct snd_kcontrol_new o019_mix
[] = {
799 SOC_DAPM_SINGLE_AUTODISABLE("I039 Switch", AFE_CONN19_1
, 7, 1, 0),
800 SOC_DAPM_SINGLE_AUTODISABLE("I081 Switch", AFE_CONN19_2
, 17, 1, 0),
803 static const struct snd_kcontrol_new o020_mix
[] = {
804 SOC_DAPM_SINGLE_AUTODISABLE("I040 Switch", AFE_CONN20_1
, 8, 1, 0),
805 SOC_DAPM_SINGLE_AUTODISABLE("I082 Switch", AFE_CONN20_2
, 18, 1, 0),
808 static const struct snd_kcontrol_new o021_mix
[] = {
809 SOC_DAPM_SINGLE_AUTODISABLE("I041 Switch", AFE_CONN21_1
, 9, 1, 0),
810 SOC_DAPM_SINGLE_AUTODISABLE("I083 Switch", AFE_CONN21_2
, 19, 1, 0),
813 static const struct snd_kcontrol_new o022_mix
[] = {
814 SOC_DAPM_SINGLE_AUTODISABLE("I042 Switch", AFE_CONN22_1
, 10, 1, 0),
815 SOC_DAPM_SINGLE_AUTODISABLE("I084 Switch", AFE_CONN22_2
, 20, 1, 0),
818 static const struct snd_kcontrol_new o023_mix
[] = {
819 SOC_DAPM_SINGLE_AUTODISABLE("I043 Switch", AFE_CONN23_1
, 11, 1, 0),
820 SOC_DAPM_SINGLE_AUTODISABLE("I085 Switch", AFE_CONN23_2
, 21, 1, 0),
823 static const struct snd_kcontrol_new o024_mix
[] = {
824 SOC_DAPM_SINGLE_AUTODISABLE("I044 Switch", AFE_CONN24_1
, 12, 1, 0),
825 SOC_DAPM_SINGLE_AUTODISABLE("I086 Switch", AFE_CONN24_2
, 22, 1, 0),
828 static const struct snd_kcontrol_new o025_mix
[] = {
829 SOC_DAPM_SINGLE_AUTODISABLE("I045 Switch", AFE_CONN25_1
, 13, 1, 0),
830 SOC_DAPM_SINGLE_AUTODISABLE("I087 Switch", AFE_CONN25_2
, 23, 1, 0),
833 static const struct snd_kcontrol_new o026_mix
[] = {
834 SOC_DAPM_SINGLE_AUTODISABLE("I046 Switch", AFE_CONN26_1
, 14, 1, 0),
835 SOC_DAPM_SINGLE_AUTODISABLE("I088 Switch", AFE_CONN26_2
, 24, 1, 0),
838 static const struct snd_kcontrol_new o027_mix
[] = {
839 SOC_DAPM_SINGLE_AUTODISABLE("I047 Switch", AFE_CONN27_1
, 15, 1, 0),
840 SOC_DAPM_SINGLE_AUTODISABLE("I089 Switch", AFE_CONN27_2
, 25, 1, 0),
843 static const struct snd_kcontrol_new o028_mix
[] = {
844 SOC_DAPM_SINGLE_AUTODISABLE("I048 Switch", AFE_CONN28_1
, 16, 1, 0),
845 SOC_DAPM_SINGLE_AUTODISABLE("I090 Switch", AFE_CONN28_2
, 26, 1, 0),
848 static const struct snd_kcontrol_new o029_mix
[] = {
849 SOC_DAPM_SINGLE_AUTODISABLE("I049 Switch", AFE_CONN29_1
, 17, 1, 0),
850 SOC_DAPM_SINGLE_AUTODISABLE("I091 Switch", AFE_CONN29_2
, 27, 1, 0),
853 static const struct snd_kcontrol_new o030_mix
[] = {
854 SOC_DAPM_SINGLE_AUTODISABLE("I050 Switch", AFE_CONN30_1
, 18, 1, 0),
855 SOC_DAPM_SINGLE_AUTODISABLE("I092 Switch", AFE_CONN30_2
, 28, 1, 0),
858 static const struct snd_kcontrol_new o031_mix
[] = {
859 SOC_DAPM_SINGLE_AUTODISABLE("I051 Switch", AFE_CONN31_1
, 19, 1, 0),
860 SOC_DAPM_SINGLE_AUTODISABLE("I093 Switch", AFE_CONN31_2
, 29, 1, 0),
863 static const struct snd_kcontrol_new o032_mix
[] = {
864 SOC_DAPM_SINGLE_AUTODISABLE("I052 Switch", AFE_CONN32_1
, 20, 1, 0),
865 SOC_DAPM_SINGLE_AUTODISABLE("I094 Switch", AFE_CONN32_2
, 30, 1, 0),
868 static const struct snd_kcontrol_new o033_mix
[] = {
869 SOC_DAPM_SINGLE_AUTODISABLE("I053 Switch", AFE_CONN33_1
, 21, 1, 0),
870 SOC_DAPM_SINGLE_AUTODISABLE("I095 Switch", AFE_CONN33_2
, 31, 1, 0),
873 static const struct snd_kcontrol_new o034_mix
[] = {
874 SOC_DAPM_SINGLE_AUTODISABLE("I000 Switch", AFE_CONN34
, 0, 1, 0),
875 SOC_DAPM_SINGLE_AUTODISABLE("I002 Switch", AFE_CONN34
, 2, 1, 0),
876 SOC_DAPM_SINGLE_AUTODISABLE("I012 Switch", AFE_CONN34
, 12, 1, 0),
877 SOC_DAPM_SINGLE_AUTODISABLE("I020 Switch", AFE_CONN34
, 20, 1, 0),
878 SOC_DAPM_SINGLE_AUTODISABLE("I070 Switch", AFE_CONN34_2
, 6, 1, 0),
879 SOC_DAPM_SINGLE_AUTODISABLE("I072 Switch", AFE_CONN34_2
, 8, 1, 0),
880 SOC_DAPM_SINGLE_AUTODISABLE("I168 Switch", AFE_CONN34_5
, 8, 1, 0),
881 SOC_DAPM_SINGLE_AUTODISABLE("I170 Switch", AFE_CONN34_5
, 10, 1, 0),
884 static const struct snd_kcontrol_new o035_mix
[] = {
885 SOC_DAPM_SINGLE_AUTODISABLE("I001 Switch", AFE_CONN35
, 1, 1, 0),
886 SOC_DAPM_SINGLE_AUTODISABLE("I003 Switch", AFE_CONN35
, 3, 1, 0),
887 SOC_DAPM_SINGLE_AUTODISABLE("I013 Switch", AFE_CONN35
, 13, 1, 0),
888 SOC_DAPM_SINGLE_AUTODISABLE("I021 Switch", AFE_CONN35
, 21, 1, 0),
889 SOC_DAPM_SINGLE_AUTODISABLE("I071 Switch", AFE_CONN35_2
, 7, 1, 0),
890 SOC_DAPM_SINGLE_AUTODISABLE("I073 Switch", AFE_CONN35_2
, 9, 1, 0),
891 SOC_DAPM_SINGLE_AUTODISABLE("I137 Switch", AFE_CONN35_4
, 9, 1, 0),
892 SOC_DAPM_SINGLE_AUTODISABLE("I139 Switch", AFE_CONN35_4
, 11, 1, 0),
893 SOC_DAPM_SINGLE_AUTODISABLE("I168 Switch", AFE_CONN35_5
, 8, 1, 0),
894 SOC_DAPM_SINGLE_AUTODISABLE("I169 Switch", AFE_CONN35_5
, 9, 1, 0),
895 SOC_DAPM_SINGLE_AUTODISABLE("I170 Switch", AFE_CONN35_5
, 10, 1, 0),
896 SOC_DAPM_SINGLE_AUTODISABLE("I171 Switch", AFE_CONN35_5
, 11, 1, 0),
899 static const struct snd_kcontrol_new o036_mix
[] = {
900 SOC_DAPM_SINGLE_AUTODISABLE("I000 Switch", AFE_CONN36
, 0, 1, 0),
901 SOC_DAPM_SINGLE_AUTODISABLE("I012 Switch", AFE_CONN36
, 12, 1, 0),
902 SOC_DAPM_SINGLE_AUTODISABLE("I020 Switch", AFE_CONN36
, 20, 1, 0),
903 SOC_DAPM_SINGLE_AUTODISABLE("I070 Switch", AFE_CONN36_2
, 6, 1, 0),
904 SOC_DAPM_SINGLE_AUTODISABLE("I168 Switch", AFE_CONN36_5
, 8, 1, 0),
907 static const struct snd_kcontrol_new o037_mix
[] = {
908 SOC_DAPM_SINGLE_AUTODISABLE("I001 Switch", AFE_CONN37
, 1, 1, 0),
909 SOC_DAPM_SINGLE_AUTODISABLE("I013 Switch", AFE_CONN37
, 13, 1, 0),
910 SOC_DAPM_SINGLE_AUTODISABLE("I021 Switch", AFE_CONN37
, 21, 1, 0),
911 SOC_DAPM_SINGLE_AUTODISABLE("I071 Switch", AFE_CONN37_2
, 7, 1, 0),
912 SOC_DAPM_SINGLE_AUTODISABLE("I169 Switch", AFE_CONN37_5
, 9, 1, 0),
915 static const struct snd_kcontrol_new o038_mix
[] = {
916 SOC_DAPM_SINGLE_AUTODISABLE("I022 Switch", AFE_CONN38
, 22, 1, 0),
919 static const struct snd_kcontrol_new o039_mix
[] = {
920 SOC_DAPM_SINGLE_AUTODISABLE("I023 Switch", AFE_CONN39
, 23, 1, 0),
923 static const struct snd_kcontrol_new o040_mix
[] = {
924 SOC_DAPM_SINGLE_AUTODISABLE("I002 Switch", AFE_CONN40
, 2, 1, 0),
925 SOC_DAPM_SINGLE_AUTODISABLE("I012 Switch", AFE_CONN40
, 12, 1, 0),
926 SOC_DAPM_SINGLE_AUTODISABLE("I022 Switch", AFE_CONN40
, 22, 1, 0),
927 SOC_DAPM_SINGLE_AUTODISABLE("I168 Switch", AFE_CONN40_5
, 8, 1, 0),
930 static const struct snd_kcontrol_new o041_mix
[] = {
931 SOC_DAPM_SINGLE_AUTODISABLE("I003 Switch", AFE_CONN41
, 3, 1, 0),
932 SOC_DAPM_SINGLE_AUTODISABLE("I013 Switch", AFE_CONN41
, 13, 1, 0),
933 SOC_DAPM_SINGLE_AUTODISABLE("I023 Switch", AFE_CONN41
, 23, 1, 0),
934 SOC_DAPM_SINGLE_AUTODISABLE("I169 Switch", AFE_CONN41_5
, 9, 1, 0),
937 static const struct snd_kcontrol_new o042_mix
[] = {
938 SOC_DAPM_SINGLE_AUTODISABLE("I014 Switch", AFE_CONN42
, 14, 1, 0),
939 SOC_DAPM_SINGLE_AUTODISABLE("I024 Switch", AFE_CONN42
, 24, 1, 0),
940 SOC_DAPM_SINGLE_AUTODISABLE("I170 Switch", AFE_CONN42_5
, 10, 1, 0),
943 static const struct snd_kcontrol_new o043_mix
[] = {
944 SOC_DAPM_SINGLE_AUTODISABLE("I015 Switch", AFE_CONN43
, 15, 1, 0),
945 SOC_DAPM_SINGLE_AUTODISABLE("I025 Switch", AFE_CONN43
, 25, 1, 0),
946 SOC_DAPM_SINGLE_AUTODISABLE("I171 Switch", AFE_CONN43_5
, 11, 1, 0),
949 static const struct snd_kcontrol_new o044_mix
[] = {
950 SOC_DAPM_SINGLE_AUTODISABLE("I016 Switch", AFE_CONN44
, 16, 1, 0),
951 SOC_DAPM_SINGLE_AUTODISABLE("I026 Switch", AFE_CONN44
, 26, 1, 0),
954 static const struct snd_kcontrol_new o045_mix
[] = {
955 SOC_DAPM_SINGLE_AUTODISABLE("I017 Switch", AFE_CONN45
, 17, 1, 0),
956 SOC_DAPM_SINGLE_AUTODISABLE("I027 Switch", AFE_CONN45
, 27, 1, 0),
959 static const struct snd_kcontrol_new o046_mix
[] = {
960 SOC_DAPM_SINGLE_AUTODISABLE("I018 Switch", AFE_CONN46
, 18, 1, 0),
961 SOC_DAPM_SINGLE_AUTODISABLE("I028 Switch", AFE_CONN46
, 28, 1, 0),
964 static const struct snd_kcontrol_new o047_mix
[] = {
965 SOC_DAPM_SINGLE_AUTODISABLE("I019 Switch", AFE_CONN47
, 19, 1, 0),
966 SOC_DAPM_SINGLE_AUTODISABLE("I029 Switch", AFE_CONN47
, 29, 1, 0),
969 static const struct snd_kcontrol_new o182_mix
[] = {
970 SOC_DAPM_SINGLE_AUTODISABLE("I024 Switch", AFE_CONN182
, 24, 1, 0),
973 static const struct snd_kcontrol_new o183_mix
[] = {
974 SOC_DAPM_SINGLE_AUTODISABLE("I025 Switch", AFE_CONN183
, 25, 1, 0),
977 static const char * const dl8_dl11_data_sel_mux_text
[] = {
981 static SOC_ENUM_SINGLE_DECL(dl8_dl11_data_sel_mux_enum
,
982 AFE_DAC_CON2
, 0, dl8_dl11_data_sel_mux_text
);
984 static const struct snd_kcontrol_new dl8_dl11_data_sel_mux
=
985 SOC_DAPM_ENUM("DL8_DL11 Sink", dl8_dl11_data_sel_mux_enum
);
987 static const struct snd_soc_dapm_widget mt8195_memif_widgets
[] = {
989 SND_SOC_DAPM_MIXER("I000", SND_SOC_NOPM
, 0, 0, NULL
, 0),
990 SND_SOC_DAPM_MIXER("I001", SND_SOC_NOPM
, 0, 0, NULL
, 0),
993 SND_SOC_DAPM_MIXER("I020", SND_SOC_NOPM
, 0, 0, NULL
, 0),
994 SND_SOC_DAPM_MIXER("I021", SND_SOC_NOPM
, 0, 0, NULL
, 0),
997 SND_SOC_DAPM_MIXER("I022", SND_SOC_NOPM
, 0, 0, NULL
, 0),
998 SND_SOC_DAPM_MIXER("I023", SND_SOC_NOPM
, 0, 0, NULL
, 0),
999 SND_SOC_DAPM_MIXER("I024", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1000 SND_SOC_DAPM_MIXER("I025", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1001 SND_SOC_DAPM_MIXER("I026", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1002 SND_SOC_DAPM_MIXER("I027", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1003 SND_SOC_DAPM_MIXER("I028", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1004 SND_SOC_DAPM_MIXER("I029", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1005 SND_SOC_DAPM_MIXER("I030", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1006 SND_SOC_DAPM_MIXER("I031", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1007 SND_SOC_DAPM_MIXER("I032", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1008 SND_SOC_DAPM_MIXER("I033", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1009 SND_SOC_DAPM_MIXER("I034", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1010 SND_SOC_DAPM_MIXER("I035", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1011 SND_SOC_DAPM_MIXER("I036", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1012 SND_SOC_DAPM_MIXER("I037", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1013 SND_SOC_DAPM_MIXER("I038", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1014 SND_SOC_DAPM_MIXER("I039", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1015 SND_SOC_DAPM_MIXER("I040", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1016 SND_SOC_DAPM_MIXER("I041", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1017 SND_SOC_DAPM_MIXER("I042", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1018 SND_SOC_DAPM_MIXER("I043", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1019 SND_SOC_DAPM_MIXER("I044", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1020 SND_SOC_DAPM_MIXER("I045", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1023 SND_SOC_DAPM_MIXER("I046", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1024 SND_SOC_DAPM_MIXER("I047", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1025 SND_SOC_DAPM_MIXER("I048", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1026 SND_SOC_DAPM_MIXER("I049", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1027 SND_SOC_DAPM_MIXER("I050", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1028 SND_SOC_DAPM_MIXER("I051", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1029 SND_SOC_DAPM_MIXER("I052", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1030 SND_SOC_DAPM_MIXER("I053", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1031 SND_SOC_DAPM_MIXER("I054", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1032 SND_SOC_DAPM_MIXER("I055", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1033 SND_SOC_DAPM_MIXER("I056", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1034 SND_SOC_DAPM_MIXER("I057", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1035 SND_SOC_DAPM_MIXER("I058", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1036 SND_SOC_DAPM_MIXER("I059", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1037 SND_SOC_DAPM_MIXER("I060", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1038 SND_SOC_DAPM_MIXER("I061", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1039 SND_SOC_DAPM_MIXER("I062", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1040 SND_SOC_DAPM_MIXER("I063", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1041 SND_SOC_DAPM_MIXER("I064", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1042 SND_SOC_DAPM_MIXER("I065", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1043 SND_SOC_DAPM_MIXER("I066", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1044 SND_SOC_DAPM_MIXER("I067", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1045 SND_SOC_DAPM_MIXER("I068", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1046 SND_SOC_DAPM_MIXER("I069", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1049 SND_SOC_DAPM_MIXER("I070", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1050 SND_SOC_DAPM_MIXER("I071", SND_SOC_NOPM
, 0, 0, NULL
, 0),
1052 SND_SOC_DAPM_MUX("DL8_DL11 Mux",
1053 SND_SOC_NOPM
, 0, 0, &dl8_dl11_data_sel_mux
),
1056 SND_SOC_DAPM_MIXER("O002", SND_SOC_NOPM
, 0, 0,
1057 o002_mix
, ARRAY_SIZE(o002_mix
)),
1058 SND_SOC_DAPM_MIXER("O003", SND_SOC_NOPM
, 0, 0,
1059 o003_mix
, ARRAY_SIZE(o003_mix
)),
1060 SND_SOC_DAPM_MIXER("O004", SND_SOC_NOPM
, 0, 0,
1061 o004_mix
, ARRAY_SIZE(o004_mix
)),
1062 SND_SOC_DAPM_MIXER("O005", SND_SOC_NOPM
, 0, 0,
1063 o005_mix
, ARRAY_SIZE(o005_mix
)),
1064 SND_SOC_DAPM_MIXER("O006", SND_SOC_NOPM
, 0, 0,
1065 o006_mix
, ARRAY_SIZE(o006_mix
)),
1066 SND_SOC_DAPM_MIXER("O007", SND_SOC_NOPM
, 0, 0,
1067 o007_mix
, ARRAY_SIZE(o007_mix
)),
1068 SND_SOC_DAPM_MIXER("O008", SND_SOC_NOPM
, 0, 0,
1069 o008_mix
, ARRAY_SIZE(o008_mix
)),
1070 SND_SOC_DAPM_MIXER("O009", SND_SOC_NOPM
, 0, 0,
1071 o009_mix
, ARRAY_SIZE(o009_mix
)),
1072 SND_SOC_DAPM_MIXER("O010", SND_SOC_NOPM
, 0, 0,
1073 o010_mix
, ARRAY_SIZE(o010_mix
)),
1074 SND_SOC_DAPM_MIXER("O011", SND_SOC_NOPM
, 0, 0,
1075 o011_mix
, ARRAY_SIZE(o011_mix
)),
1076 SND_SOC_DAPM_MIXER("O012", SND_SOC_NOPM
, 0, 0,
1077 o012_mix
, ARRAY_SIZE(o012_mix
)),
1078 SND_SOC_DAPM_MIXER("O013", SND_SOC_NOPM
, 0, 0,
1079 o013_mix
, ARRAY_SIZE(o013_mix
)),
1080 SND_SOC_DAPM_MIXER("O014", SND_SOC_NOPM
, 0, 0,
1081 o014_mix
, ARRAY_SIZE(o014_mix
)),
1082 SND_SOC_DAPM_MIXER("O015", SND_SOC_NOPM
, 0, 0,
1083 o015_mix
, ARRAY_SIZE(o015_mix
)),
1084 SND_SOC_DAPM_MIXER("O016", SND_SOC_NOPM
, 0, 0,
1085 o016_mix
, ARRAY_SIZE(o016_mix
)),
1086 SND_SOC_DAPM_MIXER("O017", SND_SOC_NOPM
, 0, 0,
1087 o017_mix
, ARRAY_SIZE(o017_mix
)),
1088 SND_SOC_DAPM_MIXER("O018", SND_SOC_NOPM
, 0, 0,
1089 o018_mix
, ARRAY_SIZE(o018_mix
)),
1090 SND_SOC_DAPM_MIXER("O019", SND_SOC_NOPM
, 0, 0,
1091 o019_mix
, ARRAY_SIZE(o019_mix
)),
1092 SND_SOC_DAPM_MIXER("O020", SND_SOC_NOPM
, 0, 0,
1093 o020_mix
, ARRAY_SIZE(o020_mix
)),
1094 SND_SOC_DAPM_MIXER("O021", SND_SOC_NOPM
, 0, 0,
1095 o021_mix
, ARRAY_SIZE(o021_mix
)),
1096 SND_SOC_DAPM_MIXER("O022", SND_SOC_NOPM
, 0, 0,
1097 o022_mix
, ARRAY_SIZE(o022_mix
)),
1098 SND_SOC_DAPM_MIXER("O023", SND_SOC_NOPM
, 0, 0,
1099 o023_mix
, ARRAY_SIZE(o023_mix
)),
1100 SND_SOC_DAPM_MIXER("O024", SND_SOC_NOPM
, 0, 0,
1101 o024_mix
, ARRAY_SIZE(o024_mix
)),
1102 SND_SOC_DAPM_MIXER("O025", SND_SOC_NOPM
, 0, 0,
1103 o025_mix
, ARRAY_SIZE(o025_mix
)),
1104 SND_SOC_DAPM_MIXER("O026", SND_SOC_NOPM
, 0, 0,
1105 o026_mix
, ARRAY_SIZE(o026_mix
)),
1106 SND_SOC_DAPM_MIXER("O027", SND_SOC_NOPM
, 0, 0,
1107 o027_mix
, ARRAY_SIZE(o027_mix
)),
1108 SND_SOC_DAPM_MIXER("O028", SND_SOC_NOPM
, 0, 0,
1109 o028_mix
, ARRAY_SIZE(o028_mix
)),
1110 SND_SOC_DAPM_MIXER("O029", SND_SOC_NOPM
, 0, 0,
1111 o029_mix
, ARRAY_SIZE(o029_mix
)),
1112 SND_SOC_DAPM_MIXER("O030", SND_SOC_NOPM
, 0, 0,
1113 o030_mix
, ARRAY_SIZE(o030_mix
)),
1114 SND_SOC_DAPM_MIXER("O031", SND_SOC_NOPM
, 0, 0,
1115 o031_mix
, ARRAY_SIZE(o031_mix
)),
1116 SND_SOC_DAPM_MIXER("O032", SND_SOC_NOPM
, 0, 0,
1117 o032_mix
, ARRAY_SIZE(o032_mix
)),
1118 SND_SOC_DAPM_MIXER("O033", SND_SOC_NOPM
, 0, 0,
1119 o033_mix
, ARRAY_SIZE(o033_mix
)),
1122 SND_SOC_DAPM_MIXER("O034", SND_SOC_NOPM
, 0, 0,
1123 o034_mix
, ARRAY_SIZE(o034_mix
)),
1124 SND_SOC_DAPM_MIXER("O035", SND_SOC_NOPM
, 0, 0,
1125 o035_mix
, ARRAY_SIZE(o035_mix
)),
1128 SND_SOC_DAPM_MIXER("O036", SND_SOC_NOPM
, 0, 0,
1129 o036_mix
, ARRAY_SIZE(o036_mix
)),
1130 SND_SOC_DAPM_MIXER("O037", SND_SOC_NOPM
, 0, 0,
1131 o037_mix
, ARRAY_SIZE(o037_mix
)),
1134 SND_SOC_DAPM_MIXER("O038", SND_SOC_NOPM
, 0, 0,
1135 o038_mix
, ARRAY_SIZE(o038_mix
)),
1136 SND_SOC_DAPM_MIXER("O039", SND_SOC_NOPM
, 0, 0,
1137 o039_mix
, ARRAY_SIZE(o039_mix
)),
1138 SND_SOC_DAPM_MIXER("O182", SND_SOC_NOPM
, 0, 0,
1139 o182_mix
, ARRAY_SIZE(o182_mix
)),
1140 SND_SOC_DAPM_MIXER("O183", SND_SOC_NOPM
, 0, 0,
1141 o183_mix
, ARRAY_SIZE(o183_mix
)),
1144 SND_SOC_DAPM_MIXER("O040", SND_SOC_NOPM
, 0, 0,
1145 o040_mix
, ARRAY_SIZE(o040_mix
)),
1146 SND_SOC_DAPM_MIXER("O041", SND_SOC_NOPM
, 0, 0,
1147 o041_mix
, ARRAY_SIZE(o041_mix
)),
1148 SND_SOC_DAPM_MIXER("O042", SND_SOC_NOPM
, 0, 0,
1149 o042_mix
, ARRAY_SIZE(o042_mix
)),
1150 SND_SOC_DAPM_MIXER("O043", SND_SOC_NOPM
, 0, 0,
1151 o043_mix
, ARRAY_SIZE(o043_mix
)),
1152 SND_SOC_DAPM_MIXER("O044", SND_SOC_NOPM
, 0, 0,
1153 o044_mix
, ARRAY_SIZE(o044_mix
)),
1154 SND_SOC_DAPM_MIXER("O045", SND_SOC_NOPM
, 0, 0,
1155 o045_mix
, ARRAY_SIZE(o045_mix
)),
1156 SND_SOC_DAPM_MIXER("O046", SND_SOC_NOPM
, 0, 0,
1157 o046_mix
, ARRAY_SIZE(o046_mix
)),
1158 SND_SOC_DAPM_MIXER("O047", SND_SOC_NOPM
, 0, 0,
1159 o047_mix
, ARRAY_SIZE(o047_mix
)),
1162 static const struct snd_soc_dapm_route mt8195_memif_routes
[] = {
1163 {"I000", NULL
, "DL6"},
1164 {"I001", NULL
, "DL6"},
1166 {"I020", NULL
, "DL3"},
1167 {"I021", NULL
, "DL3"},
1169 {"I022", NULL
, "DL11"},
1170 {"I023", NULL
, "DL11"},
1171 {"I024", NULL
, "DL11"},
1172 {"I025", NULL
, "DL11"},
1173 {"I026", NULL
, "DL11"},
1174 {"I027", NULL
, "DL11"},
1175 {"I028", NULL
, "DL11"},
1176 {"I029", NULL
, "DL11"},
1177 {"I030", NULL
, "DL11"},
1178 {"I031", NULL
, "DL11"},
1179 {"I032", NULL
, "DL11"},
1180 {"I033", NULL
, "DL11"},
1181 {"I034", NULL
, "DL11"},
1182 {"I035", NULL
, "DL11"},
1183 {"I036", NULL
, "DL11"},
1184 {"I037", NULL
, "DL11"},
1185 {"I038", NULL
, "DL11"},
1186 {"I039", NULL
, "DL11"},
1187 {"I040", NULL
, "DL11"},
1188 {"I041", NULL
, "DL11"},
1189 {"I042", NULL
, "DL11"},
1190 {"I043", NULL
, "DL11"},
1191 {"I044", NULL
, "DL11"},
1192 {"I045", NULL
, "DL11"},
1194 {"DL8_DL11 Mux", "dl8", "DL8"},
1195 {"DL8_DL11 Mux", "dl11", "DL11"},
1197 {"I046", NULL
, "DL8_DL11 Mux"},
1198 {"I047", NULL
, "DL8_DL11 Mux"},
1199 {"I048", NULL
, "DL8_DL11 Mux"},
1200 {"I049", NULL
, "DL8_DL11 Mux"},
1201 {"I050", NULL
, "DL8_DL11 Mux"},
1202 {"I051", NULL
, "DL8_DL11 Mux"},
1203 {"I052", NULL
, "DL8_DL11 Mux"},
1204 {"I053", NULL
, "DL8_DL11 Mux"},
1205 {"I054", NULL
, "DL8_DL11 Mux"},
1206 {"I055", NULL
, "DL8_DL11 Mux"},
1207 {"I056", NULL
, "DL8_DL11 Mux"},
1208 {"I057", NULL
, "DL8_DL11 Mux"},
1209 {"I058", NULL
, "DL8_DL11 Mux"},
1210 {"I059", NULL
, "DL8_DL11 Mux"},
1211 {"I060", NULL
, "DL8_DL11 Mux"},
1212 {"I061", NULL
, "DL8_DL11 Mux"},
1213 {"I062", NULL
, "DL8_DL11 Mux"},
1214 {"I063", NULL
, "DL8_DL11 Mux"},
1215 {"I064", NULL
, "DL8_DL11 Mux"},
1216 {"I065", NULL
, "DL8_DL11 Mux"},
1217 {"I066", NULL
, "DL8_DL11 Mux"},
1218 {"I067", NULL
, "DL8_DL11 Mux"},
1219 {"I068", NULL
, "DL8_DL11 Mux"},
1220 {"I069", NULL
, "DL8_DL11 Mux"},
1222 {"I070", NULL
, "DL2"},
1223 {"I071", NULL
, "DL2"},
1225 {"UL9", NULL
, "O002"},
1226 {"UL9", NULL
, "O003"},
1227 {"UL9", NULL
, "O004"},
1228 {"UL9", NULL
, "O005"},
1229 {"UL9", NULL
, "O006"},
1230 {"UL9", NULL
, "O007"},
1231 {"UL9", NULL
, "O008"},
1232 {"UL9", NULL
, "O009"},
1233 {"UL9", NULL
, "O010"},
1234 {"UL9", NULL
, "O011"},
1235 {"UL9", NULL
, "O012"},
1236 {"UL9", NULL
, "O013"},
1237 {"UL9", NULL
, "O014"},
1238 {"UL9", NULL
, "O015"},
1239 {"UL9", NULL
, "O016"},
1240 {"UL9", NULL
, "O017"},
1241 {"UL9", NULL
, "O018"},
1242 {"UL9", NULL
, "O019"},
1243 {"UL9", NULL
, "O020"},
1244 {"UL9", NULL
, "O021"},
1245 {"UL9", NULL
, "O022"},
1246 {"UL9", NULL
, "O023"},
1247 {"UL9", NULL
, "O024"},
1248 {"UL9", NULL
, "O025"},
1249 {"UL9", NULL
, "O026"},
1250 {"UL9", NULL
, "O027"},
1251 {"UL9", NULL
, "O028"},
1252 {"UL9", NULL
, "O029"},
1253 {"UL9", NULL
, "O030"},
1254 {"UL9", NULL
, "O031"},
1255 {"UL9", NULL
, "O032"},
1256 {"UL9", NULL
, "O033"},
1258 {"UL4", NULL
, "O034"},
1259 {"UL4", NULL
, "O035"},
1261 {"UL5", NULL
, "O036"},
1262 {"UL5", NULL
, "O037"},
1264 {"UL10", NULL
, "O038"},
1265 {"UL10", NULL
, "O039"},
1266 {"UL10", NULL
, "O182"},
1267 {"UL10", NULL
, "O183"},
1269 {"UL2", NULL
, "O040"},
1270 {"UL2", NULL
, "O041"},
1271 {"UL2", NULL
, "O042"},
1272 {"UL2", NULL
, "O043"},
1273 {"UL2", NULL
, "O044"},
1274 {"UL2", NULL
, "O045"},
1275 {"UL2", NULL
, "O046"},
1276 {"UL2", NULL
, "O047"},
1278 {"O004", "I000 Switch", "I000"},
1279 {"O005", "I001 Switch", "I001"},
1281 {"O006", "I000 Switch", "I000"},
1282 {"O007", "I001 Switch", "I001"},
1284 {"O010", "I022 Switch", "I022"},
1285 {"O011", "I023 Switch", "I023"},
1286 {"O012", "I024 Switch", "I024"},
1287 {"O013", "I025 Switch", "I025"},
1288 {"O014", "I026 Switch", "I026"},
1289 {"O015", "I027 Switch", "I027"},
1290 {"O016", "I028 Switch", "I028"},
1291 {"O017", "I029 Switch", "I029"},
1293 {"O010", "I046 Switch", "I046"},
1294 {"O011", "I047 Switch", "I047"},
1295 {"O012", "I048 Switch", "I048"},
1296 {"O013", "I049 Switch", "I049"},
1297 {"O014", "I050 Switch", "I050"},
1298 {"O015", "I051 Switch", "I051"},
1299 {"O016", "I052 Switch", "I052"},
1300 {"O017", "I053 Switch", "I053"},
1301 {"O002", "I022 Switch", "I022"},
1302 {"O003", "I023 Switch", "I023"},
1303 {"O004", "I024 Switch", "I024"},
1304 {"O005", "I025 Switch", "I025"},
1305 {"O006", "I026 Switch", "I026"},
1306 {"O007", "I027 Switch", "I027"},
1307 {"O008", "I028 Switch", "I028"},
1308 {"O009", "I029 Switch", "I029"},
1309 {"O010", "I030 Switch", "I030"},
1310 {"O011", "I031 Switch", "I031"},
1311 {"O012", "I032 Switch", "I032"},
1312 {"O013", "I033 Switch", "I033"},
1313 {"O014", "I034 Switch", "I034"},
1314 {"O015", "I035 Switch", "I035"},
1315 {"O016", "I036 Switch", "I036"},
1316 {"O017", "I037 Switch", "I037"},
1317 {"O018", "I038 Switch", "I038"},
1318 {"O019", "I039 Switch", "I039"},
1319 {"O020", "I040 Switch", "I040"},
1320 {"O021", "I041 Switch", "I041"},
1321 {"O022", "I042 Switch", "I042"},
1322 {"O023", "I043 Switch", "I043"},
1323 {"O024", "I044 Switch", "I044"},
1324 {"O025", "I045 Switch", "I045"},
1325 {"O026", "I046 Switch", "I046"},
1326 {"O027", "I047 Switch", "I047"},
1327 {"O028", "I048 Switch", "I048"},
1328 {"O029", "I049 Switch", "I049"},
1329 {"O030", "I050 Switch", "I050"},
1330 {"O031", "I051 Switch", "I051"},
1331 {"O032", "I052 Switch", "I052"},
1332 {"O033", "I053 Switch", "I053"},
1334 {"O002", "I000 Switch", "I000"},
1335 {"O003", "I001 Switch", "I001"},
1336 {"O002", "I020 Switch", "I020"},
1337 {"O003", "I021 Switch", "I021"},
1338 {"O002", "I070 Switch", "I070"},
1339 {"O003", "I071 Switch", "I071"},
1341 {"O034", "I000 Switch", "I000"},
1342 {"O035", "I001 Switch", "I001"},
1343 {"O034", "I002 Switch", "I002"},
1344 {"O035", "I003 Switch", "I003"},
1345 {"O034", "I012 Switch", "I012"},
1346 {"O035", "I013 Switch", "I013"},
1347 {"O034", "I020 Switch", "I020"},
1348 {"O035", "I021 Switch", "I021"},
1349 {"O034", "I070 Switch", "I070"},
1350 {"O035", "I071 Switch", "I071"},
1351 {"O034", "I072 Switch", "I072"},
1352 {"O035", "I073 Switch", "I073"},
1354 {"O036", "I000 Switch", "I000"},
1355 {"O037", "I001 Switch", "I001"},
1356 {"O036", "I012 Switch", "I012"},
1357 {"O037", "I013 Switch", "I013"},
1358 {"O036", "I020 Switch", "I020"},
1359 {"O037", "I021 Switch", "I021"},
1360 {"O036", "I070 Switch", "I070"},
1361 {"O037", "I071 Switch", "I071"},
1362 {"O036", "I168 Switch", "I168"},
1363 {"O037", "I169 Switch", "I169"},
1365 {"O038", "I022 Switch", "I022"},
1366 {"O039", "I023 Switch", "I023"},
1367 {"O182", "I024 Switch", "I024"},
1368 {"O183", "I025 Switch", "I025"},
1370 {"O040", "I022 Switch", "I022"},
1371 {"O041", "I023 Switch", "I023"},
1372 {"O042", "I024 Switch", "I024"},
1373 {"O043", "I025 Switch", "I025"},
1374 {"O044", "I026 Switch", "I026"},
1375 {"O045", "I027 Switch", "I027"},
1376 {"O046", "I028 Switch", "I028"},
1377 {"O047", "I029 Switch", "I029"},
1379 {"O040", "I002 Switch", "I002"},
1380 {"O041", "I003 Switch", "I003"},
1381 {"O002", "I012 Switch", "I012"},
1382 {"O003", "I013 Switch", "I013"},
1383 {"O004", "I014 Switch", "I014"},
1384 {"O005", "I015 Switch", "I015"},
1385 {"O006", "I016 Switch", "I016"},
1386 {"O007", "I017 Switch", "I017"},
1387 {"O008", "I018 Switch", "I018"},
1388 {"O009", "I019 Switch", "I019"},
1390 {"O040", "I012 Switch", "I012"},
1391 {"O041", "I013 Switch", "I013"},
1392 {"O042", "I014 Switch", "I014"},
1393 {"O043", "I015 Switch", "I015"},
1394 {"O044", "I016 Switch", "I016"},
1395 {"O045", "I017 Switch", "I017"},
1396 {"O046", "I018 Switch", "I018"},
1397 {"O047", "I019 Switch", "I019"},
1399 {"O002", "I072 Switch", "I072"},
1400 {"O003", "I073 Switch", "I073"},
1401 {"O004", "I074 Switch", "I074"},
1402 {"O005", "I075 Switch", "I075"},
1403 {"O006", "I076 Switch", "I076"},
1404 {"O007", "I077 Switch", "I077"},
1405 {"O008", "I078 Switch", "I078"},
1406 {"O009", "I079 Switch", "I079"},
1408 {"O010", "I072 Switch", "I072"},
1409 {"O011", "I073 Switch", "I073"},
1410 {"O012", "I074 Switch", "I074"},
1411 {"O013", "I075 Switch", "I075"},
1412 {"O014", "I076 Switch", "I076"},
1413 {"O015", "I077 Switch", "I077"},
1414 {"O016", "I078 Switch", "I078"},
1415 {"O017", "I079 Switch", "I079"},
1416 {"O018", "I080 Switch", "I080"},
1417 {"O019", "I081 Switch", "I081"},
1418 {"O020", "I082 Switch", "I082"},
1419 {"O021", "I083 Switch", "I083"},
1420 {"O022", "I084 Switch", "I084"},
1421 {"O023", "I085 Switch", "I085"},
1422 {"O024", "I086 Switch", "I086"},
1423 {"O025", "I087 Switch", "I087"},
1424 {"O026", "I088 Switch", "I088"},
1425 {"O027", "I089 Switch", "I089"},
1426 {"O028", "I090 Switch", "I090"},
1427 {"O029", "I091 Switch", "I091"},
1428 {"O030", "I092 Switch", "I092"},
1429 {"O031", "I093 Switch", "I093"},
1430 {"O032", "I094 Switch", "I094"},
1431 {"O033", "I095 Switch", "I095"},
1433 {"O002", "I168 Switch", "I168"},
1434 {"O003", "I169 Switch", "I169"},
1435 {"O004", "I170 Switch", "I170"},
1436 {"O005", "I171 Switch", "I171"},
1438 {"O034", "I168 Switch", "I168"},
1439 {"O035", "I168 Switch", "I168"},
1440 {"O035", "I169 Switch", "I169"},
1442 {"O034", "I170 Switch", "I170"},
1443 {"O035", "I170 Switch", "I170"},
1444 {"O035", "I171 Switch", "I171"},
1446 {"O040", "I168 Switch", "I168"},
1447 {"O041", "I169 Switch", "I169"},
1448 {"O042", "I170 Switch", "I170"},
1449 {"O043", "I171 Switch", "I171"},
1452 static const char * const mt8195_afe_1x_en_sel_text
[] = {
1453 "a1sys_a2sys", "a3sys", "a4sys",
1456 static const unsigned int mt8195_afe_1x_en_sel_values
[] = {
1460 static int mt8195_memif_1x_en_sel_put(struct snd_kcontrol
*kcontrol
,
1461 struct snd_ctl_elem_value
*ucontrol
)
1463 struct snd_soc_component
*component
=
1464 snd_soc_kcontrol_component(kcontrol
);
1465 struct mtk_base_afe
*afe
= snd_soc_component_get_drvdata(component
);
1466 struct mt8195_afe_private
*afe_priv
= afe
->platform_priv
;
1467 struct mtk_dai_memif_priv
*memif_priv
;
1468 unsigned int dai_id
= kcontrol
->id
.device
;
1469 long val
= ucontrol
->value
.integer
.value
[0];
1472 memif_priv
= afe_priv
->dai_priv
[dai_id
];
1474 if (val
== memif_priv
->asys_timing_sel
)
1477 ret
= snd_soc_put_enum_double(kcontrol
, ucontrol
);
1479 memif_priv
->asys_timing_sel
= val
;
1484 static int mt8195_asys_irq_1x_en_sel_put(struct snd_kcontrol
*kcontrol
,
1485 struct snd_ctl_elem_value
*ucontrol
)
1487 struct snd_soc_component
*component
=
1488 snd_soc_kcontrol_component(kcontrol
);
1489 struct mtk_base_afe
*afe
= snd_soc_component_get_drvdata(component
);
1490 struct mt8195_afe_private
*afe_priv
= afe
->platform_priv
;
1491 unsigned int id
= kcontrol
->id
.device
;
1492 long val
= ucontrol
->value
.integer
.value
[0];
1495 if (val
== afe_priv
->irq_priv
[id
].asys_timing_sel
)
1498 ret
= snd_soc_put_enum_double(kcontrol
, ucontrol
);
1500 afe_priv
->irq_priv
[id
].asys_timing_sel
= val
;
1505 static SOC_VALUE_ENUM_SINGLE_DECL(dl2_1x_en_sel_enum
,
1506 A3_A4_TIMING_SEL1
, 18, 0x3,
1507 mt8195_afe_1x_en_sel_text
,
1508 mt8195_afe_1x_en_sel_values
);
1509 static SOC_VALUE_ENUM_SINGLE_DECL(dl3_1x_en_sel_enum
,
1510 A3_A4_TIMING_SEL1
, 20, 0x3,
1511 mt8195_afe_1x_en_sel_text
,
1512 mt8195_afe_1x_en_sel_values
);
1513 static SOC_VALUE_ENUM_SINGLE_DECL(dl6_1x_en_sel_enum
,
1514 A3_A4_TIMING_SEL1
, 22, 0x3,
1515 mt8195_afe_1x_en_sel_text
,
1516 mt8195_afe_1x_en_sel_values
);
1517 static SOC_VALUE_ENUM_SINGLE_DECL(dl7_1x_en_sel_enum
,
1518 A3_A4_TIMING_SEL1
, 24, 0x3,
1519 mt8195_afe_1x_en_sel_text
,
1520 mt8195_afe_1x_en_sel_values
);
1521 static SOC_VALUE_ENUM_SINGLE_DECL(dl8_1x_en_sel_enum
,
1522 A3_A4_TIMING_SEL1
, 26, 0x3,
1523 mt8195_afe_1x_en_sel_text
,
1524 mt8195_afe_1x_en_sel_values
);
1525 static SOC_VALUE_ENUM_SINGLE_DECL(dl10_1x_en_sel_enum
,
1526 A3_A4_TIMING_SEL1
, 28, 0x3,
1527 mt8195_afe_1x_en_sel_text
,
1528 mt8195_afe_1x_en_sel_values
);
1529 static SOC_VALUE_ENUM_SINGLE_DECL(dl11_1x_en_sel_enum
,
1530 A3_A4_TIMING_SEL1
, 30, 0x3,
1531 mt8195_afe_1x_en_sel_text
,
1532 mt8195_afe_1x_en_sel_values
);
1533 static SOC_VALUE_ENUM_SINGLE_DECL(ul1_1x_en_sel_enum
,
1534 A3_A4_TIMING_SEL1
, 0, 0x3,
1535 mt8195_afe_1x_en_sel_text
,
1536 mt8195_afe_1x_en_sel_values
);
1537 static SOC_VALUE_ENUM_SINGLE_DECL(ul2_1x_en_sel_enum
,
1538 A3_A4_TIMING_SEL1
, 2, 0x3,
1539 mt8195_afe_1x_en_sel_text
,
1540 mt8195_afe_1x_en_sel_values
);
1541 static SOC_VALUE_ENUM_SINGLE_DECL(ul3_1x_en_sel_enum
,
1542 A3_A4_TIMING_SEL1
, 4, 0x3,
1543 mt8195_afe_1x_en_sel_text
,
1544 mt8195_afe_1x_en_sel_values
);
1545 static SOC_VALUE_ENUM_SINGLE_DECL(ul4_1x_en_sel_enum
,
1546 A3_A4_TIMING_SEL1
, 6, 0x3,
1547 mt8195_afe_1x_en_sel_text
,
1548 mt8195_afe_1x_en_sel_values
);
1549 static SOC_VALUE_ENUM_SINGLE_DECL(ul5_1x_en_sel_enum
,
1550 A3_A4_TIMING_SEL1
, 8, 0x3,
1551 mt8195_afe_1x_en_sel_text
,
1552 mt8195_afe_1x_en_sel_values
);
1553 static SOC_VALUE_ENUM_SINGLE_DECL(ul6_1x_en_sel_enum
,
1554 A3_A4_TIMING_SEL1
, 10, 0x3,
1555 mt8195_afe_1x_en_sel_text
,
1556 mt8195_afe_1x_en_sel_values
);
1557 static SOC_VALUE_ENUM_SINGLE_DECL(ul8_1x_en_sel_enum
,
1558 A3_A4_TIMING_SEL1
, 12, 0x3,
1559 mt8195_afe_1x_en_sel_text
,
1560 mt8195_afe_1x_en_sel_values
);
1561 static SOC_VALUE_ENUM_SINGLE_DECL(ul9_1x_en_sel_enum
,
1562 A3_A4_TIMING_SEL1
, 14, 0x3,
1563 mt8195_afe_1x_en_sel_text
,
1564 mt8195_afe_1x_en_sel_values
);
1565 static SOC_VALUE_ENUM_SINGLE_DECL(ul10_1x_en_sel_enum
,
1566 A3_A4_TIMING_SEL1
, 16, 0x3,
1567 mt8195_afe_1x_en_sel_text
,
1568 mt8195_afe_1x_en_sel_values
);
1570 static SOC_VALUE_ENUM_SINGLE_DECL(asys_irq1_1x_en_sel_enum
,
1571 A3_A4_TIMING_SEL6
, 0, 0x3,
1572 mt8195_afe_1x_en_sel_text
,
1573 mt8195_afe_1x_en_sel_values
);
1574 static SOC_VALUE_ENUM_SINGLE_DECL(asys_irq2_1x_en_sel_enum
,
1575 A3_A4_TIMING_SEL6
, 2, 0x3,
1576 mt8195_afe_1x_en_sel_text
,
1577 mt8195_afe_1x_en_sel_values
);
1578 static SOC_VALUE_ENUM_SINGLE_DECL(asys_irq3_1x_en_sel_enum
,
1579 A3_A4_TIMING_SEL6
, 4, 0x3,
1580 mt8195_afe_1x_en_sel_text
,
1581 mt8195_afe_1x_en_sel_values
);
1582 static SOC_VALUE_ENUM_SINGLE_DECL(asys_irq4_1x_en_sel_enum
,
1583 A3_A4_TIMING_SEL6
, 6, 0x3,
1584 mt8195_afe_1x_en_sel_text
,
1585 mt8195_afe_1x_en_sel_values
);
1586 static SOC_VALUE_ENUM_SINGLE_DECL(asys_irq5_1x_en_sel_enum
,
1587 A3_A4_TIMING_SEL6
, 8, 0x3,
1588 mt8195_afe_1x_en_sel_text
,
1589 mt8195_afe_1x_en_sel_values
);
1590 static SOC_VALUE_ENUM_SINGLE_DECL(asys_irq6_1x_en_sel_enum
,
1591 A3_A4_TIMING_SEL6
, 10, 0x3,
1592 mt8195_afe_1x_en_sel_text
,
1593 mt8195_afe_1x_en_sel_values
);
1594 static SOC_VALUE_ENUM_SINGLE_DECL(asys_irq7_1x_en_sel_enum
,
1595 A3_A4_TIMING_SEL6
, 12, 0x3,
1596 mt8195_afe_1x_en_sel_text
,
1597 mt8195_afe_1x_en_sel_values
);
1598 static SOC_VALUE_ENUM_SINGLE_DECL(asys_irq8_1x_en_sel_enum
,
1599 A3_A4_TIMING_SEL6
, 14, 0x3,
1600 mt8195_afe_1x_en_sel_text
,
1601 mt8195_afe_1x_en_sel_values
);
1602 static SOC_VALUE_ENUM_SINGLE_DECL(asys_irq9_1x_en_sel_enum
,
1603 A3_A4_TIMING_SEL6
, 16, 0x3,
1604 mt8195_afe_1x_en_sel_text
,
1605 mt8195_afe_1x_en_sel_values
);
1606 static SOC_VALUE_ENUM_SINGLE_DECL(asys_irq10_1x_en_sel_enum
,
1607 A3_A4_TIMING_SEL6
, 18, 0x3,
1608 mt8195_afe_1x_en_sel_text
,
1609 mt8195_afe_1x_en_sel_values
);
1610 static SOC_VALUE_ENUM_SINGLE_DECL(asys_irq11_1x_en_sel_enum
,
1611 A3_A4_TIMING_SEL6
, 20, 0x3,
1612 mt8195_afe_1x_en_sel_text
,
1613 mt8195_afe_1x_en_sel_values
);
1614 static SOC_VALUE_ENUM_SINGLE_DECL(asys_irq12_1x_en_sel_enum
,
1615 A3_A4_TIMING_SEL6
, 22, 0x3,
1616 mt8195_afe_1x_en_sel_text
,
1617 mt8195_afe_1x_en_sel_values
);
1618 static SOC_VALUE_ENUM_SINGLE_DECL(asys_irq13_1x_en_sel_enum
,
1619 A3_A4_TIMING_SEL6
, 24, 0x3,
1620 mt8195_afe_1x_en_sel_text
,
1621 mt8195_afe_1x_en_sel_values
);
1622 static SOC_VALUE_ENUM_SINGLE_DECL(asys_irq14_1x_en_sel_enum
,
1623 A3_A4_TIMING_SEL6
, 26, 0x3,
1624 mt8195_afe_1x_en_sel_text
,
1625 mt8195_afe_1x_en_sel_values
);
1626 static SOC_VALUE_ENUM_SINGLE_DECL(asys_irq15_1x_en_sel_enum
,
1627 A3_A4_TIMING_SEL6
, 28, 0x3,
1628 mt8195_afe_1x_en_sel_text
,
1629 mt8195_afe_1x_en_sel_values
);
1630 static SOC_VALUE_ENUM_SINGLE_DECL(asys_irq16_1x_en_sel_enum
,
1631 A3_A4_TIMING_SEL6
, 30, 0x3,
1632 mt8195_afe_1x_en_sel_text
,
1633 mt8195_afe_1x_en_sel_values
);
1635 static const struct snd_kcontrol_new mt8195_memif_controls
[] = {
1636 MT8195_SOC_ENUM_EXT("dl2_1x_en_sel",
1638 snd_soc_get_enum_double
,
1639 mt8195_memif_1x_en_sel_put
,
1640 MT8195_AFE_MEMIF_DL2
),
1641 MT8195_SOC_ENUM_EXT("dl3_1x_en_sel",
1643 snd_soc_get_enum_double
,
1644 mt8195_memif_1x_en_sel_put
,
1645 MT8195_AFE_MEMIF_DL3
),
1646 MT8195_SOC_ENUM_EXT("dl6_1x_en_sel",
1648 snd_soc_get_enum_double
,
1649 mt8195_memif_1x_en_sel_put
,
1650 MT8195_AFE_MEMIF_DL6
),
1651 MT8195_SOC_ENUM_EXT("dl7_1x_en_sel",
1653 snd_soc_get_enum_double
,
1654 mt8195_memif_1x_en_sel_put
,
1655 MT8195_AFE_MEMIF_DL7
),
1656 MT8195_SOC_ENUM_EXT("dl8_1x_en_sel",
1658 snd_soc_get_enum_double
,
1659 mt8195_memif_1x_en_sel_put
,
1660 MT8195_AFE_MEMIF_DL8
),
1661 MT8195_SOC_ENUM_EXT("dl10_1x_en_sel",
1662 dl10_1x_en_sel_enum
,
1663 snd_soc_get_enum_double
,
1664 mt8195_memif_1x_en_sel_put
,
1665 MT8195_AFE_MEMIF_DL10
),
1666 MT8195_SOC_ENUM_EXT("dl11_1x_en_sel",
1667 dl11_1x_en_sel_enum
,
1668 snd_soc_get_enum_double
,
1669 mt8195_memif_1x_en_sel_put
,
1670 MT8195_AFE_MEMIF_DL11
),
1671 MT8195_SOC_ENUM_EXT("ul1_1x_en_sel",
1673 snd_soc_get_enum_double
,
1674 mt8195_memif_1x_en_sel_put
,
1675 MT8195_AFE_MEMIF_UL1
),
1676 MT8195_SOC_ENUM_EXT("ul2_1x_en_sel",
1678 snd_soc_get_enum_double
,
1679 mt8195_memif_1x_en_sel_put
,
1680 MT8195_AFE_MEMIF_UL2
),
1681 MT8195_SOC_ENUM_EXT("ul3_1x_en_sel",
1683 snd_soc_get_enum_double
,
1684 mt8195_memif_1x_en_sel_put
,
1685 MT8195_AFE_MEMIF_UL3
),
1686 MT8195_SOC_ENUM_EXT("ul4_1x_en_sel",
1688 snd_soc_get_enum_double
,
1689 mt8195_memif_1x_en_sel_put
,
1690 MT8195_AFE_MEMIF_UL4
),
1691 MT8195_SOC_ENUM_EXT("ul5_1x_en_sel",
1693 snd_soc_get_enum_double
,
1694 mt8195_memif_1x_en_sel_put
,
1695 MT8195_AFE_MEMIF_UL5
),
1696 MT8195_SOC_ENUM_EXT("ul6_1x_en_sel",
1698 snd_soc_get_enum_double
,
1699 mt8195_memif_1x_en_sel_put
,
1700 MT8195_AFE_MEMIF_UL6
),
1701 MT8195_SOC_ENUM_EXT("ul8_1x_en_sel",
1703 snd_soc_get_enum_double
,
1704 mt8195_memif_1x_en_sel_put
,
1705 MT8195_AFE_MEMIF_UL8
),
1706 MT8195_SOC_ENUM_EXT("ul9_1x_en_sel",
1708 snd_soc_get_enum_double
,
1709 mt8195_memif_1x_en_sel_put
,
1710 MT8195_AFE_MEMIF_UL9
),
1711 MT8195_SOC_ENUM_EXT("ul10_1x_en_sel",
1712 ul10_1x_en_sel_enum
,
1713 snd_soc_get_enum_double
,
1714 mt8195_memif_1x_en_sel_put
,
1715 MT8195_AFE_MEMIF_UL10
),
1716 MT8195_SOC_ENUM_EXT("asys_irq1_1x_en_sel",
1717 asys_irq1_1x_en_sel_enum
,
1718 snd_soc_get_enum_double
,
1719 mt8195_asys_irq_1x_en_sel_put
,
1721 MT8195_SOC_ENUM_EXT("asys_irq2_1x_en_sel",
1722 asys_irq2_1x_en_sel_enum
,
1723 snd_soc_get_enum_double
,
1724 mt8195_asys_irq_1x_en_sel_put
,
1726 MT8195_SOC_ENUM_EXT("asys_irq3_1x_en_sel",
1727 asys_irq3_1x_en_sel_enum
,
1728 snd_soc_get_enum_double
,
1729 mt8195_asys_irq_1x_en_sel_put
,
1731 MT8195_SOC_ENUM_EXT("asys_irq4_1x_en_sel",
1732 asys_irq4_1x_en_sel_enum
,
1733 snd_soc_get_enum_double
,
1734 mt8195_asys_irq_1x_en_sel_put
,
1736 MT8195_SOC_ENUM_EXT("asys_irq5_1x_en_sel",
1737 asys_irq5_1x_en_sel_enum
,
1738 snd_soc_get_enum_double
,
1739 mt8195_asys_irq_1x_en_sel_put
,
1741 MT8195_SOC_ENUM_EXT("asys_irq6_1x_en_sel",
1742 asys_irq6_1x_en_sel_enum
,
1743 snd_soc_get_enum_double
,
1744 mt8195_asys_irq_1x_en_sel_put
,
1746 MT8195_SOC_ENUM_EXT("asys_irq7_1x_en_sel",
1747 asys_irq7_1x_en_sel_enum
,
1748 snd_soc_get_enum_double
,
1749 mt8195_asys_irq_1x_en_sel_put
,
1751 MT8195_SOC_ENUM_EXT("asys_irq8_1x_en_sel",
1752 asys_irq8_1x_en_sel_enum
,
1753 snd_soc_get_enum_double
,
1754 mt8195_asys_irq_1x_en_sel_put
,
1756 MT8195_SOC_ENUM_EXT("asys_irq9_1x_en_sel",
1757 asys_irq9_1x_en_sel_enum
,
1758 snd_soc_get_enum_double
,
1759 mt8195_asys_irq_1x_en_sel_put
,
1761 MT8195_SOC_ENUM_EXT("asys_irq10_1x_en_sel",
1762 asys_irq10_1x_en_sel_enum
,
1763 snd_soc_get_enum_double
,
1764 mt8195_asys_irq_1x_en_sel_put
,
1766 MT8195_SOC_ENUM_EXT("asys_irq11_1x_en_sel",
1767 asys_irq11_1x_en_sel_enum
,
1768 snd_soc_get_enum_double
,
1769 mt8195_asys_irq_1x_en_sel_put
,
1771 MT8195_SOC_ENUM_EXT("asys_irq12_1x_en_sel",
1772 asys_irq12_1x_en_sel_enum
,
1773 snd_soc_get_enum_double
,
1774 mt8195_asys_irq_1x_en_sel_put
,
1776 MT8195_SOC_ENUM_EXT("asys_irq13_1x_en_sel",
1777 asys_irq13_1x_en_sel_enum
,
1778 snd_soc_get_enum_double
,
1779 mt8195_asys_irq_1x_en_sel_put
,
1781 MT8195_SOC_ENUM_EXT("asys_irq14_1x_en_sel",
1782 asys_irq14_1x_en_sel_enum
,
1783 snd_soc_get_enum_double
,
1784 mt8195_asys_irq_1x_en_sel_put
,
1786 MT8195_SOC_ENUM_EXT("asys_irq15_1x_en_sel",
1787 asys_irq15_1x_en_sel_enum
,
1788 snd_soc_get_enum_double
,
1789 mt8195_asys_irq_1x_en_sel_put
,
1791 MT8195_SOC_ENUM_EXT("asys_irq16_1x_en_sel",
1792 asys_irq16_1x_en_sel_enum
,
1793 snd_soc_get_enum_double
,
1794 mt8195_asys_irq_1x_en_sel_put
,
1798 static const struct mtk_base_memif_data memif_data
[MT8195_AFE_MEMIF_NUM
] = {
1799 [MT8195_AFE_MEMIF_DL2
] = {
1801 .id
= MT8195_AFE_MEMIF_DL2
,
1802 .reg_ofs_base
= AFE_DL2_BASE
,
1803 .reg_ofs_cur
= AFE_DL2_CUR
,
1804 .reg_ofs_end
= AFE_DL2_END
,
1805 .fs_reg
= AFE_MEMIF_AGENT_FS_CON0
,
1810 .int_odd_flag_reg
= -1,
1811 .int_odd_flag_shift
= 0,
1812 .enable_reg
= AFE_DAC_CON0
,
1814 .hd_reg
= AFE_DL2_CON0
,
1816 .agent_disable_reg
= AUDIO_TOP_CON5
,
1817 .agent_disable_shift
= 18,
1818 .ch_num_reg
= AFE_DL2_CON0
,
1820 .ch_num_maskbit
= 0x1f,
1821 .msb_reg
= AFE_NORMAL_BASE_ADR_MSB
,
1823 .msb_end_reg
= AFE_NORMAL_END_ADR_MSB
,
1824 .msb_end_shift
= 18,
1826 [MT8195_AFE_MEMIF_DL3
] = {
1828 .id
= MT8195_AFE_MEMIF_DL3
,
1829 .reg_ofs_base
= AFE_DL3_BASE
,
1830 .reg_ofs_cur
= AFE_DL3_CUR
,
1831 .reg_ofs_end
= AFE_DL3_END
,
1832 .fs_reg
= AFE_MEMIF_AGENT_FS_CON0
,
1837 .int_odd_flag_reg
= -1,
1838 .int_odd_flag_shift
= 0,
1839 .enable_reg
= AFE_DAC_CON0
,
1841 .hd_reg
= AFE_DL3_CON0
,
1843 .agent_disable_reg
= AUDIO_TOP_CON5
,
1844 .agent_disable_shift
= 19,
1845 .ch_num_reg
= AFE_DL3_CON0
,
1847 .ch_num_maskbit
= 0x1f,
1848 .msb_reg
= AFE_NORMAL_BASE_ADR_MSB
,
1850 .msb_end_reg
= AFE_NORMAL_END_ADR_MSB
,
1851 .msb_end_shift
= 19,
1853 [MT8195_AFE_MEMIF_DL6
] = {
1855 .id
= MT8195_AFE_MEMIF_DL6
,
1856 .reg_ofs_base
= AFE_DL6_BASE
,
1857 .reg_ofs_cur
= AFE_DL6_CUR
,
1858 .reg_ofs_end
= AFE_DL6_END
,
1859 .fs_reg
= AFE_MEMIF_AGENT_FS_CON1
,
1864 .int_odd_flag_reg
= -1,
1865 .int_odd_flag_shift
= 0,
1866 .enable_reg
= AFE_DAC_CON0
,
1868 .hd_reg
= AFE_DL6_CON0
,
1870 .agent_disable_reg
= AUDIO_TOP_CON5
,
1871 .agent_disable_shift
= 22,
1872 .ch_num_reg
= AFE_DL6_CON0
,
1874 .ch_num_maskbit
= 0x1f,
1875 .msb_reg
= AFE_NORMAL_BASE_ADR_MSB
,
1877 .msb_end_reg
= AFE_NORMAL_END_ADR_MSB
,
1878 .msb_end_shift
= 22,
1880 [MT8195_AFE_MEMIF_DL7
] = {
1882 .id
= MT8195_AFE_MEMIF_DL7
,
1883 .reg_ofs_base
= AFE_DL7_BASE
,
1884 .reg_ofs_cur
= AFE_DL7_CUR
,
1885 .reg_ofs_end
= AFE_DL7_END
,
1891 .int_odd_flag_reg
= -1,
1892 .int_odd_flag_shift
= 0,
1893 .enable_reg
= AFE_DAC_CON0
,
1895 .hd_reg
= AFE_DL7_CON0
,
1897 .agent_disable_reg
= AUDIO_TOP_CON5
,
1898 .agent_disable_shift
= 23,
1899 .ch_num_reg
= AFE_DL7_CON0
,
1901 .ch_num_maskbit
= 0x1f,
1902 .msb_reg
= AFE_NORMAL_BASE_ADR_MSB
,
1904 .msb_end_reg
= AFE_NORMAL_END_ADR_MSB
,
1905 .msb_end_shift
= 23,
1907 [MT8195_AFE_MEMIF_DL8
] = {
1909 .id
= MT8195_AFE_MEMIF_DL8
,
1910 .reg_ofs_base
= AFE_DL8_BASE
,
1911 .reg_ofs_cur
= AFE_DL8_CUR
,
1912 .reg_ofs_end
= AFE_DL8_END
,
1913 .fs_reg
= AFE_MEMIF_AGENT_FS_CON1
,
1918 .int_odd_flag_reg
= -1,
1919 .int_odd_flag_shift
= 0,
1920 .enable_reg
= AFE_DAC_CON0
,
1922 .hd_reg
= AFE_DL8_CON0
,
1924 .agent_disable_reg
= -1,
1925 .agent_disable_shift
= 0,
1926 .ch_num_reg
= AFE_DL8_CON0
,
1928 .ch_num_maskbit
= 0x3f,
1929 .msb_reg
= AFE_NORMAL_BASE_ADR_MSB
,
1931 .msb_end_reg
= AFE_NORMAL_END_ADR_MSB
,
1932 .msb_end_shift
= 24,
1934 [MT8195_AFE_MEMIF_DL10
] = {
1936 .id
= MT8195_AFE_MEMIF_DL10
,
1937 .reg_ofs_base
= AFE_DL10_BASE
,
1938 .reg_ofs_cur
= AFE_DL10_CUR
,
1939 .reg_ofs_end
= AFE_DL10_END
,
1940 .fs_reg
= AFE_MEMIF_AGENT_FS_CON1
,
1945 .int_odd_flag_reg
= -1,
1946 .int_odd_flag_shift
= 0,
1947 .enable_reg
= AFE_DAC_CON0
,
1949 .hd_reg
= AFE_DL10_CON0
,
1951 .agent_disable_reg
= -1,
1952 .agent_disable_shift
= 0,
1953 .ch_num_reg
= AFE_DL10_CON0
,
1955 .ch_num_maskbit
= 0x1f,
1956 .msb_reg
= AFE_NORMAL_BASE_ADR_MSB
,
1958 .msb_end_reg
= AFE_NORMAL_END_ADR_MSB
,
1959 .msb_end_shift
= 26,
1961 [MT8195_AFE_MEMIF_DL11
] = {
1963 .id
= MT8195_AFE_MEMIF_DL11
,
1964 .reg_ofs_base
= AFE_DL11_BASE
,
1965 .reg_ofs_cur
= AFE_DL11_CUR
,
1966 .reg_ofs_end
= AFE_DL11_END
,
1967 .fs_reg
= AFE_MEMIF_AGENT_FS_CON1
,
1972 .int_odd_flag_reg
= -1,
1973 .int_odd_flag_shift
= 0,
1974 .enable_reg
= AFE_DAC_CON0
,
1976 .hd_reg
= AFE_DL11_CON0
,
1978 .agent_disable_reg
= AUDIO_TOP_CON5
,
1979 .agent_disable_shift
= 27,
1980 .ch_num_reg
= AFE_DL11_CON0
,
1982 .ch_num_maskbit
= 0x7f,
1983 .msb_reg
= AFE_NORMAL_BASE_ADR_MSB
,
1985 .msb_end_reg
= AFE_NORMAL_END_ADR_MSB
,
1986 .msb_end_shift
= 27,
1988 [MT8195_AFE_MEMIF_UL1
] = {
1990 .id
= MT8195_AFE_MEMIF_UL1
,
1991 .reg_ofs_base
= AFE_UL1_BASE
,
1992 .reg_ofs_cur
= AFE_UL1_CUR
,
1993 .reg_ofs_end
= AFE_UL1_END
,
1997 .mono_reg
= AFE_UL1_CON0
,
1999 .int_odd_flag_reg
= AFE_UL1_CON0
,
2000 .int_odd_flag_shift
= 0,
2001 .enable_reg
= AFE_DAC_CON0
,
2003 .hd_reg
= AFE_UL1_CON0
,
2005 .agent_disable_reg
= AUDIO_TOP_CON5
,
2006 .agent_disable_shift
= 0,
2009 .ch_num_maskbit
= 0,
2010 .msb_reg
= AFE_NORMAL_BASE_ADR_MSB
,
2012 .msb_end_reg
= AFE_NORMAL_END_ADR_MSB
,
2015 [MT8195_AFE_MEMIF_UL2
] = {
2017 .id
= MT8195_AFE_MEMIF_UL2
,
2018 .reg_ofs_base
= AFE_UL2_BASE
,
2019 .reg_ofs_cur
= AFE_UL2_CUR
,
2020 .reg_ofs_end
= AFE_UL2_END
,
2021 .fs_reg
= AFE_MEMIF_AGENT_FS_CON2
,
2024 .mono_reg
= AFE_UL2_CON0
,
2026 .int_odd_flag_reg
= AFE_UL2_CON0
,
2027 .int_odd_flag_shift
= 0,
2028 .enable_reg
= AFE_DAC_CON0
,
2030 .hd_reg
= AFE_UL2_CON0
,
2032 .agent_disable_reg
= AUDIO_TOP_CON5
,
2033 .agent_disable_shift
= 1,
2036 .ch_num_maskbit
= 0,
2037 .msb_reg
= AFE_NORMAL_BASE_ADR_MSB
,
2039 .msb_end_reg
= AFE_NORMAL_END_ADR_MSB
,
2042 [MT8195_AFE_MEMIF_UL3
] = {
2044 .id
= MT8195_AFE_MEMIF_UL3
,
2045 .reg_ofs_base
= AFE_UL3_BASE
,
2046 .reg_ofs_cur
= AFE_UL3_CUR
,
2047 .reg_ofs_end
= AFE_UL3_END
,
2048 .fs_reg
= AFE_MEMIF_AGENT_FS_CON2
,
2051 .mono_reg
= AFE_UL3_CON0
,
2053 .int_odd_flag_reg
= AFE_UL3_CON0
,
2054 .int_odd_flag_shift
= 0,
2055 .enable_reg
= AFE_DAC_CON0
,
2057 .hd_reg
= AFE_UL3_CON0
,
2059 .agent_disable_reg
= AUDIO_TOP_CON5
,
2060 .agent_disable_shift
= 2,
2063 .ch_num_maskbit
= 0,
2064 .msb_reg
= AFE_NORMAL_BASE_ADR_MSB
,
2066 .msb_end_reg
= AFE_NORMAL_END_ADR_MSB
,
2069 [MT8195_AFE_MEMIF_UL4
] = {
2071 .id
= MT8195_AFE_MEMIF_UL4
,
2072 .reg_ofs_base
= AFE_UL4_BASE
,
2073 .reg_ofs_cur
= AFE_UL4_CUR
,
2074 .reg_ofs_end
= AFE_UL4_END
,
2075 .fs_reg
= AFE_MEMIF_AGENT_FS_CON2
,
2078 .mono_reg
= AFE_UL4_CON0
,
2080 .int_odd_flag_reg
= AFE_UL4_CON0
,
2081 .int_odd_flag_shift
= 0,
2082 .enable_reg
= AFE_DAC_CON0
,
2084 .hd_reg
= AFE_UL4_CON0
,
2086 .agent_disable_reg
= AUDIO_TOP_CON5
,
2087 .agent_disable_shift
= 3,
2090 .ch_num_maskbit
= 0,
2091 .msb_reg
= AFE_NORMAL_BASE_ADR_MSB
,
2093 .msb_end_reg
= AFE_NORMAL_END_ADR_MSB
,
2096 [MT8195_AFE_MEMIF_UL5
] = {
2098 .id
= MT8195_AFE_MEMIF_UL5
,
2099 .reg_ofs_base
= AFE_UL5_BASE
,
2100 .reg_ofs_cur
= AFE_UL5_CUR
,
2101 .reg_ofs_end
= AFE_UL5_END
,
2102 .fs_reg
= AFE_MEMIF_AGENT_FS_CON2
,
2105 .mono_reg
= AFE_UL5_CON0
,
2107 .int_odd_flag_reg
= AFE_UL5_CON0
,
2108 .int_odd_flag_shift
= 0,
2109 .enable_reg
= AFE_DAC_CON0
,
2111 .hd_reg
= AFE_UL5_CON0
,
2113 .agent_disable_reg
= AUDIO_TOP_CON5
,
2114 .agent_disable_shift
= 4,
2117 .ch_num_maskbit
= 0,
2118 .msb_reg
= AFE_NORMAL_BASE_ADR_MSB
,
2120 .msb_end_reg
= AFE_NORMAL_END_ADR_MSB
,
2123 [MT8195_AFE_MEMIF_UL6
] = {
2125 .id
= MT8195_AFE_MEMIF_UL6
,
2126 .reg_ofs_base
= AFE_UL6_BASE
,
2127 .reg_ofs_cur
= AFE_UL6_CUR
,
2128 .reg_ofs_end
= AFE_UL6_END
,
2132 .mono_reg
= AFE_UL6_CON0
,
2134 .int_odd_flag_reg
= AFE_UL6_CON0
,
2135 .int_odd_flag_shift
= 0,
2136 .enable_reg
= AFE_DAC_CON0
,
2138 .hd_reg
= AFE_UL6_CON0
,
2140 .agent_disable_reg
= AUDIO_TOP_CON5
,
2141 .agent_disable_shift
= 5,
2144 .ch_num_maskbit
= 0,
2145 .msb_reg
= AFE_NORMAL_BASE_ADR_MSB
,
2147 .msb_end_reg
= AFE_NORMAL_END_ADR_MSB
,
2150 [MT8195_AFE_MEMIF_UL8
] = {
2152 .id
= MT8195_AFE_MEMIF_UL8
,
2153 .reg_ofs_base
= AFE_UL8_BASE
,
2154 .reg_ofs_cur
= AFE_UL8_CUR
,
2155 .reg_ofs_end
= AFE_UL8_END
,
2156 .fs_reg
= AFE_MEMIF_AGENT_FS_CON3
,
2159 .mono_reg
= AFE_UL8_CON0
,
2161 .int_odd_flag_reg
= AFE_UL8_CON0
,
2162 .int_odd_flag_shift
= 0,
2163 .enable_reg
= AFE_DAC_CON0
,
2165 .hd_reg
= AFE_UL8_CON0
,
2167 .agent_disable_reg
= AUDIO_TOP_CON5
,
2168 .agent_disable_shift
= 7,
2171 .ch_num_maskbit
= 0,
2172 .msb_reg
= AFE_NORMAL_BASE_ADR_MSB
,
2174 .msb_end_reg
= AFE_NORMAL_END_ADR_MSB
,
2177 [MT8195_AFE_MEMIF_UL9
] = {
2179 .id
= MT8195_AFE_MEMIF_UL9
,
2180 .reg_ofs_base
= AFE_UL9_BASE
,
2181 .reg_ofs_cur
= AFE_UL9_CUR
,
2182 .reg_ofs_end
= AFE_UL9_END
,
2183 .fs_reg
= AFE_MEMIF_AGENT_FS_CON3
,
2186 .mono_reg
= AFE_UL9_CON0
,
2188 .int_odd_flag_reg
= AFE_UL9_CON0
,
2189 .int_odd_flag_shift
= 0,
2190 .enable_reg
= AFE_DAC_CON0
,
2192 .hd_reg
= AFE_UL9_CON0
,
2194 .agent_disable_reg
= AUDIO_TOP_CON5
,
2195 .agent_disable_shift
= 8,
2198 .ch_num_maskbit
= 0,
2199 .msb_reg
= AFE_NORMAL_BASE_ADR_MSB
,
2201 .msb_end_reg
= AFE_NORMAL_END_ADR_MSB
,
2204 [MT8195_AFE_MEMIF_UL10
] = {
2206 .id
= MT8195_AFE_MEMIF_UL10
,
2207 .reg_ofs_base
= AFE_UL10_BASE
,
2208 .reg_ofs_cur
= AFE_UL10_CUR
,
2209 .reg_ofs_end
= AFE_UL10_END
,
2210 .fs_reg
= AFE_MEMIF_AGENT_FS_CON3
,
2213 .mono_reg
= AFE_UL10_CON0
,
2215 .int_odd_flag_reg
= AFE_UL10_CON0
,
2216 .int_odd_flag_shift
= 0,
2217 .enable_reg
= AFE_DAC_CON0
,
2219 .hd_reg
= AFE_UL10_CON0
,
2221 .agent_disable_reg
= AUDIO_TOP_CON5
,
2222 .agent_disable_shift
= 9,
2225 .ch_num_maskbit
= 0,
2226 .msb_reg
= AFE_NORMAL_BASE_ADR_MSB
,
2228 .msb_end_reg
= AFE_NORMAL_END_ADR_MSB
,
2233 static const struct mtk_base_irq_data irq_data_array
[MT8195_AFE_IRQ_NUM
] = {
2234 [MT8195_AFE_IRQ_1
] = {
2235 .id
= MT8195_AFE_IRQ_1
,
2238 .irq_cnt_maskbit
= 0,
2241 .irq_fs_maskbit
= 0,
2242 .irq_en_reg
= AFE_IRQ1_CON
,
2244 .irq_clr_reg
= AFE_IRQ_MCU_CLR
,
2246 .irq_status_shift
= 16,
2248 [MT8195_AFE_IRQ_2
] = {
2249 .id
= MT8195_AFE_IRQ_2
,
2252 .irq_cnt_maskbit
= 0,
2255 .irq_fs_maskbit
= 0,
2256 .irq_en_reg
= AFE_IRQ2_CON
,
2258 .irq_clr_reg
= AFE_IRQ_MCU_CLR
,
2260 .irq_status_shift
= 17,
2262 [MT8195_AFE_IRQ_3
] = {
2263 .id
= MT8195_AFE_IRQ_3
,
2264 .irq_cnt_reg
= AFE_IRQ3_CON
,
2266 .irq_cnt_maskbit
= 0xffffff,
2269 .irq_fs_maskbit
= 0,
2270 .irq_en_reg
= AFE_IRQ3_CON
,
2272 .irq_clr_reg
= AFE_IRQ_MCU_CLR
,
2274 .irq_status_shift
= 18,
2276 [MT8195_AFE_IRQ_8
] = {
2277 .id
= MT8195_AFE_IRQ_8
,
2280 .irq_cnt_maskbit
= 0,
2283 .irq_fs_maskbit
= 0,
2284 .irq_en_reg
= AFE_IRQ8_CON
,
2286 .irq_clr_reg
= AFE_IRQ_MCU_CLR
,
2288 .irq_status_shift
= 23,
2290 [MT8195_AFE_IRQ_9
] = {
2291 .id
= MT8195_AFE_IRQ_9
,
2292 .irq_cnt_reg
= AFE_IRQ9_CON
,
2294 .irq_cnt_maskbit
= 0xffffff,
2297 .irq_fs_maskbit
= 0,
2298 .irq_en_reg
= AFE_IRQ9_CON
,
2300 .irq_clr_reg
= AFE_IRQ_MCU_CLR
,
2302 .irq_status_shift
= 24,
2304 [MT8195_AFE_IRQ_10
] = {
2305 .id
= MT8195_AFE_IRQ_10
,
2308 .irq_cnt_maskbit
= 0,
2311 .irq_fs_maskbit
= 0,
2312 .irq_en_reg
= AFE_IRQ10_CON
,
2314 .irq_clr_reg
= AFE_IRQ_MCU_CLR
,
2316 .irq_status_shift
= 25,
2318 [MT8195_AFE_IRQ_13
] = {
2319 .id
= MT8195_AFE_IRQ_13
,
2320 .irq_cnt_reg
= ASYS_IRQ1_CON
,
2322 .irq_cnt_maskbit
= 0xffffff,
2323 .irq_fs_reg
= ASYS_IRQ1_CON
,
2325 .irq_fs_maskbit
= 0x1ffff,
2326 .irq_en_reg
= ASYS_IRQ1_CON
,
2328 .irq_clr_reg
= ASYS_IRQ_CLR
,
2330 .irq_status_shift
= 0,
2332 [MT8195_AFE_IRQ_14
] = {
2333 .id
= MT8195_AFE_IRQ_14
,
2334 .irq_cnt_reg
= ASYS_IRQ2_CON
,
2336 .irq_cnt_maskbit
= 0xffffff,
2337 .irq_fs_reg
= ASYS_IRQ2_CON
,
2339 .irq_fs_maskbit
= 0x1ffff,
2340 .irq_en_reg
= ASYS_IRQ2_CON
,
2342 .irq_clr_reg
= ASYS_IRQ_CLR
,
2344 .irq_status_shift
= 1,
2346 [MT8195_AFE_IRQ_15
] = {
2347 .id
= MT8195_AFE_IRQ_15
,
2348 .irq_cnt_reg
= ASYS_IRQ3_CON
,
2350 .irq_cnt_maskbit
= 0xffffff,
2351 .irq_fs_reg
= ASYS_IRQ3_CON
,
2353 .irq_fs_maskbit
= 0x1ffff,
2354 .irq_en_reg
= ASYS_IRQ3_CON
,
2356 .irq_clr_reg
= ASYS_IRQ_CLR
,
2358 .irq_status_shift
= 2,
2360 [MT8195_AFE_IRQ_16
] = {
2361 .id
= MT8195_AFE_IRQ_16
,
2362 .irq_cnt_reg
= ASYS_IRQ4_CON
,
2364 .irq_cnt_maskbit
= 0xffffff,
2365 .irq_fs_reg
= ASYS_IRQ4_CON
,
2367 .irq_fs_maskbit
= 0x1ffff,
2368 .irq_en_reg
= ASYS_IRQ4_CON
,
2370 .irq_clr_reg
= ASYS_IRQ_CLR
,
2372 .irq_status_shift
= 3,
2374 [MT8195_AFE_IRQ_17
] = {
2375 .id
= MT8195_AFE_IRQ_17
,
2376 .irq_cnt_reg
= ASYS_IRQ5_CON
,
2378 .irq_cnt_maskbit
= 0xffffff,
2379 .irq_fs_reg
= ASYS_IRQ5_CON
,
2381 .irq_fs_maskbit
= 0x1ffff,
2382 .irq_en_reg
= ASYS_IRQ5_CON
,
2384 .irq_clr_reg
= ASYS_IRQ_CLR
,
2386 .irq_status_shift
= 4,
2388 [MT8195_AFE_IRQ_18
] = {
2389 .id
= MT8195_AFE_IRQ_18
,
2390 .irq_cnt_reg
= ASYS_IRQ6_CON
,
2392 .irq_cnt_maskbit
= 0xffffff,
2393 .irq_fs_reg
= ASYS_IRQ6_CON
,
2395 .irq_fs_maskbit
= 0x1ffff,
2396 .irq_en_reg
= ASYS_IRQ6_CON
,
2398 .irq_clr_reg
= ASYS_IRQ_CLR
,
2400 .irq_status_shift
= 5,
2402 [MT8195_AFE_IRQ_19
] = {
2403 .id
= MT8195_AFE_IRQ_19
,
2404 .irq_cnt_reg
= ASYS_IRQ7_CON
,
2406 .irq_cnt_maskbit
= 0xffffff,
2407 .irq_fs_reg
= ASYS_IRQ7_CON
,
2409 .irq_fs_maskbit
= 0x1ffff,
2410 .irq_en_reg
= ASYS_IRQ7_CON
,
2412 .irq_clr_reg
= ASYS_IRQ_CLR
,
2414 .irq_status_shift
= 6,
2416 [MT8195_AFE_IRQ_20
] = {
2417 .id
= MT8195_AFE_IRQ_20
,
2418 .irq_cnt_reg
= ASYS_IRQ8_CON
,
2420 .irq_cnt_maskbit
= 0xffffff,
2421 .irq_fs_reg
= ASYS_IRQ8_CON
,
2423 .irq_fs_maskbit
= 0x1ffff,
2424 .irq_en_reg
= ASYS_IRQ8_CON
,
2426 .irq_clr_reg
= ASYS_IRQ_CLR
,
2428 .irq_status_shift
= 7,
2430 [MT8195_AFE_IRQ_21
] = {
2431 .id
= MT8195_AFE_IRQ_21
,
2432 .irq_cnt_reg
= ASYS_IRQ9_CON
,
2434 .irq_cnt_maskbit
= 0xffffff,
2435 .irq_fs_reg
= ASYS_IRQ9_CON
,
2437 .irq_fs_maskbit
= 0x1ffff,
2438 .irq_en_reg
= ASYS_IRQ9_CON
,
2440 .irq_clr_reg
= ASYS_IRQ_CLR
,
2442 .irq_status_shift
= 8,
2444 [MT8195_AFE_IRQ_22
] = {
2445 .id
= MT8195_AFE_IRQ_22
,
2446 .irq_cnt_reg
= ASYS_IRQ10_CON
,
2448 .irq_cnt_maskbit
= 0xffffff,
2449 .irq_fs_reg
= ASYS_IRQ10_CON
,
2451 .irq_fs_maskbit
= 0x1ffff,
2452 .irq_en_reg
= ASYS_IRQ10_CON
,
2454 .irq_clr_reg
= ASYS_IRQ_CLR
,
2456 .irq_status_shift
= 9,
2458 [MT8195_AFE_IRQ_23
] = {
2459 .id
= MT8195_AFE_IRQ_23
,
2460 .irq_cnt_reg
= ASYS_IRQ11_CON
,
2462 .irq_cnt_maskbit
= 0xffffff,
2463 .irq_fs_reg
= ASYS_IRQ11_CON
,
2465 .irq_fs_maskbit
= 0x1ffff,
2466 .irq_en_reg
= ASYS_IRQ11_CON
,
2468 .irq_clr_reg
= ASYS_IRQ_CLR
,
2469 .irq_clr_shift
= 10,
2470 .irq_status_shift
= 10,
2472 [MT8195_AFE_IRQ_24
] = {
2473 .id
= MT8195_AFE_IRQ_24
,
2474 .irq_cnt_reg
= ASYS_IRQ12_CON
,
2476 .irq_cnt_maskbit
= 0xffffff,
2477 .irq_fs_reg
= ASYS_IRQ12_CON
,
2479 .irq_fs_maskbit
= 0x1ffff,
2480 .irq_en_reg
= ASYS_IRQ12_CON
,
2482 .irq_clr_reg
= ASYS_IRQ_CLR
,
2483 .irq_clr_shift
= 11,
2484 .irq_status_shift
= 11,
2486 [MT8195_AFE_IRQ_25
] = {
2487 .id
= MT8195_AFE_IRQ_25
,
2488 .irq_cnt_reg
= ASYS_IRQ13_CON
,
2490 .irq_cnt_maskbit
= 0xffffff,
2491 .irq_fs_reg
= ASYS_IRQ13_CON
,
2493 .irq_fs_maskbit
= 0x1ffff,
2494 .irq_en_reg
= ASYS_IRQ13_CON
,
2496 .irq_clr_reg
= ASYS_IRQ_CLR
,
2497 .irq_clr_shift
= 12,
2498 .irq_status_shift
= 12,
2500 [MT8195_AFE_IRQ_26
] = {
2501 .id
= MT8195_AFE_IRQ_26
,
2502 .irq_cnt_reg
= ASYS_IRQ14_CON
,
2504 .irq_cnt_maskbit
= 0xffffff,
2505 .irq_fs_reg
= ASYS_IRQ14_CON
,
2507 .irq_fs_maskbit
= 0x1ffff,
2508 .irq_en_reg
= ASYS_IRQ14_CON
,
2510 .irq_clr_reg
= ASYS_IRQ_CLR
,
2511 .irq_clr_shift
= 13,
2512 .irq_status_shift
= 13,
2514 [MT8195_AFE_IRQ_27
] = {
2515 .id
= MT8195_AFE_IRQ_27
,
2516 .irq_cnt_reg
= ASYS_IRQ15_CON
,
2518 .irq_cnt_maskbit
= 0xffffff,
2519 .irq_fs_reg
= ASYS_IRQ15_CON
,
2521 .irq_fs_maskbit
= 0x1ffff,
2522 .irq_en_reg
= ASYS_IRQ15_CON
,
2524 .irq_clr_reg
= ASYS_IRQ_CLR
,
2525 .irq_clr_shift
= 14,
2526 .irq_status_shift
= 14,
2528 [MT8195_AFE_IRQ_28
] = {
2529 .id
= MT8195_AFE_IRQ_28
,
2530 .irq_cnt_reg
= ASYS_IRQ16_CON
,
2532 .irq_cnt_maskbit
= 0xffffff,
2533 .irq_fs_reg
= ASYS_IRQ16_CON
,
2535 .irq_fs_maskbit
= 0x1ffff,
2536 .irq_en_reg
= ASYS_IRQ16_CON
,
2538 .irq_clr_reg
= ASYS_IRQ_CLR
,
2539 .irq_clr_shift
= 15,
2540 .irq_status_shift
= 15,
2544 static const int mt8195_afe_memif_const_irqs
[MT8195_AFE_MEMIF_NUM
] = {
2545 [MT8195_AFE_MEMIF_DL2
] = MT8195_AFE_IRQ_13
,
2546 [MT8195_AFE_MEMIF_DL3
] = MT8195_AFE_IRQ_14
,
2547 [MT8195_AFE_MEMIF_DL6
] = MT8195_AFE_IRQ_15
,
2548 [MT8195_AFE_MEMIF_DL7
] = MT8195_AFE_IRQ_1
,
2549 [MT8195_AFE_MEMIF_DL8
] = MT8195_AFE_IRQ_16
,
2550 [MT8195_AFE_MEMIF_DL10
] = MT8195_AFE_IRQ_17
,
2551 [MT8195_AFE_MEMIF_DL11
] = MT8195_AFE_IRQ_18
,
2552 [MT8195_AFE_MEMIF_UL1
] = MT8195_AFE_IRQ_3
,
2553 [MT8195_AFE_MEMIF_UL2
] = MT8195_AFE_IRQ_19
,
2554 [MT8195_AFE_MEMIF_UL3
] = MT8195_AFE_IRQ_20
,
2555 [MT8195_AFE_MEMIF_UL4
] = MT8195_AFE_IRQ_21
,
2556 [MT8195_AFE_MEMIF_UL5
] = MT8195_AFE_IRQ_22
,
2557 [MT8195_AFE_MEMIF_UL6
] = MT8195_AFE_IRQ_9
,
2558 [MT8195_AFE_MEMIF_UL8
] = MT8195_AFE_IRQ_23
,
2559 [MT8195_AFE_MEMIF_UL9
] = MT8195_AFE_IRQ_24
,
2560 [MT8195_AFE_MEMIF_UL10
] = MT8195_AFE_IRQ_25
,
2563 static bool mt8195_is_volatile_reg(struct device
*dev
, unsigned int reg
)
2565 /* these auto-gen reg has read-only bit, so put it as volatile */
2566 /* volatile reg cannot be cached, so cannot be set when power off */
2568 case AUDIO_TOP_CON0
:
2569 case AUDIO_TOP_CON1
:
2570 case AUDIO_TOP_CON3
:
2571 case AUDIO_TOP_CON4
:
2572 case AUDIO_TOP_CON5
:
2573 case AUDIO_TOP_CON6
:
2575 case ASYS_IRQ_STATUS
:
2578 case AFE_IRQ_MCU_CLR
:
2579 case AFE_IRQ_STATUS
:
2580 case AFE_IRQ3_CON_MON
:
2581 case AFE_IRQ_MCU_MON2
:
2582 case ADSP_IRQ_STATUS
:
2583 case AUDIO_TOP_STA0
:
2584 case AUDIO_TOP_STA1
:
2587 case AFE_IEC_BURST_INFO
:
2588 case AFE_IEC_CHL_STAT0
:
2589 case AFE_IEC_CHL_STAT1
:
2590 case AFE_IEC_CHR_STAT0
:
2591 case AFE_IEC_CHR_STAT1
:
2592 case AFE_SPDIFIN_CHSTS1
:
2593 case AFE_SPDIFIN_CHSTS2
:
2594 case AFE_SPDIFIN_CHSTS3
:
2595 case AFE_SPDIFIN_CHSTS4
:
2596 case AFE_SPDIFIN_CHSTS5
:
2597 case AFE_SPDIFIN_CHSTS6
:
2598 case AFE_SPDIFIN_DEBUG1
:
2599 case AFE_SPDIFIN_DEBUG2
:
2600 case AFE_SPDIFIN_DEBUG3
:
2601 case AFE_SPDIFIN_DEBUG4
:
2602 case AFE_SPDIFIN_EC
:
2603 case AFE_SPDIFIN_CKLOCK_CFG
:
2604 case AFE_SPDIFIN_BR_DBG1
:
2605 case AFE_SPDIFIN_CKFBDIV
:
2606 case AFE_SPDIFIN_INT_EXT
:
2607 case AFE_SPDIFIN_INT_EXT2
:
2608 case SPDIFIN_FREQ_STATUS
:
2609 case SPDIFIN_USERCODE1
:
2610 case SPDIFIN_USERCODE2
:
2611 case SPDIFIN_USERCODE3
:
2612 case SPDIFIN_USERCODE4
:
2613 case SPDIFIN_USERCODE5
:
2614 case SPDIFIN_USERCODE6
:
2615 case SPDIFIN_USERCODE7
:
2616 case SPDIFIN_USERCODE8
:
2617 case SPDIFIN_USERCODE9
:
2618 case SPDIFIN_USERCODE10
:
2619 case SPDIFIN_USERCODE11
:
2620 case SPDIFIN_USERCODE12
:
2621 case AFE_LINEIN_APLL_TUNER_MON
:
2622 case AFE_EARC_APLL_TUNER_MON
:
2626 case AFE_MPHONE_MULTI_DET_MON0
:
2627 case AFE_MPHONE_MULTI_DET_MON1
:
2628 case AFE_MPHONE_MULTI_DET_MON2
:
2629 case AFE_MPHONE_MULTI2_DET_MON0
:
2630 case AFE_MPHONE_MULTI2_DET_MON1
:
2631 case AFE_MPHONE_MULTI2_DET_MON2
:
2632 case AFE_ADDA_MTKAIF_MON0
:
2633 case AFE_ADDA_MTKAIF_MON1
:
2634 case AFE_AUD_PAD_TOP
:
2635 case AFE_ADDA6_MTKAIF_MON0
:
2636 case AFE_ADDA6_MTKAIF_MON1
:
2637 case AFE_ADDA6_SRC_DEBUG_MON0
:
2638 case AFE_ADDA6_UL_SRC_MON0
:
2639 case AFE_ADDA6_UL_SRC_MON1
:
2640 case AFE_ASRC11_NEW_CON8
:
2641 case AFE_ASRC11_NEW_CON9
:
2642 case AFE_ASRC12_NEW_CON8
:
2643 case AFE_ASRC12_NEW_CON9
:
2662 case AFE_DL8_CHK_SUM1
:
2663 case AFE_DL8_CHK_SUM2
:
2664 case AFE_DL8_CHK_SUM3
:
2665 case AFE_DL8_CHK_SUM4
:
2666 case AFE_DL8_CHK_SUM5
:
2667 case AFE_DL8_CHK_SUM6
:
2668 case AFE_DL10_CHK_SUM1
:
2669 case AFE_DL10_CHK_SUM2
:
2670 case AFE_DL10_CHK_SUM3
:
2671 case AFE_DL10_CHK_SUM4
:
2672 case AFE_DL10_CHK_SUM5
:
2673 case AFE_DL10_CHK_SUM6
:
2674 case AFE_DL11_CHK_SUM1
:
2675 case AFE_DL11_CHK_SUM2
:
2676 case AFE_DL11_CHK_SUM3
:
2677 case AFE_DL11_CHK_SUM4
:
2678 case AFE_DL11_CHK_SUM5
:
2679 case AFE_DL11_CHK_SUM6
:
2680 case AFE_UL1_CHK_SUM1
:
2681 case AFE_UL1_CHK_SUM2
:
2682 case AFE_UL2_CHK_SUM1
:
2683 case AFE_UL2_CHK_SUM2
:
2684 case AFE_UL3_CHK_SUM1
:
2685 case AFE_UL3_CHK_SUM2
:
2686 case AFE_UL4_CHK_SUM1
:
2687 case AFE_UL4_CHK_SUM2
:
2688 case AFE_UL5_CHK_SUM1
:
2689 case AFE_UL5_CHK_SUM2
:
2690 case AFE_UL6_CHK_SUM1
:
2691 case AFE_UL6_CHK_SUM2
:
2692 case AFE_UL8_CHK_SUM1
:
2693 case AFE_UL8_CHK_SUM2
:
2694 case AFE_DL2_CHK_SUM1
:
2695 case AFE_DL2_CHK_SUM2
:
2696 case AFE_DL3_CHK_SUM1
:
2697 case AFE_DL3_CHK_SUM2
:
2698 case AFE_DL6_CHK_SUM1
:
2699 case AFE_DL6_CHK_SUM2
:
2700 case AFE_DL7_CHK_SUM1
:
2701 case AFE_DL7_CHK_SUM2
:
2702 case AFE_UL9_CHK_SUM1
:
2703 case AFE_UL9_CHK_SUM2
:
2705 case UL1_MOD2AGT_CNT_LAT
:
2706 case UL2_MOD2AGT_CNT_LAT
:
2707 case UL3_MOD2AGT_CNT_LAT
:
2708 case UL4_MOD2AGT_CNT_LAT
:
2709 case UL5_MOD2AGT_CNT_LAT
:
2710 case UL6_MOD2AGT_CNT_LAT
:
2711 case UL8_MOD2AGT_CNT_LAT
:
2712 case UL9_MOD2AGT_CNT_LAT
:
2713 case UL10_MOD2AGT_CNT_LAT
:
2714 case AFE_MEMIF_BUF_FULL_MON
:
2715 case AFE_MEMIF_BUF_MON1
:
2716 case AFE_MEMIF_BUF_MON3
:
2717 case AFE_MEMIF_BUF_MON4
:
2718 case AFE_MEMIF_BUF_MON5
:
2719 case AFE_MEMIF_BUF_MON6
:
2720 case AFE_MEMIF_BUF_MON7
:
2721 case AFE_MEMIF_BUF_MON8
:
2722 case AFE_MEMIF_BUF_MON9
:
2723 case AFE_MEMIF_BUF_MON10
:
2724 case DL2_AGENT2MODULE_CNT
:
2725 case DL3_AGENT2MODULE_CNT
:
2726 case DL6_AGENT2MODULE_CNT
:
2727 case DL7_AGENT2MODULE_CNT
:
2728 case DL8_AGENT2MODULE_CNT
:
2729 case DL10_AGENT2MODULE_CNT
:
2730 case DL11_AGENT2MODULE_CNT
:
2731 case UL1_MODULE2AGENT_CNT
:
2732 case UL2_MODULE2AGENT_CNT
:
2733 case UL3_MODULE2AGENT_CNT
:
2734 case UL4_MODULE2AGENT_CNT
:
2735 case UL5_MODULE2AGENT_CNT
:
2736 case UL6_MODULE2AGENT_CNT
:
2737 case UL8_MODULE2AGENT_CNT
:
2738 case UL9_MODULE2AGENT_CNT
:
2739 case UL10_MODULE2AGENT_CNT
:
2740 case AFE_DMIC0_SRC_DEBUG_MON0
:
2741 case AFE_DMIC0_UL_SRC_MON0
:
2742 case AFE_DMIC0_UL_SRC_MON1
:
2743 case AFE_DMIC1_SRC_DEBUG_MON0
:
2744 case AFE_DMIC1_UL_SRC_MON0
:
2745 case AFE_DMIC1_UL_SRC_MON1
:
2746 case AFE_DMIC2_SRC_DEBUG_MON0
:
2747 case AFE_DMIC2_UL_SRC_MON0
:
2748 case AFE_DMIC2_UL_SRC_MON1
:
2749 case AFE_DMIC3_SRC_DEBUG_MON0
:
2750 case AFE_DMIC3_UL_SRC_MON0
:
2751 case AFE_DMIC3_UL_SRC_MON1
:
2752 case DMIC_GAIN1_CUR
:
2753 case DMIC_GAIN2_CUR
:
2754 case DMIC_GAIN3_CUR
:
2755 case DMIC_GAIN4_CUR
:
2756 case ETDM_IN1_MONITOR
:
2757 case ETDM_IN2_MONITOR
:
2758 case ETDM_OUT1_MONITOR
:
2759 case ETDM_OUT2_MONITOR
:
2760 case ETDM_OUT3_MONITOR
:
2761 case AFE_ADDA_SRC_DEBUG_MON0
:
2762 case AFE_ADDA_SRC_DEBUG_MON1
:
2763 case AFE_ADDA_DL_SDM_FIFO_MON
:
2764 case AFE_ADDA_DL_SRC_LCH_MON
:
2765 case AFE_ADDA_DL_SRC_RCH_MON
:
2766 case AFE_ADDA_DL_SDM_OUT_MON
:
2767 case AFE_GASRC0_NEW_CON8
:
2768 case AFE_GASRC0_NEW_CON9
:
2769 case AFE_GASRC0_NEW_CON12
:
2770 case AFE_GASRC1_NEW_CON8
:
2771 case AFE_GASRC1_NEW_CON9
:
2772 case AFE_GASRC1_NEW_CON12
:
2773 case AFE_GASRC2_NEW_CON8
:
2774 case AFE_GASRC2_NEW_CON9
:
2775 case AFE_GASRC2_NEW_CON12
:
2776 case AFE_GASRC3_NEW_CON8
:
2777 case AFE_GASRC3_NEW_CON9
:
2778 case AFE_GASRC3_NEW_CON12
:
2779 case AFE_GASRC4_NEW_CON8
:
2780 case AFE_GASRC4_NEW_CON9
:
2781 case AFE_GASRC4_NEW_CON12
:
2782 case AFE_GASRC5_NEW_CON8
:
2783 case AFE_GASRC5_NEW_CON9
:
2784 case AFE_GASRC5_NEW_CON12
:
2785 case AFE_GASRC6_NEW_CON8
:
2786 case AFE_GASRC6_NEW_CON9
:
2787 case AFE_GASRC6_NEW_CON12
:
2788 case AFE_GASRC7_NEW_CON8
:
2789 case AFE_GASRC7_NEW_CON9
:
2790 case AFE_GASRC7_NEW_CON12
:
2791 case AFE_GASRC8_NEW_CON8
:
2792 case AFE_GASRC8_NEW_CON9
:
2793 case AFE_GASRC8_NEW_CON12
:
2794 case AFE_GASRC9_NEW_CON8
:
2795 case AFE_GASRC9_NEW_CON9
:
2796 case AFE_GASRC9_NEW_CON12
:
2797 case AFE_GASRC10_NEW_CON8
:
2798 case AFE_GASRC10_NEW_CON9
:
2799 case AFE_GASRC10_NEW_CON12
:
2800 case AFE_GASRC11_NEW_CON8
:
2801 case AFE_GASRC11_NEW_CON9
:
2802 case AFE_GASRC11_NEW_CON12
:
2803 case AFE_GASRC12_NEW_CON8
:
2804 case AFE_GASRC12_NEW_CON9
:
2805 case AFE_GASRC12_NEW_CON12
:
2806 case AFE_GASRC13_NEW_CON8
:
2807 case AFE_GASRC13_NEW_CON9
:
2808 case AFE_GASRC13_NEW_CON12
:
2809 case AFE_GASRC14_NEW_CON8
:
2810 case AFE_GASRC14_NEW_CON9
:
2811 case AFE_GASRC14_NEW_CON12
:
2812 case AFE_GASRC15_NEW_CON8
:
2813 case AFE_GASRC15_NEW_CON9
:
2814 case AFE_GASRC15_NEW_CON12
:
2815 case AFE_GASRC16_NEW_CON8
:
2816 case AFE_GASRC16_NEW_CON9
:
2817 case AFE_GASRC16_NEW_CON12
:
2818 case AFE_GASRC17_NEW_CON8
:
2819 case AFE_GASRC17_NEW_CON9
:
2820 case AFE_GASRC17_NEW_CON12
:
2821 case AFE_GASRC18_NEW_CON8
:
2822 case AFE_GASRC18_NEW_CON9
:
2823 case AFE_GASRC18_NEW_CON12
:
2824 case AFE_GASRC19_NEW_CON8
:
2825 case AFE_GASRC19_NEW_CON9
:
2826 case AFE_GASRC19_NEW_CON12
:
2833 static const struct regmap_config mt8195_afe_regmap_config
= {
2837 .volatile_reg
= mt8195_is_volatile_reg
,
2838 .max_register
= AFE_MAX_REGISTER
,
2839 .num_reg_defaults_raw
= ((AFE_MAX_REGISTER
/ 4) + 1),
2840 .cache_type
= REGCACHE_FLAT
,
2843 #define AFE_IRQ_CLR_BITS (0x387)
2844 #define ASYS_IRQ_CLR_BITS (0xffff)
2846 static irqreturn_t
mt8195_afe_irq_handler(int irq_id
, void *dev_id
)
2848 struct mtk_base_afe
*afe
= dev_id
;
2849 unsigned int val
= 0;
2850 unsigned int asys_irq_clr_bits
= 0;
2851 unsigned int afe_irq_clr_bits
= 0;
2852 unsigned int irq_status_bits
= 0;
2853 unsigned int irq_clr_bits
= 0;
2854 unsigned int mcu_irq_mask
= 0;
2858 ret
= regmap_read(afe
->regmap
, AFE_IRQ_STATUS
, &val
);
2860 dev_info(afe
->dev
, "%s irq status err\n", __func__
);
2861 afe_irq_clr_bits
= AFE_IRQ_CLR_BITS
;
2862 asys_irq_clr_bits
= ASYS_IRQ_CLR_BITS
;
2866 ret
= regmap_read(afe
->regmap
, AFE_IRQ_MASK
, &mcu_irq_mask
);
2868 dev_info(afe
->dev
, "%s read irq mask err\n", __func__
);
2869 afe_irq_clr_bits
= AFE_IRQ_CLR_BITS
;
2870 asys_irq_clr_bits
= ASYS_IRQ_CLR_BITS
;
2874 /* only clr cpu irq */
2875 val
&= mcu_irq_mask
;
2877 for (i
= 0; i
< MT8195_AFE_MEMIF_NUM
; i
++) {
2878 struct mtk_base_afe_memif
*memif
= &afe
->memif
[i
];
2879 struct mtk_base_irq_data
const *irq_data
;
2881 if (memif
->irq_usage
< 0)
2884 irq_data
= afe
->irqs
[memif
->irq_usage
].irq_data
;
2886 irq_status_bits
= BIT(irq_data
->irq_status_shift
);
2887 irq_clr_bits
= BIT(irq_data
->irq_clr_shift
);
2889 if (!(val
& irq_status_bits
))
2892 if (irq_data
->irq_clr_reg
== ASYS_IRQ_CLR
)
2893 asys_irq_clr_bits
|= irq_clr_bits
;
2895 afe_irq_clr_bits
|= irq_clr_bits
;
2897 snd_pcm_period_elapsed(memif
->substream
);
2902 if (asys_irq_clr_bits
)
2903 regmap_write(afe
->regmap
, ASYS_IRQ_CLR
, asys_irq_clr_bits
);
2904 if (afe_irq_clr_bits
)
2905 regmap_write(afe
->regmap
, AFE_IRQ_MCU_CLR
, afe_irq_clr_bits
);
2910 static int mt8195_afe_runtime_suspend(struct device
*dev
)
2912 struct mtk_base_afe
*afe
= dev_get_drvdata(dev
);
2913 struct mt8195_afe_private
*afe_priv
= afe
->platform_priv
;
2915 if (!afe
->regmap
|| afe_priv
->pm_runtime_bypass_reg_ctl
)
2918 mt8195_afe_disable_main_clock(afe
);
2920 regcache_cache_only(afe
->regmap
, true);
2921 regcache_mark_dirty(afe
->regmap
);
2924 mt8195_afe_disable_reg_rw_clk(afe
);
2929 static int mt8195_afe_runtime_resume(struct device
*dev
)
2931 struct mtk_base_afe
*afe
= dev_get_drvdata(dev
);
2932 struct mt8195_afe_private
*afe_priv
= afe
->platform_priv
;
2934 mt8195_afe_enable_reg_rw_clk(afe
);
2936 if (!afe
->regmap
|| afe_priv
->pm_runtime_bypass_reg_ctl
)
2939 regcache_cache_only(afe
->regmap
, false);
2940 regcache_sync(afe
->regmap
);
2942 mt8195_afe_enable_main_clock(afe
);
2947 static int init_memif_priv_data(struct mtk_base_afe
*afe
)
2949 struct mt8195_afe_private
*afe_priv
= afe
->platform_priv
;
2950 struct mtk_dai_memif_priv
*memif_priv
;
2953 for (i
= MT8195_AFE_MEMIF_START
; i
< MT8195_AFE_MEMIF_END
; i
++) {
2954 memif_priv
= devm_kzalloc(afe
->dev
,
2955 sizeof(struct mtk_dai_memif_priv
),
2960 afe_priv
->dai_priv
[i
] = memif_priv
;
2966 static int mt8195_dai_memif_register(struct mtk_base_afe
*afe
)
2968 struct mtk_base_afe_dai
*dai
;
2970 dai
= devm_kzalloc(afe
->dev
, sizeof(*dai
), GFP_KERNEL
);
2974 list_add(&dai
->list
, &afe
->sub_dais
);
2976 dai
->dai_drivers
= mt8195_memif_dai_driver
;
2977 dai
->num_dai_drivers
= ARRAY_SIZE(mt8195_memif_dai_driver
);
2979 dai
->dapm_widgets
= mt8195_memif_widgets
;
2980 dai
->num_dapm_widgets
= ARRAY_SIZE(mt8195_memif_widgets
);
2981 dai
->dapm_routes
= mt8195_memif_routes
;
2982 dai
->num_dapm_routes
= ARRAY_SIZE(mt8195_memif_routes
);
2983 dai
->controls
= mt8195_memif_controls
;
2984 dai
->num_controls
= ARRAY_SIZE(mt8195_memif_controls
);
2986 return init_memif_priv_data(afe
);
2989 typedef int (*dai_register_cb
)(struct mtk_base_afe
*);
2990 static const dai_register_cb dai_register_cbs
[] = {
2991 mt8195_dai_adda_register
,
2992 mt8195_dai_etdm_register
,
2993 mt8195_dai_pcm_register
,
2994 mt8195_dai_memif_register
,
2997 static const struct reg_sequence mt8195_afe_reg_defaults
[] = {
2998 { AFE_IRQ_MASK
, 0x387ffff },
2999 { AFE_IRQ3_CON
, BIT(30) },
3000 { AFE_IRQ9_CON
, BIT(30) },
3001 { ETDM_IN1_CON4
, 0x12000100 },
3002 { ETDM_IN2_CON4
, 0x12000100 },
3005 static const struct reg_sequence mt8195_cg_patch
[] = {
3006 { AUDIO_TOP_CON0
, 0xfffffffb },
3007 { AUDIO_TOP_CON1
, 0xfffffff8 },
3010 static int mt8195_afe_pcm_dev_probe(struct platform_device
*pdev
)
3012 struct mtk_base_afe
*afe
;
3013 struct mt8195_afe_private
*afe_priv
;
3014 struct device
*dev
= &pdev
->dev
;
3015 struct reset_control
*rstc
;
3018 ret
= of_reserved_mem_device_init(dev
);
3020 return dev_err_probe(dev
, ret
, "failed to assign memory region\n");
3022 ret
= dma_set_mask_and_coherent(dev
, DMA_BIT_MASK(33));
3026 afe
= devm_kzalloc(dev
, sizeof(*afe
), GFP_KERNEL
);
3030 afe
->platform_priv
= devm_kzalloc(dev
, sizeof(*afe_priv
),
3032 if (!afe
->platform_priv
)
3035 afe_priv
= afe
->platform_priv
;
3036 afe
->dev
= &pdev
->dev
;
3038 afe
->base_addr
= devm_platform_ioremap_resource(pdev
, 0);
3039 if (IS_ERR(afe
->base_addr
))
3040 return PTR_ERR(afe
->base_addr
);
3042 /* initial audio related clock */
3043 ret
= mt8195_afe_init_clock(afe
);
3045 return dev_err_probe(dev
, ret
, "init clock error\n");
3047 /* reset controller to reset audio regs before regmap cache */
3048 rstc
= devm_reset_control_get_exclusive(dev
, "audiosys");
3050 return dev_err_probe(dev
, PTR_ERR(rstc
), "could not get audiosys reset\n");
3052 ret
= reset_control_reset(rstc
);
3054 return dev_err_probe(dev
, ret
, "failed to trigger audio reset\n");
3056 spin_lock_init(&afe_priv
->afe_ctrl_lock
);
3058 mutex_init(&afe
->irq_alloc_lock
);
3060 /* irq initialize */
3061 afe
->irqs_size
= MT8195_AFE_IRQ_NUM
;
3062 afe
->irqs
= devm_kcalloc(dev
, afe
->irqs_size
, sizeof(*afe
->irqs
),
3067 for (i
= 0; i
< afe
->irqs_size
; i
++)
3068 afe
->irqs
[i
].irq_data
= &irq_data_array
[i
];
3071 afe
->memif_size
= MT8195_AFE_MEMIF_NUM
;
3072 afe
->memif
= devm_kcalloc(dev
, afe
->memif_size
, sizeof(*afe
->memif
),
3077 for (i
= 0; i
< afe
->memif_size
; i
++) {
3078 afe
->memif
[i
].data
= &memif_data
[i
];
3079 afe
->memif
[i
].irq_usage
= mt8195_afe_memif_const_irqs
[i
];
3080 afe
->memif
[i
].const_irq
= 1;
3081 afe
->irqs
[afe
->memif
[i
].irq_usage
].irq_occupyed
= true;
3085 irq_id
= platform_get_irq(pdev
, 0);
3089 ret
= devm_request_irq(dev
, irq_id
, mt8195_afe_irq_handler
,
3090 IRQF_TRIGGER_NONE
, "asys-isr", (void *)afe
);
3092 return dev_err_probe(dev
, ret
, "could not request_irq for asys-isr\n");
3095 INIT_LIST_HEAD(&afe
->sub_dais
);
3097 for (i
= 0; i
< ARRAY_SIZE(dai_register_cbs
); i
++) {
3098 ret
= dai_register_cbs
[i
](afe
);
3100 return dev_err_probe(dev
, ret
, "dai cb%i register fail\n", i
);
3103 /* init dai_driver and component_driver */
3104 ret
= mtk_afe_combine_sub_dai(afe
);
3106 return dev_err_probe(dev
, ret
, "mtk_afe_combine_sub_dai fail\n");
3108 afe
->mtk_afe_hardware
= &mt8195_afe_hardware
;
3109 afe
->memif_fs
= mt8195_memif_fs
;
3110 afe
->irq_fs
= mt8195_irq_fs
;
3112 afe
->runtime_resume
= mt8195_afe_runtime_resume
;
3113 afe
->runtime_suspend
= mt8195_afe_runtime_suspend
;
3115 platform_set_drvdata(pdev
, afe
);
3117 afe_priv
->topckgen
= syscon_regmap_lookup_by_phandle(dev
->of_node
, "mediatek,topckgen");
3118 if (IS_ERR(afe_priv
->topckgen
))
3119 dev_dbg(afe
->dev
, "Cannot find topckgen controller: %ld\n",
3120 PTR_ERR(afe_priv
->topckgen
));
3122 /* enable clock for regcache get default value from hw */
3123 afe_priv
->pm_runtime_bypass_reg_ctl
= true;
3125 ret
= devm_pm_runtime_enable(dev
);
3129 ret
= pm_runtime_resume_and_get(dev
);
3131 return dev_err_probe(dev
, ret
, "Failed to resume device\n");
3133 afe
->regmap
= devm_regmap_init_mmio(&pdev
->dev
, afe
->base_addr
,
3134 &mt8195_afe_regmap_config
);
3135 if (IS_ERR(afe
->regmap
)) {
3136 ret
= PTR_ERR(afe
->regmap
);
3140 ret
= regmap_register_patch(afe
->regmap
, mt8195_cg_patch
,
3141 ARRAY_SIZE(mt8195_cg_patch
));
3143 dev_err(dev
, "Failed to apply cg patch\n");
3147 /* register component */
3148 ret
= devm_snd_soc_register_component(dev
, &mtk_afe_pcm_platform
,
3149 afe
->dai_drivers
, afe
->num_dai_drivers
);
3151 dev_warn(dev
, "err_platform\n");
3155 ret
= regmap_multi_reg_write(afe
->regmap
, mt8195_afe_reg_defaults
,
3156 ARRAY_SIZE(mt8195_afe_reg_defaults
));
3160 ret
= pm_runtime_put_sync(dev
);
3162 return dev_err_probe(dev
, ret
, "Failed to suspend device\n");
3164 afe_priv
->pm_runtime_bypass_reg_ctl
= false;
3166 regcache_cache_only(afe
->regmap
, true);
3167 regcache_mark_dirty(afe
->regmap
);
3172 pm_runtime_put_sync(dev
);
3177 static void mt8195_afe_pcm_dev_remove(struct platform_device
*pdev
)
3179 pm_runtime_disable(&pdev
->dev
);
3180 if (!pm_runtime_status_suspended(&pdev
->dev
))
3181 mt8195_afe_runtime_suspend(&pdev
->dev
);
3184 static const struct of_device_id mt8195_afe_pcm_dt_match
[] = {
3185 {.compatible
= "mediatek,mt8195-audio", },
3188 MODULE_DEVICE_TABLE(of
, mt8195_afe_pcm_dt_match
);
3190 static const struct dev_pm_ops mt8195_afe_pm_ops
= {
3191 SET_RUNTIME_PM_OPS(mt8195_afe_runtime_suspend
,
3192 mt8195_afe_runtime_resume
, NULL
)
3195 static struct platform_driver mt8195_afe_pcm_driver
= {
3197 .name
= "mt8195-audio",
3198 .of_match_table
= mt8195_afe_pcm_dt_match
,
3199 .pm
= &mt8195_afe_pm_ops
,
3201 .probe
= mt8195_afe_pcm_dev_probe
,
3202 .remove
= mt8195_afe_pcm_dev_remove
,
3205 module_platform_driver(mt8195_afe_pcm_driver
);
3207 MODULE_DESCRIPTION("Mediatek ALSA SoC AFE platform driver for 8195");
3208 MODULE_AUTHOR("Bicycle Tsai <bicycle.tsai@mediatek.com>");
3209 MODULE_LICENSE("GPL v2");