hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/sound/soc/codecs/wm8728.c
....@@ -1,13 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * wm8728.c -- WM8728 ALSA SoC Audio driver
34 *
45 * Copyright 2008 Wolfson Microelectronics plc
56 *
67 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
7
- *
8
- * This program is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License version 2 as
10
- * published by the Free Software Foundation.
118 */
129
1310 #include <linux/module.h>
....@@ -72,10 +69,10 @@
7269 {"VOUTR", NULL, "DAC"},
7370 };
7471
75
-static int wm8728_mute(struct snd_soc_dai *dai, int mute)
72
+static int wm8728_mute(struct snd_soc_dai *dai, int mute, int direction)
7673 {
7774 struct snd_soc_component *component = dai->component;
78
- u16 mute_reg = snd_soc_component_read32(component, WM8728_DACCTL);
75
+ u16 mute_reg = snd_soc_component_read(component, WM8728_DACCTL);
7976
8077 if (mute)
8178 snd_soc_component_write(component, WM8728_DACCTL, mute_reg | 1);
....@@ -90,7 +87,7 @@
9087 struct snd_soc_dai *dai)
9188 {
9289 struct snd_soc_component *component = dai->component;
93
- u16 dac = snd_soc_component_read32(component, WM8728_DACCTL);
90
+ u16 dac = snd_soc_component_read(component, WM8728_DACCTL);
9491
9592 dac &= ~0x18;
9693
....@@ -116,7 +113,7 @@
116113 unsigned int fmt)
117114 {
118115 struct snd_soc_component *component = codec_dai->component;
119
- u16 iface = snd_soc_component_read32(component, WM8728_IFCTL);
116
+ u16 iface = snd_soc_component_read(component, WM8728_IFCTL);
120117
121118 /* Currently only I2S is supported by the driver, though the
122119 * hardware is more flexible.
....@@ -172,7 +169,7 @@
172169 case SND_SOC_BIAS_STANDBY:
173170 if (snd_soc_component_get_bias_level(component) == SND_SOC_BIAS_OFF) {
174171 /* Power everything up... */
175
- reg = snd_soc_component_read32(component, WM8728_DACCTL);
172
+ reg = snd_soc_component_read(component, WM8728_DACCTL);
176173 snd_soc_component_write(component, WM8728_DACCTL, reg & ~0x4);
177174
178175 /* ..then sync in the register cache. */
....@@ -181,7 +178,7 @@
181178 break;
182179
183180 case SND_SOC_BIAS_OFF:
184
- reg = snd_soc_component_read32(component, WM8728_DACCTL);
181
+ reg = snd_soc_component_read(component, WM8728_DACCTL);
185182 snd_soc_component_write(component, WM8728_DACCTL, reg | 0x4);
186183 break;
187184 }
....@@ -195,8 +192,9 @@
195192
196193 static const struct snd_soc_dai_ops wm8728_dai_ops = {
197194 .hw_params = wm8728_hw_params,
198
- .digital_mute = wm8728_mute,
195
+ .mute_stream = wm8728_mute,
199196 .set_fmt = wm8728_set_dai_fmt,
197
+ .no_capture_mute = 1,
200198 };
201199
202200 static struct snd_soc_dai_driver wm8728_dai = {