forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/sound/soc/codecs/wm8983.c
....@@ -1,13 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * wm8983.c -- WM8983 ALSA SoC Audio driver
34 *
45 * Copyright 2011 Wolfson Microelectronics plc
56 *
67 * Author: Dimitris Papastamos <dp@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>
....@@ -495,7 +492,7 @@
495492 struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
496493 unsigned int reg;
497494
498
- reg = snd_soc_component_read32(component, WM8983_EQ1_LOW_SHELF);
495
+ reg = snd_soc_component_read(component, WM8983_EQ1_LOW_SHELF);
499496 if (reg & WM8983_EQ3DMODE)
500497 ucontrol->value.enumerated.item[0] = 1;
501498 else
....@@ -515,7 +512,7 @@
515512 && ucontrol->value.enumerated.item[0] != 1)
516513 return -EINVAL;
517514
518
- reg_eq = snd_soc_component_read32(component, WM8983_EQ1_LOW_SHELF);
515
+ reg_eq = snd_soc_component_read(component, WM8983_EQ1_LOW_SHELF);
519516 switch ((reg_eq & WM8983_EQ3DMODE) >> WM8983_EQ3DMODE_SHIFT) {
520517 case 0:
521518 if (!ucontrol->value.enumerated.item[0])
....@@ -527,8 +524,8 @@
527524 break;
528525 }
529526
530
- regpwr2 = snd_soc_component_read32(component, WM8983_POWER_MANAGEMENT_2);
531
- regpwr3 = snd_soc_component_read32(component, WM8983_POWER_MANAGEMENT_3);
527
+ regpwr2 = snd_soc_component_read(component, WM8983_POWER_MANAGEMENT_2);
528
+ regpwr3 = snd_soc_component_read(component, WM8983_POWER_MANAGEMENT_3);
532529 /* disable the DACs and ADCs */
533530 snd_soc_component_update_bits(component, WM8983_POWER_MANAGEMENT_2,
534531 WM8983_ADCENR_MASK | WM8983_ADCENL_MASK, 0);
....@@ -560,7 +557,7 @@
560557 }
561558 }
562559
563
-static int wm8983_dac_mute(struct snd_soc_dai *dai, int mute)
560
+static int wm8983_dac_mute(struct snd_soc_dai *dai, int mute, int direction)
564561 {
565562 struct snd_soc_component *component = dai->component;
566563
....@@ -946,11 +943,12 @@
946943 }
947944
948945 static const struct snd_soc_dai_ops wm8983_dai_ops = {
949
- .digital_mute = wm8983_dac_mute,
946
+ .mute_stream = wm8983_dac_mute,
950947 .hw_params = wm8983_hw_params,
951948 .set_fmt = wm8983_set_fmt,
952949 .set_sysclk = wm8983_set_sysclk,
953
- .set_pll = wm8983_set_pll
950
+ .set_pll = wm8983_set_pll,
951
+ .no_capture_mute = 1,
954952 };
955953
956954 #define WM8983_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \