hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/sound/soc/codecs/wm8711.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * wm8711.c -- WM8711 ALSA SoC Audio driver
34 *
....@@ -6,10 +7,6 @@
67 * Author: Mike Arthur <Mike.Arthur@wolfsonmicro.com>
78 *
89 * Based on wm8731.c by Richard Purdie
9
- *
10
- * This program is free software; you can redistribute it and/or modify
11
- * it under the terms of the GNU General Public License version 2 as
12
- * published by the Free Software Foundation.
1310 */
1411
1512 #include <linux/module.h>
....@@ -161,7 +158,7 @@
161158 {
162159 struct snd_soc_component *component = dai->component;
163160 struct wm8711_priv *wm8711 = snd_soc_component_get_drvdata(component);
164
- u16 iface = snd_soc_component_read32(component, WM8711_IFACE) & 0xfff3;
161
+ u16 iface = snd_soc_component_read(component, WM8711_IFACE) & 0xfff3;
165162 int i = get_coeff(wm8711->sysclk, params_rate(params));
166163 u16 srate = (coeff_div[i].sr << 2) |
167164 (coeff_div[i].bosr << 1) | coeff_div[i].usb;
....@@ -201,16 +198,16 @@
201198 struct snd_soc_component *component = dai->component;
202199
203200 /* deactivate */
204
- if (!snd_soc_component_is_active(component)) {
201
+ if (!snd_soc_component_active(component)) {
205202 udelay(50);
206203 snd_soc_component_write(component, WM8711_ACTIVE, 0x0);
207204 }
208205 }
209206
210
-static int wm8711_mute(struct snd_soc_dai *dai, int mute)
207
+static int wm8711_mute(struct snd_soc_dai *dai, int mute, int direction)
211208 {
212209 struct snd_soc_component *component = dai->component;
213
- u16 mute_reg = snd_soc_component_read32(component, WM8711_APDIGI) & 0xfff7;
210
+ u16 mute_reg = snd_soc_component_read(component, WM8711_APDIGI) & 0xfff7;
214211
215212 if (mute)
216213 snd_soc_component_write(component, WM8711_APDIGI, mute_reg | 0x8);
....@@ -242,7 +239,7 @@
242239 unsigned int fmt)
243240 {
244241 struct snd_soc_component *component = codec_dai->component;
245
- u16 iface = snd_soc_component_read32(component, WM8711_IFACE) & 0x000c;
242
+ u16 iface = snd_soc_component_read(component, WM8711_IFACE) & 0x000c;
246243
247244 /* set master/slave audio interface */
248245 switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
....@@ -301,7 +298,7 @@
301298 enum snd_soc_bias_level level)
302299 {
303300 struct wm8711_priv *wm8711 = snd_soc_component_get_drvdata(component);
304
- u16 reg = snd_soc_component_read32(component, WM8711_PWR) & 0xff7f;
301
+ u16 reg = snd_soc_component_read(component, WM8711_PWR) & 0xff7f;
305302
306303 switch (level) {
307304 case SND_SOC_BIAS_ON:
....@@ -332,9 +329,10 @@
332329 .prepare = wm8711_pcm_prepare,
333330 .hw_params = wm8711_hw_params,
334331 .shutdown = wm8711_shutdown,
335
- .digital_mute = wm8711_mute,
332
+ .mute_stream = wm8711_mute,
336333 .set_sysclk = wm8711_set_dai_sysclk,
337334 .set_fmt = wm8711_set_dai_fmt,
335
+ .no_capture_mute = 1,
338336 };
339337
340338 static struct snd_soc_dai_driver wm8711_dai = {