forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/sound/soc/codecs/wm8971.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * wm8971.c -- WM8971 ALSA SoC Audio driver
34 *
....@@ -6,11 +7,6 @@
67 * Author: Kenneth Kiraly <kiraly@lab126.com>
78 *
89 * Based on wm8753.c by Liam Girdwood
9
- *
10
- * This program is free software; you can redistribute it and/or modify it
11
- * under the terms of the GNU General Public License as published by the
12
- * Free Software Foundation; either version 2 of the License, or (at your
13
- * option) any later version.
1410 */
1511
1612 #include <linux/module.h>
....@@ -512,8 +508,8 @@
512508 {
513509 struct snd_soc_component *component = dai->component;
514510 struct wm8971_priv *wm8971 = snd_soc_component_get_drvdata(component);
515
- u16 iface = snd_soc_component_read32(component, WM8971_IFACE) & 0x1f3;
516
- u16 srate = snd_soc_component_read32(component, WM8971_SRATE) & 0x1c0;
511
+ u16 iface = snd_soc_component_read(component, WM8971_IFACE) & 0x1f3;
512
+ u16 srate = snd_soc_component_read(component, WM8971_SRATE) & 0x1c0;
517513 int coeff = get_coeff(wm8971->sysclk, params_rate(params));
518514
519515 /* bit size */
....@@ -540,10 +536,10 @@
540536 return 0;
541537 }
542538
543
-static int wm8971_mute(struct snd_soc_dai *dai, int mute)
539
+static int wm8971_mute(struct snd_soc_dai *dai, int mute, int direction)
544540 {
545541 struct snd_soc_component *component = dai->component;
546
- u16 mute_reg = snd_soc_component_read32(component, WM8971_ADCDAC) & 0xfff7;
542
+ u16 mute_reg = snd_soc_component_read(component, WM8971_ADCDAC) & 0xfff7;
547543
548544 if (mute)
549545 snd_soc_component_write(component, WM8971_ADCDAC, mute_reg | 0x8);
....@@ -565,7 +561,7 @@
565561 enum snd_soc_bias_level level)
566562 {
567563 struct wm8971_priv *wm8971 = snd_soc_component_get_drvdata(component);
568
- u16 pwr_reg = snd_soc_component_read32(component, WM8971_PWR1) & 0xfe3e;
564
+ u16 pwr_reg = snd_soc_component_read(component, WM8971_PWR1) & 0xfe3e;
569565
570566 switch (level) {
571567 case SND_SOC_BIAS_ON:
....@@ -606,9 +602,10 @@
606602
607603 static const struct snd_soc_dai_ops wm8971_dai_ops = {
608604 .hw_params = wm8971_pcm_hw_params,
609
- .digital_mute = wm8971_mute,
605
+ .mute_stream = wm8971_mute,
610606 .set_fmt = wm8971_set_dai_fmt,
611607 .set_sysclk = wm8971_set_dai_sysclk,
608
+ .no_capture_mute = 1,
612609 };
613610
614611 static struct snd_soc_dai_driver wm8971_dai = {