| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * wm8903.c -- WM8903 ALSA SoC Audio driver |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 5 | 6 | * Copyright 2011-2012 NVIDIA, Inc. |
|---|
| 6 | 7 | * |
|---|
| 7 | 8 | * Author: Mark Brown <broonie@opensource.wolfsonmicro.com> |
|---|
| 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 | 9 | * |
|---|
| 13 | 10 | * TODO: |
|---|
| 14 | 11 | * - TDM mode configuration. |
|---|
| .. | .. |
|---|
| 345 | 342 | if (!(wm8903->dcs_pending & (1 << i))) |
|---|
| 346 | 343 | continue; |
|---|
| 347 | 344 | |
|---|
| 348 | | - val = snd_soc_component_read32(component, |
|---|
| 345 | + val = snd_soc_component_read(component, |
|---|
| 349 | 346 | WM8903_DC_SERVO_READBACK_1 + i); |
|---|
| 350 | 347 | dev_dbg(component->dev, "DC servo %d: %x\n", |
|---|
| 351 | 348 | 3 - i, val); |
|---|
| .. | .. |
|---|
| 378 | 375 | u16 reg; |
|---|
| 379 | 376 | int ret; |
|---|
| 380 | 377 | |
|---|
| 381 | | - reg = snd_soc_component_read32(component, WM8903_CLASS_W_0); |
|---|
| 378 | + reg = snd_soc_component_read(component, WM8903_CLASS_W_0); |
|---|
| 382 | 379 | |
|---|
| 383 | 380 | /* Turn it off if we're about to enable bypass */ |
|---|
| 384 | 381 | if (ucontrol->value.integer.value[0]) { |
|---|
| .. | .. |
|---|
| 1227 | 1224 | unsigned int fmt) |
|---|
| 1228 | 1225 | { |
|---|
| 1229 | 1226 | struct snd_soc_component *component = codec_dai->component; |
|---|
| 1230 | | - u16 aif1 = snd_soc_component_read32(component, WM8903_AUDIO_INTERFACE_1); |
|---|
| 1227 | + u16 aif1 = snd_soc_component_read(component, WM8903_AUDIO_INTERFACE_1); |
|---|
| 1231 | 1228 | |
|---|
| 1232 | 1229 | aif1 &= ~(WM8903_LRCLK_DIR | WM8903_BCLK_DIR | WM8903_AIF_FMT_MASK | |
|---|
| 1233 | 1230 | WM8903_AIF_LRCLK_INV | WM8903_AIF_BCLK_INV); |
|---|
| .. | .. |
|---|
| 1310 | 1307 | return 0; |
|---|
| 1311 | 1308 | } |
|---|
| 1312 | 1309 | |
|---|
| 1313 | | -static int wm8903_digital_mute(struct snd_soc_dai *codec_dai, int mute) |
|---|
| 1310 | +static int wm8903_mute(struct snd_soc_dai *codec_dai, int mute, int direction) |
|---|
| 1314 | 1311 | { |
|---|
| 1315 | 1312 | struct snd_soc_component *component = codec_dai->component; |
|---|
| 1316 | 1313 | u16 reg; |
|---|
| 1317 | 1314 | |
|---|
| 1318 | | - reg = snd_soc_component_read32(component, WM8903_DAC_DIGITAL_1); |
|---|
| 1315 | + reg = snd_soc_component_read(component, WM8903_DAC_DIGITAL_1); |
|---|
| 1319 | 1316 | |
|---|
| 1320 | 1317 | if (mute) |
|---|
| 1321 | 1318 | reg |= WM8903_DAC_MUTE; |
|---|
| .. | .. |
|---|
| 1454 | 1451 | int cur_val; |
|---|
| 1455 | 1452 | int clk_sys; |
|---|
| 1456 | 1453 | |
|---|
| 1457 | | - u16 aif1 = snd_soc_component_read32(component, WM8903_AUDIO_INTERFACE_1); |
|---|
| 1458 | | - u16 aif2 = snd_soc_component_read32(component, WM8903_AUDIO_INTERFACE_2); |
|---|
| 1459 | | - u16 aif3 = snd_soc_component_read32(component, WM8903_AUDIO_INTERFACE_3); |
|---|
| 1460 | | - u16 clock0 = snd_soc_component_read32(component, WM8903_CLOCK_RATES_0); |
|---|
| 1461 | | - u16 clock1 = snd_soc_component_read32(component, WM8903_CLOCK_RATES_1); |
|---|
| 1462 | | - u16 dac_digital1 = snd_soc_component_read32(component, WM8903_DAC_DIGITAL_1); |
|---|
| 1454 | + u16 aif1 = snd_soc_component_read(component, WM8903_AUDIO_INTERFACE_1); |
|---|
| 1455 | + u16 aif2 = snd_soc_component_read(component, WM8903_AUDIO_INTERFACE_2); |
|---|
| 1456 | + u16 aif3 = snd_soc_component_read(component, WM8903_AUDIO_INTERFACE_3); |
|---|
| 1457 | + u16 clock0 = snd_soc_component_read(component, WM8903_CLOCK_RATES_0); |
|---|
| 1458 | + u16 clock1 = snd_soc_component_read(component, WM8903_CLOCK_RATES_1); |
|---|
| 1459 | + u16 dac_digital1 = snd_soc_component_read(component, WM8903_DAC_DIGITAL_1); |
|---|
| 1463 | 1460 | |
|---|
| 1464 | 1461 | /* Enable sloping stopband filter for low sample rates */ |
|---|
| 1465 | 1462 | if (fs <= 24000) |
|---|
| .. | .. |
|---|
| 1740 | 1737 | |
|---|
| 1741 | 1738 | static const struct snd_soc_dai_ops wm8903_dai_ops = { |
|---|
| 1742 | 1739 | .hw_params = wm8903_hw_params, |
|---|
| 1743 | | - .digital_mute = wm8903_digital_mute, |
|---|
| 1740 | + .mute_stream = wm8903_mute, |
|---|
| 1744 | 1741 | .set_fmt = wm8903_set_dai_fmt, |
|---|
| 1745 | 1742 | .set_sysclk = wm8903_set_dai_sysclk, |
|---|
| 1743 | + .no_capture_mute = 1, |
|---|
| 1746 | 1744 | }; |
|---|
| 1747 | 1745 | |
|---|
| 1748 | 1746 | static struct snd_soc_dai_driver wm8903_dai = { |
|---|
| .. | .. |
|---|
| 1930 | 1928 | * We assume the controller imposes no restrictions, |
|---|
| 1931 | 1929 | * so we are able to select active-high |
|---|
| 1932 | 1930 | */ |
|---|
| 1933 | | - /* Fall-through */ |
|---|
| 1931 | + fallthrough; |
|---|
| 1934 | 1932 | case IRQ_TYPE_LEVEL_HIGH: |
|---|
| 1935 | 1933 | pdata->irq_active_low = false; |
|---|
| 1936 | 1934 | break; |
|---|