diff options
| -rw-r--r-- | sound/soc/mediatek/mtk-afe-pcm.c | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/sound/soc/mediatek/mtk-afe-pcm.c b/sound/soc/mediatek/mtk-afe-pcm.c index 5399a0eead3e..08af9f5dc4ab 100644 --- a/sound/soc/mediatek/mtk-afe-pcm.c +++ b/sound/soc/mediatek/mtk-afe-pcm.c | |||
| @@ -382,9 +382,6 @@ static void mtk_afe_i2s_shutdown(struct snd_pcm_substream *substream, | |||
| 382 | AUD_TCON0_PDN_22M | AUD_TCON0_PDN_24M, | 382 | AUD_TCON0_PDN_22M | AUD_TCON0_PDN_24M, |
| 383 | AUD_TCON0_PDN_22M | AUD_TCON0_PDN_24M); | 383 | AUD_TCON0_PDN_22M | AUD_TCON0_PDN_24M); |
| 384 | mtk_afe_dais_disable_clks(afe, afe->clocks[MTK_CLK_I2S1_M], NULL); | 384 | mtk_afe_dais_disable_clks(afe, afe->clocks[MTK_CLK_I2S1_M], NULL); |
| 385 | |||
| 386 | /* disable AFE */ | ||
| 387 | regmap_update_bits(afe->regmap, AFE_DAC_CON0, 0x1, 0); | ||
| 388 | } | 385 | } |
| 389 | 386 | ||
| 390 | static int mtk_afe_i2s_prepare(struct snd_pcm_substream *substream, | 387 | static int mtk_afe_i2s_prepare(struct snd_pcm_substream *substream, |
| @@ -433,9 +430,6 @@ static void mtk_afe_hdmi_shutdown(struct snd_pcm_substream *substream, | |||
| 433 | 430 | ||
| 434 | mtk_afe_dais_disable_clks(afe, afe->clocks[MTK_CLK_I2S3_M], | 431 | mtk_afe_dais_disable_clks(afe, afe->clocks[MTK_CLK_I2S3_M], |
| 435 | afe->clocks[MTK_CLK_I2S3_B]); | 432 | afe->clocks[MTK_CLK_I2S3_B]); |
| 436 | |||
| 437 | /* disable AFE */ | ||
| 438 | regmap_update_bits(afe->regmap, AFE_DAC_CON0, 0x1, 0); | ||
| 439 | } | 433 | } |
| 440 | 434 | ||
| 441 | static int mtk_afe_hdmi_prepare(struct snd_pcm_substream *substream, | 435 | static int mtk_afe_hdmi_prepare(struct snd_pcm_substream *substream, |
| @@ -679,17 +673,6 @@ static int mtk_afe_dais_hw_free(struct snd_pcm_substream *substream, | |||
| 679 | return snd_pcm_lib_free_pages(substream); | 673 | return snd_pcm_lib_free_pages(substream); |
| 680 | } | 674 | } |
| 681 | 675 | ||
| 682 | static int mtk_afe_dais_prepare(struct snd_pcm_substream *substream, | ||
| 683 | struct snd_soc_dai *dai) | ||
| 684 | { | ||
| 685 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | ||
| 686 | struct mtk_afe *afe = snd_soc_platform_get_drvdata(rtd->platform); | ||
| 687 | |||
| 688 | /* enable AFE */ | ||
| 689 | regmap_update_bits(afe->regmap, AFE_DAC_CON0, 0x1, 0x1); | ||
| 690 | return 0; | ||
| 691 | } | ||
| 692 | |||
| 693 | static int mtk_afe_dais_trigger(struct snd_pcm_substream *substream, int cmd, | 676 | static int mtk_afe_dais_trigger(struct snd_pcm_substream *substream, int cmd, |
| 694 | struct snd_soc_dai *dai) | 677 | struct snd_soc_dai *dai) |
| 695 | { | 678 | { |
| @@ -757,7 +740,6 @@ static const struct snd_soc_dai_ops mtk_afe_dai_ops = { | |||
| 757 | .shutdown = mtk_afe_dais_shutdown, | 740 | .shutdown = mtk_afe_dais_shutdown, |
| 758 | .hw_params = mtk_afe_dais_hw_params, | 741 | .hw_params = mtk_afe_dais_hw_params, |
| 759 | .hw_free = mtk_afe_dais_hw_free, | 742 | .hw_free = mtk_afe_dais_hw_free, |
| 760 | .prepare = mtk_afe_dais_prepare, | ||
| 761 | .trigger = mtk_afe_dais_trigger, | 743 | .trigger = mtk_afe_dais_trigger, |
| 762 | }; | 744 | }; |
| 763 | 745 | ||
| @@ -1118,6 +1100,9 @@ static int mtk_afe_runtime_suspend(struct device *dev) | |||
| 1118 | { | 1100 | { |
| 1119 | struct mtk_afe *afe = dev_get_drvdata(dev); | 1101 | struct mtk_afe *afe = dev_get_drvdata(dev); |
| 1120 | 1102 | ||
| 1103 | /* disable AFE */ | ||
| 1104 | regmap_update_bits(afe->regmap, AFE_DAC_CON0, 0x1, 0); | ||
| 1105 | |||
| 1121 | /* disable AFE clk */ | 1106 | /* disable AFE clk */ |
| 1122 | regmap_update_bits(afe->regmap, AUDIO_TOP_CON0, | 1107 | regmap_update_bits(afe->regmap, AUDIO_TOP_CON0, |
| 1123 | AUD_TCON0_PDN_AFE, AUD_TCON0_PDN_AFE); | 1108 | AUD_TCON0_PDN_AFE, AUD_TCON0_PDN_AFE); |
| @@ -1164,6 +1149,9 @@ static int mtk_afe_runtime_resume(struct device *dev) | |||
| 1164 | 1149 | ||
| 1165 | /* unmask all IRQs */ | 1150 | /* unmask all IRQs */ |
| 1166 | regmap_update_bits(afe->regmap, AFE_IRQ_MCU_EN, 0xff, 0xff); | 1151 | regmap_update_bits(afe->regmap, AFE_IRQ_MCU_EN, 0xff, 0xff); |
| 1152 | |||
| 1153 | /* enable AFE */ | ||
| 1154 | regmap_update_bits(afe->regmap, AFE_DAC_CON0, 0x1, 0x1); | ||
| 1167 | return 0; | 1155 | return 0; |
| 1168 | 1156 | ||
| 1169 | err_bck0: | 1157 | err_bck0: |
