forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/sound/soc/codecs/wm8955.c
....@@ -1,13 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * wm8955.c -- WM8955 ALSA SoC Audio driver
34 *
45 * Copyright 2009 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>
....@@ -143,7 +140,7 @@
143140 * to allow rounding later */
144141 #define FIXED_FLL_SIZE ((1 << 22) * 10)
145142
146
-static int wm8995_pll_factors(struct device *dev,
143
+static int wm8955_pll_factors(struct device *dev,
147144 int Fref, int Fout, struct pll_factors *pll)
148145 {
149146 u64 Kpart;
....@@ -282,7 +279,7 @@
282279
283280 /* Use the last divider configuration we saw for the
284281 * sample rate. */
285
- ret = wm8995_pll_factors(component->dev, wm8955->mclk_rate,
282
+ ret = wm8955_pll_factors(component->dev, wm8955->mclk_rate,
286283 clock_cfgs[sr].mclk, &pll);
287284 if (ret != 0) {
288285 dev_err(component->dev,
....@@ -622,7 +619,7 @@
622619 /* If the chip is clocked then disable the clocks and force a
623620 * reconfiguration, otherwise DAPM will power up the
624621 * clocks for us later. */
625
- ret = snd_soc_component_read32(component, WM8955_POWER_MANAGEMENT_1);
622
+ ret = snd_soc_component_read(component, WM8955_POWER_MANAGEMENT_1);
626623 if (ret < 0)
627624 return ret;
628625 if (ret & WM8955_DIGENB) {
....@@ -686,7 +683,7 @@
686683 switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
687684 case SND_SOC_DAIFMT_DSP_B:
688685 aif |= WM8955_LRP;
689
- /* fall through */
686
+ fallthrough;
690687 case SND_SOC_DAIFMT_DSP_A:
691688 aif |= 0x3;
692689 break;
....@@ -748,7 +745,7 @@
748745 }
749746
750747
751
-static int wm8955_digital_mute(struct snd_soc_dai *codec_dai, int mute)
748
+static int wm8955_mute(struct snd_soc_dai *codec_dai, int mute, int direction)
752749 {
753750 struct snd_soc_component *component = codec_dai->component;
754751 int val;
....@@ -851,7 +848,8 @@
851848 .set_sysclk = wm8955_set_sysclk,
852849 .set_fmt = wm8955_set_fmt,
853850 .hw_params = wm8955_hw_params,
854
- .digital_mute = wm8955_digital_mute,
851
+ .mute_stream = wm8955_mute,
852
+ .no_capture_mute = 1,
855853 };
856854
857855 static struct snd_soc_dai_driver wm8955_dai = {