hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/sound/soc/codecs/wm8978.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * wm8978.c -- WM8978 ALSA SoC Audio Codec driver
34 *
....@@ -5,10 +6,6 @@
56 * Copyright (C) 2007 Carlos Munoz <carlos@kenati.com>
67 * Copyright 2006-2009 Wolfson Microelectronics PLC.
78 * Based on wm8974 and wm8990 by Liam Girdwood <lrg@slimlogic.co.uk>
8
- *
9
- * This program is free software; you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License version 2 as
11
- * published by the Free Software Foundation.
129 */
1310
1411 #include <linux/module.h>
....@@ -656,8 +653,8 @@
656653 * BCLK polarity mask = 0x100, LRC clock polarity mask = 0x80,
657654 * Data Format mask = 0x18: all will be calculated anew
658655 */
659
- u16 iface = snd_soc_component_read32(component, WM8978_AUDIO_INTERFACE) & ~0x198;
660
- u16 clk = snd_soc_component_read32(component, WM8978_CLOCKING);
656
+ u16 iface = snd_soc_component_read(component, WM8978_AUDIO_INTERFACE) & ~0x198;
657
+ u16 clk = snd_soc_component_read(component, WM8978_CLOCKING);
661658
662659 dev_dbg(component->dev, "%s\n", __func__);
663660
....@@ -723,10 +720,10 @@
723720 struct snd_soc_component *component = dai->component;
724721 struct wm8978_priv *wm8978 = snd_soc_component_get_drvdata(component);
725722 /* Word length mask = 0x60 */
726
- u16 iface_ctl = snd_soc_component_read32(component, WM8978_AUDIO_INTERFACE) & ~0x60;
723
+ u16 iface_ctl = snd_soc_component_read(component, WM8978_AUDIO_INTERFACE) & ~0x60;
727724 /* Sampling rate mask = 0xe (for filters) */
728
- u16 add_ctl = snd_soc_component_read32(component, WM8978_ADDITIONAL_CONTROL) & ~0xe;
729
- u16 clking = snd_soc_component_read32(component, WM8978_CLOCKING);
725
+ u16 add_ctl = snd_soc_component_read(component, WM8978_ADDITIONAL_CONTROL) & ~0xe;
726
+ u16 clking = snd_soc_component_read(component, WM8978_CLOCKING);
730727 enum wm8978_sysclk_src current_clk_id = clking & 0x100 ?
731728 WM8978_PLL : WM8978_MCLK;
732729 unsigned int f_sel, diff, diff_best = INT_MAX;
....@@ -839,7 +836,7 @@
839836 return 0;
840837 }
841838
842
-static int wm8978_mute(struct snd_soc_dai *dai, int mute)
839
+static int wm8978_mute(struct snd_soc_dai *dai, int mute, int direction)
843840 {
844841 struct snd_soc_component *component = dai->component;
845842
....@@ -856,7 +853,7 @@
856853 static int wm8978_set_bias_level(struct snd_soc_component *component,
857854 enum snd_soc_bias_level level)
858855 {
859
- u16 power1 = snd_soc_component_read32(component, WM8978_POWER_MANAGEMENT_1) & ~3;
856
+ u16 power1 = snd_soc_component_read(component, WM8978_POWER_MANAGEMENT_1) & ~3;
860857
861858 switch (level) {
862859 case SND_SOC_BIAS_ON:
....@@ -896,10 +893,11 @@
896893
897894 static const struct snd_soc_dai_ops wm8978_dai_ops = {
898895 .hw_params = wm8978_hw_params,
899
- .digital_mute = wm8978_mute,
896
+ .mute_stream = wm8978_mute,
900897 .set_fmt = wm8978_set_dai_fmt,
901898 .set_clkdiv = wm8978_set_dai_clkdiv,
902899 .set_sysclk = wm8978_set_dai_sysclk,
900
+ .no_capture_mute = 1,
903901 };
904902
905903 /* Also supports 12kHz */