hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/sound/soc/codecs/rk817_codec.c
....@@ -422,7 +422,7 @@
422422 }
423423
424424 snd_soc_component_update_bits(component, RK817_CODEC_DTOP_DIGEN_CLKE,
425
- ADC_DIG_CLK_MASK, DAC_DIG_CLK_DIS);
425
+ ADC_DIG_CLK_MASK, ADC_DIG_CLK_DIS);
426426 usleep_range(2000, 2500);
427427 snd_soc_component_update_bits(component, RK817_CODEC_DTOP_DIGEN_CLKE,
428428 ADC_DIG_CLK_MASK, ADC_DIG_CLK_EN);
....@@ -1034,7 +1034,7 @@
10341034 return 0;
10351035 }
10361036
1037
-static int rk817_digital_mute(struct snd_soc_dai *dai, int mute, int stream)
1037
+static int rk817_digital_mute_dac(struct snd_soc_dai *dai, int mute, int stream)
10381038 {
10391039 struct snd_soc_component *component = dai->component;
10401040 struct rk817_codec_priv *rk817 = snd_soc_component_get_drvdata(component);
....@@ -1056,7 +1056,11 @@
10561056 DAC_DIG_CLK_EN, DAC_DIG_CLK_DIS);
10571057 snd_soc_component_update_bits(component, RK817_CODEC_DTOP_DIGEN_CLKE,
10581058 DAC_DIG_CLK_EN, DAC_DIG_CLK_EN);
1059
+ snd_soc_component_update_bits(component, RK817_CODEC_DTOP_DIGEN_CLKE,
1060
+ I2SRX_EN_MASK, I2SRX_DIS);
10591061 } else {
1062
+ snd_soc_component_update_bits(component, RK817_CODEC_DTOP_DIGEN_CLKE,
1063
+ I2SRX_EN_MASK, I2SRX_EN);
10601064 snd_soc_component_update_bits(component,
10611065 RK817_CODEC_DDAC_MUTE_MIXCTL,
10621066 DACMT_ENABLE, DACMT_DISABLE);
....@@ -1106,6 +1110,28 @@
11061110 return 0;
11071111 }
11081112
1113
+static int rk817_digital_mute_adc(struct snd_soc_dai *dai, int mute, int stream)
1114
+{
1115
+ struct snd_soc_component *component = dai->component;
1116
+
1117
+ if (mute)
1118
+ snd_soc_component_update_bits(component, RK817_CODEC_DTOP_DIGEN_CLKE,
1119
+ I2STX_EN_MASK, I2STX_DIS);
1120
+ else
1121
+ snd_soc_component_update_bits(component, RK817_CODEC_DTOP_DIGEN_CLKE,
1122
+ I2STX_EN_MASK, I2STX_EN);
1123
+
1124
+ return 0;
1125
+}
1126
+
1127
+static int rk817_digital_mute(struct snd_soc_dai *dai, int mute, int stream)
1128
+{
1129
+ if (stream == SNDRV_PCM_STREAM_PLAYBACK)
1130
+ return rk817_digital_mute_dac(dai, mute, stream);
1131
+ else
1132
+ return rk817_digital_mute_adc(dai, mute, stream);
1133
+}
1134
+
11091135 #define RK817_PLAYBACK_RATES (SNDRV_PCM_RATE_8000 |\
11101136 SNDRV_PCM_RATE_16000 | \
11111137 SNDRV_PCM_RATE_32000 | \
....@@ -1150,7 +1176,6 @@
11501176 .set_sysclk = rk817_set_dai_sysclk,
11511177 .mute_stream = rk817_digital_mute,
11521178 .shutdown = rk817_codec_shutdown,
1153
- .no_capture_mute = 1,
11541179 };
11551180
11561181 static struct snd_soc_dai_driver rk817_dai[] = {