forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 1f93a7dfd1f8d5ff7a5c53246c7534fe2332d6f4
kernel/sound/soc/codecs/wm8988.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * wm8988.c -- WM8988 ALSA SoC audio driver
34 *
....@@ -5,10 +6,6 @@
56 * Copyright 2005 Openedhand Ltd.
67 *
78 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
8
- *
9
- * This program is free software; you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License version 2 as
11
- * published by the Free Software Foundation.
129 */
1310
1411 #include <linux/module.h>
....@@ -245,10 +242,10 @@
245242 struct snd_kcontrol *kcontrol, int event)
246243 {
247244 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
248
- u16 adctl2 = snd_soc_component_read32(component, WM8988_ADCTL2);
245
+ u16 adctl2 = snd_soc_component_read(component, WM8988_ADCTL2);
249246
250247 /* Use the DAC to gate LRC if active, otherwise use ADC */
251
- if (snd_soc_component_read32(component, WM8988_PWR2) & 0x180)
248
+ if (snd_soc_component_read(component, WM8988_PWR2) & 0x180)
252249 adctl2 &= ~0x4;
253250 else
254251 adctl2 |= 0x4;
....@@ -276,7 +273,7 @@
276273 wm8988_line_texts,
277274 wm8988_line_values);
278275 static const struct snd_kcontrol_new wm8988_right_line_controls =
279
- SOC_DAPM_ENUM("Route", wm8988_lline_enum);
276
+ SOC_DAPM_ENUM("Route", wm8988_rline_enum);
280277
281278 /* Left Mixer */
282279 static const struct snd_kcontrol_new wm8988_left_mixer_controls[] = {
....@@ -670,8 +667,8 @@
670667 {
671668 struct snd_soc_component *component = dai->component;
672669 struct wm8988_priv *wm8988 = snd_soc_component_get_drvdata(component);
673
- u16 iface = snd_soc_component_read32(component, WM8988_IFACE) & 0x1f3;
674
- u16 srate = snd_soc_component_read32(component, WM8988_SRATE) & 0x180;
670
+ u16 iface = snd_soc_component_read(component, WM8988_IFACE) & 0x1f3;
671
+ u16 srate = snd_soc_component_read(component, WM8988_SRATE) & 0x180;
675672 int coeff;
676673
677674 coeff = get_coeff(wm8988->sysclk, params_rate(params));
....@@ -710,10 +707,10 @@
710707 return 0;
711708 }
712709
713
-static int wm8988_mute(struct snd_soc_dai *dai, int mute)
710
+static int wm8988_mute(struct snd_soc_dai *dai, int mute, int direction)
714711 {
715712 struct snd_soc_component *component = dai->component;
716
- u16 mute_reg = snd_soc_component_read32(component, WM8988_ADCDAC) & 0xfff7;
713
+ u16 mute_reg = snd_soc_component_read(component, WM8988_ADCDAC) & 0xfff7;
717714
718715 if (mute)
719716 snd_soc_component_write(component, WM8988_ADCDAC, mute_reg | 0x8);
....@@ -726,7 +723,7 @@
726723 enum snd_soc_bias_level level)
727724 {
728725 struct wm8988_priv *wm8988 = snd_soc_component_get_drvdata(component);
729
- u16 pwr_reg = snd_soc_component_read32(component, WM8988_PWR1) & ~0x1c1;
726
+ u16 pwr_reg = snd_soc_component_read(component, WM8988_PWR1) & ~0x1c1;
730727
731728 switch (level) {
732729 case SND_SOC_BIAS_ON:
....@@ -769,7 +766,8 @@
769766 .hw_params = wm8988_pcm_hw_params,
770767 .set_fmt = wm8988_set_dai_fmt,
771768 .set_sysclk = wm8988_set_dai_sysclk,
772
- .digital_mute = wm8988_mute,
769
+ .mute_stream = wm8988_mute,
770
+ .no_capture_mute = 1,
773771 };
774772
775773 static struct snd_soc_dai_driver wm8988_dai = {