.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * wm_hubs.c -- WM8993/4 common code |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright 2009-12 Wolfson Microelectronics plc |
---|
5 | 6 | * |
---|
6 | 7 | * 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. |
---|
12 | 8 | */ |
---|
13 | 9 | |
---|
14 | 10 | #include <linux/module.h> |
---|
.. | .. |
---|
89 | 85 | else |
---|
90 | 86 | msleep(1); |
---|
91 | 87 | |
---|
92 | | - reg = snd_soc_component_read32(component, WM8993_DC_SERVO_0); |
---|
| 88 | + reg = snd_soc_component_read(component, WM8993_DC_SERVO_0); |
---|
93 | 89 | dev_dbg(component->dev, "DC servo: %x\n", reg); |
---|
94 | 90 | } while (reg & op && count < timeout); |
---|
95 | 91 | |
---|
.. | .. |
---|
113 | 109 | int reg; |
---|
114 | 110 | |
---|
115 | 111 | /* 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); |
---|
117 | 113 | if (!(reg & WM8993_DACL_TO_HPOUT1L)) { |
---|
118 | 114 | if (reg & ~WM8993_DACL_TO_MIXOUTL) { |
---|
119 | 115 | dev_vdbg(component->dev, "Analogue paths connected: %x\n", |
---|
.. | .. |
---|
126 | 122 | dev_vdbg(component->dev, "HPL connected to DAC\n"); |
---|
127 | 123 | } |
---|
128 | 124 | |
---|
129 | | - reg = snd_soc_component_read32(component, WM8993_OUTPUT_MIXER2); |
---|
| 125 | + reg = snd_soc_component_read(component, WM8993_OUTPUT_MIXER2); |
---|
130 | 126 | if (!(reg & WM8993_DACR_TO_HPOUT1R)) { |
---|
131 | 127 | if (reg & ~WM8993_DACR_TO_MIXOUTR) { |
---|
132 | 128 | dev_vdbg(component->dev, "Analogue paths connected: %x\n", |
---|
.. | .. |
---|
156 | 152 | struct wm_hubs_dcs_cache *cache; |
---|
157 | 153 | unsigned int left, right; |
---|
158 | 154 | |
---|
159 | | - left = snd_soc_component_read32(component, WM8993_LEFT_OUTPUT_VOLUME); |
---|
| 155 | + left = snd_soc_component_read(component, WM8993_LEFT_OUTPUT_VOLUME); |
---|
160 | 156 | left &= WM8993_HPOUT1L_VOL_MASK; |
---|
161 | 157 | |
---|
162 | | - right = snd_soc_component_read32(component, WM8993_RIGHT_OUTPUT_VOLUME); |
---|
| 158 | + right = snd_soc_component_read(component, WM8993_RIGHT_OUTPUT_VOLUME); |
---|
163 | 159 | right &= WM8993_HPOUT1R_VOL_MASK; |
---|
164 | 160 | |
---|
165 | 161 | list_for_each_entry(cache, &hubs->dcs_cache, list) { |
---|
.. | .. |
---|
185 | 181 | if (!cache) |
---|
186 | 182 | return; |
---|
187 | 183 | |
---|
188 | | - cache->left = snd_soc_component_read32(component, WM8993_LEFT_OUTPUT_VOLUME); |
---|
| 184 | + cache->left = snd_soc_component_read(component, WM8993_LEFT_OUTPUT_VOLUME); |
---|
189 | 185 | cache->left &= WM8993_HPOUT1L_VOL_MASK; |
---|
190 | 186 | |
---|
191 | | - cache->right = snd_soc_component_read32(component, WM8993_RIGHT_OUTPUT_VOLUME); |
---|
| 187 | + cache->right = snd_soc_component_read(component, WM8993_RIGHT_OUTPUT_VOLUME); |
---|
192 | 188 | cache->right &= WM8993_HPOUT1R_VOL_MASK; |
---|
193 | 189 | |
---|
194 | 190 | cache->dcs_cfg = dcs_cfg; |
---|
.. | .. |
---|
220 | 216 | */ |
---|
221 | 217 | switch (hubs->dcs_readback_mode) { |
---|
222 | 218 | 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) |
---|
224 | 220 | & 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) |
---|
226 | 222 | & WM8993_DCS_INTEG_CHAN_1_MASK; |
---|
227 | 223 | break; |
---|
228 | 224 | case 2: |
---|
229 | 225 | case 1: |
---|
230 | | - reg = snd_soc_component_read32(component, dcs_reg); |
---|
| 226 | + reg = snd_soc_component_read(component, dcs_reg); |
---|
231 | 227 | *reg_r = (reg & WM8993_DCS_DAC_WR_VAL_1_MASK) |
---|
232 | 228 | >> WM8993_DCS_DAC_WR_VAL_1_SHIFT; |
---|
233 | 229 | *reg_l = reg & WM8993_DCS_DAC_WR_VAL_0_MASK; |
---|
.. | .. |
---|
346 | 342 | return ret; |
---|
347 | 343 | |
---|
348 | 344 | /* 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) |
---|
350 | 346 | & (WM8993_HPOUT1L_ENA | WM8993_HPOUT1R_ENA)) |
---|
351 | 347 | snd_soc_component_update_bits(component, |
---|
352 | 348 | WM8993_DC_SERVO_0, |
---|
.. | .. |
---|
542 | 538 | struct snd_kcontrol *kcontrol, int event) |
---|
543 | 539 | { |
---|
544 | 540 | 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); |
---|
546 | 542 | |
---|
547 | 543 | switch (event) { |
---|
548 | 544 | case SND_SOC_DAPM_POST_PMU: |
---|
.. | .. |
---|
594 | 590 | struct snd_kcontrol *control, int event) |
---|
595 | 591 | { |
---|
596 | 592 | 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; |
---|
598 | 594 | |
---|
599 | 595 | switch (event) { |
---|
600 | 596 | case SND_SOC_DAPM_PRE_PMU: |
---|
.. | .. |
---|
684 | 680 | WM8993_CP_DYN_V | WM8993_CP_DYN_FREQ, enable); |
---|
685 | 681 | |
---|
686 | 682 | 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)); |
---|
688 | 684 | 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)); |
---|
690 | 686 | } |
---|
691 | 687 | EXPORT_SYMBOL_GPL(wm_hubs_update_class_w); |
---|
692 | 688 | |
---|