hc
2024-05-14 bedbef8ad3e75a304af6361af235302bcc61d06b
kernel/sound/soc/codecs/wm8903.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * wm8903.c -- WM8903 ALSA SoC Audio driver
34 *
....@@ -5,10 +6,6 @@
56 * Copyright 2011-2012 NVIDIA, Inc.
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 * TODO:
1411 * - TDM mode configuration.
....@@ -345,7 +342,7 @@
345342 if (!(wm8903->dcs_pending & (1 << i)))
346343 continue;
347344
348
- val = snd_soc_component_read32(component,
345
+ val = snd_soc_component_read(component,
349346 WM8903_DC_SERVO_READBACK_1 + i);
350347 dev_dbg(component->dev, "DC servo %d: %x\n",
351348 3 - i, val);
....@@ -378,7 +375,7 @@
378375 u16 reg;
379376 int ret;
380377
381
- reg = snd_soc_component_read32(component, WM8903_CLASS_W_0);
378
+ reg = snd_soc_component_read(component, WM8903_CLASS_W_0);
382379
383380 /* Turn it off if we're about to enable bypass */
384381 if (ucontrol->value.integer.value[0]) {
....@@ -1227,7 +1224,7 @@
12271224 unsigned int fmt)
12281225 {
12291226 struct snd_soc_component *component = codec_dai->component;
1230
- u16 aif1 = snd_soc_component_read32(component, WM8903_AUDIO_INTERFACE_1);
1227
+ u16 aif1 = snd_soc_component_read(component, WM8903_AUDIO_INTERFACE_1);
12311228
12321229 aif1 &= ~(WM8903_LRCLK_DIR | WM8903_BCLK_DIR | WM8903_AIF_FMT_MASK |
12331230 WM8903_AIF_LRCLK_INV | WM8903_AIF_BCLK_INV);
....@@ -1310,12 +1307,12 @@
13101307 return 0;
13111308 }
13121309
1313
-static int wm8903_digital_mute(struct snd_soc_dai *codec_dai, int mute)
1310
+static int wm8903_mute(struct snd_soc_dai *codec_dai, int mute, int direction)
13141311 {
13151312 struct snd_soc_component *component = codec_dai->component;
13161313 u16 reg;
13171314
1318
- reg = snd_soc_component_read32(component, WM8903_DAC_DIGITAL_1);
1315
+ reg = snd_soc_component_read(component, WM8903_DAC_DIGITAL_1);
13191316
13201317 if (mute)
13211318 reg |= WM8903_DAC_MUTE;
....@@ -1454,12 +1451,12 @@
14541451 int cur_val;
14551452 int clk_sys;
14561453
1457
- u16 aif1 = snd_soc_component_read32(component, WM8903_AUDIO_INTERFACE_1);
1458
- u16 aif2 = snd_soc_component_read32(component, WM8903_AUDIO_INTERFACE_2);
1459
- u16 aif3 = snd_soc_component_read32(component, WM8903_AUDIO_INTERFACE_3);
1460
- u16 clock0 = snd_soc_component_read32(component, WM8903_CLOCK_RATES_0);
1461
- u16 clock1 = snd_soc_component_read32(component, WM8903_CLOCK_RATES_1);
1462
- u16 dac_digital1 = snd_soc_component_read32(component, WM8903_DAC_DIGITAL_1);
1454
+ u16 aif1 = snd_soc_component_read(component, WM8903_AUDIO_INTERFACE_1);
1455
+ u16 aif2 = snd_soc_component_read(component, WM8903_AUDIO_INTERFACE_2);
1456
+ u16 aif3 = snd_soc_component_read(component, WM8903_AUDIO_INTERFACE_3);
1457
+ u16 clock0 = snd_soc_component_read(component, WM8903_CLOCK_RATES_0);
1458
+ u16 clock1 = snd_soc_component_read(component, WM8903_CLOCK_RATES_1);
1459
+ u16 dac_digital1 = snd_soc_component_read(component, WM8903_DAC_DIGITAL_1);
14631460
14641461 /* Enable sloping stopband filter for low sample rates */
14651462 if (fs <= 24000)
....@@ -1740,9 +1737,10 @@
17401737
17411738 static const struct snd_soc_dai_ops wm8903_dai_ops = {
17421739 .hw_params = wm8903_hw_params,
1743
- .digital_mute = wm8903_digital_mute,
1740
+ .mute_stream = wm8903_mute,
17441741 .set_fmt = wm8903_set_dai_fmt,
17451742 .set_sysclk = wm8903_set_dai_sysclk,
1743
+ .no_capture_mute = 1,
17461744 };
17471745
17481746 static struct snd_soc_dai_driver wm8903_dai = {
....@@ -1930,7 +1928,7 @@
19301928 * We assume the controller imposes no restrictions,
19311929 * so we are able to select active-high
19321930 */
1933
- /* Fall-through */
1931
+ fallthrough;
19341932 case IRQ_TYPE_LEVEL_HIGH:
19351933 pdata->irq_active_low = false;
19361934 break;