| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * wm8988.c -- WM8988 ALSA SoC audio driver |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 5 | 6 | * Copyright 2005 Openedhand Ltd. |
|---|
| 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 | |
|---|
| 14 | 11 | #include <linux/module.h> |
|---|
| .. | .. |
|---|
| 245 | 242 | struct snd_kcontrol *kcontrol, int event) |
|---|
| 246 | 243 | { |
|---|
| 247 | 244 | struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); |
|---|
| 248 | | - u16 adctl2 = snd_soc_component_read32(component, WM8988_ADCTL2); |
|---|
| 245 | + u16 adctl2 = snd_soc_component_read(component, WM8988_ADCTL2); |
|---|
| 249 | 246 | |
|---|
| 250 | 247 | /* Use the DAC to gate LRC if active, otherwise use ADC */ |
|---|
| 251 | | - if (snd_soc_component_read32(component, WM8988_PWR2) & 0x180) |
|---|
| 248 | + if (snd_soc_component_read(component, WM8988_PWR2) & 0x180) |
|---|
| 252 | 249 | adctl2 &= ~0x4; |
|---|
| 253 | 250 | else |
|---|
| 254 | 251 | adctl2 |= 0x4; |
|---|
| .. | .. |
|---|
| 276 | 273 | wm8988_line_texts, |
|---|
| 277 | 274 | wm8988_line_values); |
|---|
| 278 | 275 | static const struct snd_kcontrol_new wm8988_right_line_controls = |
|---|
| 279 | | - SOC_DAPM_ENUM("Route", wm8988_lline_enum); |
|---|
| 276 | + SOC_DAPM_ENUM("Route", wm8988_rline_enum); |
|---|
| 280 | 277 | |
|---|
| 281 | 278 | /* Left Mixer */ |
|---|
| 282 | 279 | static const struct snd_kcontrol_new wm8988_left_mixer_controls[] = { |
|---|
| .. | .. |
|---|
| 670 | 667 | { |
|---|
| 671 | 668 | struct snd_soc_component *component = dai->component; |
|---|
| 672 | 669 | struct wm8988_priv *wm8988 = snd_soc_component_get_drvdata(component); |
|---|
| 673 | | - u16 iface = snd_soc_component_read32(component, WM8988_IFACE) & 0x1f3; |
|---|
| 674 | | - u16 srate = snd_soc_component_read32(component, WM8988_SRATE) & 0x180; |
|---|
| 670 | + u16 iface = snd_soc_component_read(component, WM8988_IFACE) & 0x1f3; |
|---|
| 671 | + u16 srate = snd_soc_component_read(component, WM8988_SRATE) & 0x180; |
|---|
| 675 | 672 | int coeff; |
|---|
| 676 | 673 | |
|---|
| 677 | 674 | coeff = get_coeff(wm8988->sysclk, params_rate(params)); |
|---|
| .. | .. |
|---|
| 710 | 707 | return 0; |
|---|
| 711 | 708 | } |
|---|
| 712 | 709 | |
|---|
| 713 | | -static int wm8988_mute(struct snd_soc_dai *dai, int mute) |
|---|
| 710 | +static int wm8988_mute(struct snd_soc_dai *dai, int mute, int direction) |
|---|
| 714 | 711 | { |
|---|
| 715 | 712 | struct snd_soc_component *component = dai->component; |
|---|
| 716 | | - u16 mute_reg = snd_soc_component_read32(component, WM8988_ADCDAC) & 0xfff7; |
|---|
| 713 | + u16 mute_reg = snd_soc_component_read(component, WM8988_ADCDAC) & 0xfff7; |
|---|
| 717 | 714 | |
|---|
| 718 | 715 | if (mute) |
|---|
| 719 | 716 | snd_soc_component_write(component, WM8988_ADCDAC, mute_reg | 0x8); |
|---|
| .. | .. |
|---|
| 726 | 723 | enum snd_soc_bias_level level) |
|---|
| 727 | 724 | { |
|---|
| 728 | 725 | struct wm8988_priv *wm8988 = snd_soc_component_get_drvdata(component); |
|---|
| 729 | | - u16 pwr_reg = snd_soc_component_read32(component, WM8988_PWR1) & ~0x1c1; |
|---|
| 726 | + u16 pwr_reg = snd_soc_component_read(component, WM8988_PWR1) & ~0x1c1; |
|---|
| 730 | 727 | |
|---|
| 731 | 728 | switch (level) { |
|---|
| 732 | 729 | case SND_SOC_BIAS_ON: |
|---|
| .. | .. |
|---|
| 769 | 766 | .hw_params = wm8988_pcm_hw_params, |
|---|
| 770 | 767 | .set_fmt = wm8988_set_dai_fmt, |
|---|
| 771 | 768 | .set_sysclk = wm8988_set_dai_sysclk, |
|---|
| 772 | | - .digital_mute = wm8988_mute, |
|---|
| 769 | + .mute_stream = wm8988_mute, |
|---|
| 770 | + .no_capture_mute = 1, |
|---|
| 773 | 771 | }; |
|---|
| 774 | 772 | |
|---|
| 775 | 773 | static struct snd_soc_dai_driver wm8988_dai = { |
|---|