forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/sound/soc/codecs/wm8750.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * wm8750.c -- WM8750 ALSA SoC audio driver
34 *
....@@ -6,10 +7,6 @@
67 * Author: Richard Purdie <richard@openedhand.com>
78 *
89 * Based on WM8753.c
9
- *
10
- * This program is free software; you can redistribute it and/or modify
11
- * it under the terms of the GNU General Public License version 2 as
12
- * published by the Free Software Foundation.
1310 */
1411
1512 #include <linux/module.h>
....@@ -581,8 +578,8 @@
581578 {
582579 struct snd_soc_component *component = dai->component;
583580 struct wm8750_priv *wm8750 = snd_soc_component_get_drvdata(component);
584
- u16 iface = snd_soc_component_read32(component, WM8750_IFACE) & 0x1f3;
585
- u16 srate = snd_soc_component_read32(component, WM8750_SRATE) & 0x1c0;
581
+ u16 iface = snd_soc_component_read(component, WM8750_IFACE) & 0x1f3;
582
+ u16 srate = snd_soc_component_read(component, WM8750_SRATE) & 0x1c0;
586583 int coeff = get_coeff(wm8750->sysclk, params_rate(params));
587584
588585 /* bit size */
....@@ -609,10 +606,10 @@
609606 return 0;
610607 }
611608
612
-static int wm8750_mute(struct snd_soc_dai *dai, int mute)
609
+static int wm8750_mute(struct snd_soc_dai *dai, int mute, int direction)
613610 {
614611 struct snd_soc_component *component = dai->component;
615
- u16 mute_reg = snd_soc_component_read32(component, WM8750_ADCDAC) & 0xfff7;
612
+ u16 mute_reg = snd_soc_component_read(component, WM8750_ADCDAC) & 0xfff7;
616613
617614 if (mute)
618615 snd_soc_component_write(component, WM8750_ADCDAC, mute_reg | 0x8);
....@@ -624,7 +621,7 @@
624621 static int wm8750_set_bias_level(struct snd_soc_component *component,
625622 enum snd_soc_bias_level level)
626623 {
627
- u16 pwr_reg = snd_soc_component_read32(component, WM8750_PWR1) & 0xfe3e;
624
+ u16 pwr_reg = snd_soc_component_read(component, WM8750_PWR1) & 0xfe3e;
628625
629626 switch (level) {
630627 case SND_SOC_BIAS_ON:
....@@ -663,9 +660,10 @@
663660
664661 static const struct snd_soc_dai_ops wm8750_dai_ops = {
665662 .hw_params = wm8750_pcm_hw_params,
666
- .digital_mute = wm8750_mute,
663
+ .mute_stream = wm8750_mute,
667664 .set_fmt = wm8750_set_dai_fmt,
668665 .set_sysclk = wm8750_set_dai_sysclk,
666
+ .no_capture_mute = 1,
669667 };
670668
671669 static struct snd_soc_dai_driver wm8750_dai = {