forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 1f93a7dfd1f8d5ff7a5c53246c7534fe2332d6f4
kernel/sound/soc/codecs/tlv320aic26.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Texas Instruments TLV320AIC26 low power audio CODEC
34 * ALSA SoC CODEC driver
....@@ -130,10 +131,10 @@
130131 return 0;
131132 }
132133
133
-/**
134
+/*
134135 * aic26_mute - Mute control to reduce noise when changing audio format
135136 */
136
-static int aic26_mute(struct snd_soc_dai *dai, int mute)
137
+static int aic26_mute(struct snd_soc_dai *dai, int mute, int direction)
137138 {
138139 struct snd_soc_component *component = dai->component;
139140 struct aic26 *aic26 = snd_soc_component_get_drvdata(component);
....@@ -210,9 +211,10 @@
210211
211212 static const struct snd_soc_dai_ops aic26_dai_ops = {
212213 .hw_params = aic26_hw_params,
213
- .digital_mute = aic26_mute,
214
+ .mute_stream = aic26_mute,
214215 .set_sysclk = aic26_set_sysclk,
215216 .set_fmt = aic26_set_fmt,
217
+ .no_capture_mute = 1,
216218 };
217219
218220 static struct snd_soc_dai_driver aic26_dai = {
....@@ -265,7 +267,7 @@
265267 struct aic26 *aic26 = dev_get_drvdata(dev);
266268 int val, amp, freq, len;
267269
268
- val = snd_soc_component_read32(aic26->component, AIC26_REG_AUDIO_CTRL2);
270
+ val = snd_soc_component_read(aic26->component, AIC26_REG_AUDIO_CTRL2);
269271 amp = (val >> 12) & 0x7;
270272 freq = (125 << ((val >> 8) & 0x7)) >> 1;
271273 len = 2 * (1 + ((val >> 4) & 0xf));
....@@ -305,7 +307,7 @@
305307 snd_soc_component_write(component, AIC26_REG_POWER_CTRL, 0);
306308
307309 /* Audio Control 3 (master mode, fsref rate) */
308
- reg = snd_soc_component_read32(component, AIC26_REG_AUDIO_CTRL3);
310
+ reg = snd_soc_component_read(component, AIC26_REG_AUDIO_CTRL3);
309311 reg &= ~0xf800;
310312 reg |= 0x0800; /* set master mode */
311313 snd_soc_component_write(component, AIC26_REG_AUDIO_CTRL3, reg);