hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/sound/soc/codecs/wm_hubs.c
....@@ -1,14 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * wm_hubs.c -- WM8993/4 common code
34 *
45 * Copyright 2009-12 Wolfson Microelectronics plc
56 *
67 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
7
- *
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.
128 */
139
1410 #include <linux/module.h>
....@@ -89,7 +85,7 @@
8985 else
9086 msleep(1);
9187
92
- reg = snd_soc_component_read32(component, WM8993_DC_SERVO_0);
88
+ reg = snd_soc_component_read(component, WM8993_DC_SERVO_0);
9389 dev_dbg(component->dev, "DC servo: %x\n", reg);
9490 } while (reg & op && count < timeout);
9591
....@@ -113,7 +109,7 @@
113109 int reg;
114110
115111 /* If we're going via the mixer we'll need to do additional checks */
116
- reg = snd_soc_component_read32(component, WM8993_OUTPUT_MIXER1);
112
+ reg = snd_soc_component_read(component, WM8993_OUTPUT_MIXER1);
117113 if (!(reg & WM8993_DACL_TO_HPOUT1L)) {
118114 if (reg & ~WM8993_DACL_TO_MIXOUTL) {
119115 dev_vdbg(component->dev, "Analogue paths connected: %x\n",
....@@ -126,7 +122,7 @@
126122 dev_vdbg(component->dev, "HPL connected to DAC\n");
127123 }
128124
129
- reg = snd_soc_component_read32(component, WM8993_OUTPUT_MIXER2);
125
+ reg = snd_soc_component_read(component, WM8993_OUTPUT_MIXER2);
130126 if (!(reg & WM8993_DACR_TO_HPOUT1R)) {
131127 if (reg & ~WM8993_DACR_TO_MIXOUTR) {
132128 dev_vdbg(component->dev, "Analogue paths connected: %x\n",
....@@ -156,10 +152,10 @@
156152 struct wm_hubs_dcs_cache *cache;
157153 unsigned int left, right;
158154
159
- left = snd_soc_component_read32(component, WM8993_LEFT_OUTPUT_VOLUME);
155
+ left = snd_soc_component_read(component, WM8993_LEFT_OUTPUT_VOLUME);
160156 left &= WM8993_HPOUT1L_VOL_MASK;
161157
162
- right = snd_soc_component_read32(component, WM8993_RIGHT_OUTPUT_VOLUME);
158
+ right = snd_soc_component_read(component, WM8993_RIGHT_OUTPUT_VOLUME);
163159 right &= WM8993_HPOUT1R_VOL_MASK;
164160
165161 list_for_each_entry(cache, &hubs->dcs_cache, list) {
....@@ -185,10 +181,10 @@
185181 if (!cache)
186182 return;
187183
188
- cache->left = snd_soc_component_read32(component, WM8993_LEFT_OUTPUT_VOLUME);
184
+ cache->left = snd_soc_component_read(component, WM8993_LEFT_OUTPUT_VOLUME);
189185 cache->left &= WM8993_HPOUT1L_VOL_MASK;
190186
191
- cache->right = snd_soc_component_read32(component, WM8993_RIGHT_OUTPUT_VOLUME);
187
+ cache->right = snd_soc_component_read(component, WM8993_RIGHT_OUTPUT_VOLUME);
192188 cache->right &= WM8993_HPOUT1R_VOL_MASK;
193189
194190 cache->dcs_cfg = dcs_cfg;
....@@ -220,14 +216,14 @@
220216 */
221217 switch (hubs->dcs_readback_mode) {
222218 case 0:
223
- *reg_l = snd_soc_component_read32(component, WM8993_DC_SERVO_READBACK_1)
219
+ *reg_l = snd_soc_component_read(component, WM8993_DC_SERVO_READBACK_1)
224220 & WM8993_DCS_INTEG_CHAN_0_MASK;
225
- *reg_r = snd_soc_component_read32(component, WM8993_DC_SERVO_READBACK_2)
221
+ *reg_r = snd_soc_component_read(component, WM8993_DC_SERVO_READBACK_2)
226222 & WM8993_DCS_INTEG_CHAN_1_MASK;
227223 break;
228224 case 2:
229225 case 1:
230
- reg = snd_soc_component_read32(component, dcs_reg);
226
+ reg = snd_soc_component_read(component, dcs_reg);
231227 *reg_r = (reg & WM8993_DCS_DAC_WR_VAL_1_MASK)
232228 >> WM8993_DCS_DAC_WR_VAL_1_SHIFT;
233229 *reg_l = reg & WM8993_DCS_DAC_WR_VAL_0_MASK;
....@@ -346,7 +342,7 @@
346342 return ret;
347343
348344 /* Only need to do this if the outputs are active */
349
- if (snd_soc_component_read32(component, WM8993_POWER_MANAGEMENT_1)
345
+ if (snd_soc_component_read(component, WM8993_POWER_MANAGEMENT_1)
350346 & (WM8993_HPOUT1L_ENA | WM8993_HPOUT1R_ENA))
351347 snd_soc_component_update_bits(component,
352348 WM8993_DC_SERVO_0,
....@@ -542,7 +538,7 @@
542538 struct snd_kcontrol *kcontrol, int event)
543539 {
544540 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
545
- unsigned int reg = snd_soc_component_read32(component, WM8993_ANALOGUE_HP_0);
541
+ unsigned int reg = snd_soc_component_read(component, WM8993_ANALOGUE_HP_0);
546542
547543 switch (event) {
548544 case SND_SOC_DAPM_POST_PMU:
....@@ -594,7 +590,7 @@
594590 struct snd_kcontrol *control, int event)
595591 {
596592 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
597
- u16 reg = snd_soc_component_read32(component, WM8993_ANTIPOP1) & ~WM8993_HPOUT2_IN_ENA;
593
+ u16 reg = snd_soc_component_read(component, WM8993_ANTIPOP1) & ~WM8993_HPOUT2_IN_ENA;
598594
599595 switch (event) {
600596 case SND_SOC_DAPM_PRE_PMU:
....@@ -684,9 +680,9 @@
684680 WM8993_CP_DYN_V | WM8993_CP_DYN_FREQ, enable);
685681
686682 snd_soc_component_write(component, WM8993_LEFT_OUTPUT_VOLUME,
687
- snd_soc_component_read32(component, WM8993_LEFT_OUTPUT_VOLUME));
683
+ snd_soc_component_read(component, WM8993_LEFT_OUTPUT_VOLUME));
688684 snd_soc_component_write(component, WM8993_RIGHT_OUTPUT_VOLUME,
689
- snd_soc_component_read32(component, WM8993_RIGHT_OUTPUT_VOLUME));
685
+ snd_soc_component_read(component, WM8993_RIGHT_OUTPUT_VOLUME));
690686 }
691687 EXPORT_SYMBOL_GPL(wm_hubs_update_class_w);
692688