hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/sound/soc/codecs/wm8900.c
....@@ -1,13 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * wm8900.c -- WM8900 ALSA Soc Audio driver
34 *
45 * Copyright 2007, 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 * TODO:
1310 * - Tristating.
....@@ -225,7 +222,7 @@
225222 struct snd_kcontrol *kcontrol, int event)
226223 {
227224 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
228
- u16 hpctl1 = snd_soc_component_read32(component, WM8900_REG_HPCTL1);
225
+ u16 hpctl1 = snd_soc_component_read(component, WM8900_REG_HPCTL1);
229226
230227 switch (event) {
231228 case SND_SOC_DAPM_PRE_PMU:
....@@ -446,12 +443,6 @@
446443
447444 };
448445
449
-static const struct snd_kcontrol_new wm8900_dapm_loutput2_control =
450
-SOC_DAPM_SINGLE("LINEOUT2L Switch", WM8900_REG_POWER3, 6, 1, 0);
451
-
452
-static const struct snd_kcontrol_new wm8900_dapm_routput2_control =
453
-SOC_DAPM_SINGLE("LINEOUT2R Switch", WM8900_REG_POWER3, 5, 1, 0);
454
-
455446 static const struct snd_kcontrol_new wm8900_loutmix_controls[] = {
456447 SOC_DAPM_SINGLE("LINPUT3 Bypass Switch", WM8900_REG_LOUTMIXCTL1, 7, 1, 0),
457448 SOC_DAPM_SINGLE("AUX Bypass Switch", WM8900_REG_AUXOUT_CTL, 7, 1, 0),
....@@ -638,7 +629,7 @@
638629 struct snd_soc_component *component = dai->component;
639630 u16 reg;
640631
641
- reg = snd_soc_component_read32(component, WM8900_REG_AUDIO1) & ~0x60;
632
+ reg = snd_soc_component_read(component, WM8900_REG_AUDIO1) & ~0x60;
642633
643634 switch (params_width(params)) {
644635 case 16:
....@@ -659,7 +650,7 @@
659650 snd_soc_component_write(component, WM8900_REG_AUDIO1, reg);
660651
661652 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
662
- reg = snd_soc_component_read32(component, WM8900_REG_DACCTRL);
653
+ reg = snd_soc_component_read(component, WM8900_REG_DACCTRL);
663654
664655 if (params_rate(params) <= 24000)
665656 reg |= WM8900_REG_DACCTRL_DAC_SB_FILT;
....@@ -869,10 +860,10 @@
869860 struct snd_soc_component *component = codec_dai->component;
870861 unsigned int clocking1, aif1, aif3, aif4;
871862
872
- clocking1 = snd_soc_component_read32(component, WM8900_REG_CLOCKING1);
873
- aif1 = snd_soc_component_read32(component, WM8900_REG_AUDIO1);
874
- aif3 = snd_soc_component_read32(component, WM8900_REG_AUDIO3);
875
- aif4 = snd_soc_component_read32(component, WM8900_REG_AUDIO4);
863
+ clocking1 = snd_soc_component_read(component, WM8900_REG_CLOCKING1);
864
+ aif1 = snd_soc_component_read(component, WM8900_REG_AUDIO1);
865
+ aif3 = snd_soc_component_read(component, WM8900_REG_AUDIO3);
866
+ aif4 = snd_soc_component_read(component, WM8900_REG_AUDIO4);
876867
877868 /* set master/slave audio interface */
878869 switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
....@@ -976,12 +967,12 @@
976967 return 0;
977968 }
978969
979
-static int wm8900_digital_mute(struct snd_soc_dai *codec_dai, int mute)
970
+static int wm8900_mute(struct snd_soc_dai *codec_dai, int mute, int direction)
980971 {
981972 struct snd_soc_component *component = codec_dai->component;
982973 u16 reg;
983974
984
- reg = snd_soc_component_read32(component, WM8900_REG_DACCTRL);
975
+ reg = snd_soc_component_read(component, WM8900_REG_DACCTRL);
985976
986977 if (mute)
987978 reg |= WM8900_REG_DACCTRL_MUTE;
....@@ -1006,7 +997,8 @@
1006997 .set_clkdiv = wm8900_set_dai_clkdiv,
1007998 .set_pll = wm8900_set_dai_pll,
1008999 .set_fmt = wm8900_set_dai_fmt,
1009
- .digital_mute = wm8900_digital_mute,
1000
+ .mute_stream = wm8900_mute,
1001
+ .no_capture_mute = 1,
10101002 };
10111003
10121004 static struct snd_soc_dai_driver wm8900_dai = {
....@@ -1077,7 +1069,7 @@
10771069 WM8900_REG_POWER1_BIAS_ENA | 0x1);
10781070 }
10791071
1080
- reg = snd_soc_component_read32(component, WM8900_REG_POWER1);
1072
+ reg = snd_soc_component_read(component, WM8900_REG_POWER1);
10811073 snd_soc_component_write(component, WM8900_REG_POWER1,
10821074 (reg & WM8900_REG_POWER1_FLL_ENA) |
10831075 WM8900_REG_POWER1_BIAS_ENA | 0x1);
....@@ -1088,7 +1080,7 @@
10881080
10891081 case SND_SOC_BIAS_OFF:
10901082 /* Startup bias enable */
1091
- reg = snd_soc_component_read32(component, WM8900_REG_POWER1);
1083
+ reg = snd_soc_component_read(component, WM8900_REG_POWER1);
10921084 snd_soc_component_write(component, WM8900_REG_POWER1,
10931085 reg & WM8900_REG_POWER1_STARTUP_BIAS_ENA);
10941086 snd_soc_component_write(component, WM8900_REG_ADDCTL,
....@@ -1179,7 +1171,7 @@
11791171 {
11801172 int reg;
11811173
1182
- reg = snd_soc_component_read32(component, WM8900_REG_ID);
1174
+ reg = snd_soc_component_read(component, WM8900_REG_ID);
11831175 if (reg != 0x8900) {
11841176 dev_err(component->dev, "Device is not a WM8900 - ID %x\n", reg);
11851177 return -ENODEV;