| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * wm8711.c -- WM8711 ALSA SoC Audio driver |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 6 | 7 | * Author: Mike Arthur <Mike.Arthur@wolfsonmicro.com> |
|---|
| 7 | 8 | * |
|---|
| 8 | 9 | * Based on wm8731.c by Richard Purdie |
|---|
| 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. |
|---|
| 13 | 10 | */ |
|---|
| 14 | 11 | |
|---|
| 15 | 12 | #include <linux/module.h> |
|---|
| .. | .. |
|---|
| 161 | 158 | { |
|---|
| 162 | 159 | struct snd_soc_component *component = dai->component; |
|---|
| 163 | 160 | struct wm8711_priv *wm8711 = snd_soc_component_get_drvdata(component); |
|---|
| 164 | | - u16 iface = snd_soc_component_read32(component, WM8711_IFACE) & 0xfff3; |
|---|
| 161 | + u16 iface = snd_soc_component_read(component, WM8711_IFACE) & 0xfff3; |
|---|
| 165 | 162 | int i = get_coeff(wm8711->sysclk, params_rate(params)); |
|---|
| 166 | 163 | u16 srate = (coeff_div[i].sr << 2) | |
|---|
| 167 | 164 | (coeff_div[i].bosr << 1) | coeff_div[i].usb; |
|---|
| .. | .. |
|---|
| 201 | 198 | struct snd_soc_component *component = dai->component; |
|---|
| 202 | 199 | |
|---|
| 203 | 200 | /* deactivate */ |
|---|
| 204 | | - if (!snd_soc_component_is_active(component)) { |
|---|
| 201 | + if (!snd_soc_component_active(component)) { |
|---|
| 205 | 202 | udelay(50); |
|---|
| 206 | 203 | snd_soc_component_write(component, WM8711_ACTIVE, 0x0); |
|---|
| 207 | 204 | } |
|---|
| 208 | 205 | } |
|---|
| 209 | 206 | |
|---|
| 210 | | -static int wm8711_mute(struct snd_soc_dai *dai, int mute) |
|---|
| 207 | +static int wm8711_mute(struct snd_soc_dai *dai, int mute, int direction) |
|---|
| 211 | 208 | { |
|---|
| 212 | 209 | struct snd_soc_component *component = dai->component; |
|---|
| 213 | | - u16 mute_reg = snd_soc_component_read32(component, WM8711_APDIGI) & 0xfff7; |
|---|
| 210 | + u16 mute_reg = snd_soc_component_read(component, WM8711_APDIGI) & 0xfff7; |
|---|
| 214 | 211 | |
|---|
| 215 | 212 | if (mute) |
|---|
| 216 | 213 | snd_soc_component_write(component, WM8711_APDIGI, mute_reg | 0x8); |
|---|
| .. | .. |
|---|
| 242 | 239 | unsigned int fmt) |
|---|
| 243 | 240 | { |
|---|
| 244 | 241 | struct snd_soc_component *component = codec_dai->component; |
|---|
| 245 | | - u16 iface = snd_soc_component_read32(component, WM8711_IFACE) & 0x000c; |
|---|
| 242 | + u16 iface = snd_soc_component_read(component, WM8711_IFACE) & 0x000c; |
|---|
| 246 | 243 | |
|---|
| 247 | 244 | /* set master/slave audio interface */ |
|---|
| 248 | 245 | switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { |
|---|
| .. | .. |
|---|
| 301 | 298 | enum snd_soc_bias_level level) |
|---|
| 302 | 299 | { |
|---|
| 303 | 300 | struct wm8711_priv *wm8711 = snd_soc_component_get_drvdata(component); |
|---|
| 304 | | - u16 reg = snd_soc_component_read32(component, WM8711_PWR) & 0xff7f; |
|---|
| 301 | + u16 reg = snd_soc_component_read(component, WM8711_PWR) & 0xff7f; |
|---|
| 305 | 302 | |
|---|
| 306 | 303 | switch (level) { |
|---|
| 307 | 304 | case SND_SOC_BIAS_ON: |
|---|
| .. | .. |
|---|
| 332 | 329 | .prepare = wm8711_pcm_prepare, |
|---|
| 333 | 330 | .hw_params = wm8711_hw_params, |
|---|
| 334 | 331 | .shutdown = wm8711_shutdown, |
|---|
| 335 | | - .digital_mute = wm8711_mute, |
|---|
| 332 | + .mute_stream = wm8711_mute, |
|---|
| 336 | 333 | .set_sysclk = wm8711_set_dai_sysclk, |
|---|
| 337 | 334 | .set_fmt = wm8711_set_dai_fmt, |
|---|
| 335 | + .no_capture_mute = 1, |
|---|
| 338 | 336 | }; |
|---|
| 339 | 337 | |
|---|
| 340 | 338 | static struct snd_soc_dai_driver wm8711_dai = { |
|---|