| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * wm8978.c -- WM8978 ALSA SoC Audio Codec driver |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 5 | 6 | * Copyright (C) 2007 Carlos Munoz <carlos@kenati.com> |
|---|
| 6 | 7 | * Copyright 2006-2009 Wolfson Microelectronics PLC. |
|---|
| 7 | 8 | * Based on wm8974 and wm8990 by Liam Girdwood <lrg@slimlogic.co.uk> |
|---|
| 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> |
|---|
| .. | .. |
|---|
| 656 | 653 | * BCLK polarity mask = 0x100, LRC clock polarity mask = 0x80, |
|---|
| 657 | 654 | * Data Format mask = 0x18: all will be calculated anew |
|---|
| 658 | 655 | */ |
|---|
| 659 | | - u16 iface = snd_soc_component_read32(component, WM8978_AUDIO_INTERFACE) & ~0x198; |
|---|
| 660 | | - u16 clk = snd_soc_component_read32(component, WM8978_CLOCKING); |
|---|
| 656 | + u16 iface = snd_soc_component_read(component, WM8978_AUDIO_INTERFACE) & ~0x198; |
|---|
| 657 | + u16 clk = snd_soc_component_read(component, WM8978_CLOCKING); |
|---|
| 661 | 658 | |
|---|
| 662 | 659 | dev_dbg(component->dev, "%s\n", __func__); |
|---|
| 663 | 660 | |
|---|
| .. | .. |
|---|
| 723 | 720 | struct snd_soc_component *component = dai->component; |
|---|
| 724 | 721 | struct wm8978_priv *wm8978 = snd_soc_component_get_drvdata(component); |
|---|
| 725 | 722 | /* Word length mask = 0x60 */ |
|---|
| 726 | | - u16 iface_ctl = snd_soc_component_read32(component, WM8978_AUDIO_INTERFACE) & ~0x60; |
|---|
| 723 | + u16 iface_ctl = snd_soc_component_read(component, WM8978_AUDIO_INTERFACE) & ~0x60; |
|---|
| 727 | 724 | /* Sampling rate mask = 0xe (for filters) */ |
|---|
| 728 | | - u16 add_ctl = snd_soc_component_read32(component, WM8978_ADDITIONAL_CONTROL) & ~0xe; |
|---|
| 729 | | - u16 clking = snd_soc_component_read32(component, WM8978_CLOCKING); |
|---|
| 725 | + u16 add_ctl = snd_soc_component_read(component, WM8978_ADDITIONAL_CONTROL) & ~0xe; |
|---|
| 726 | + u16 clking = snd_soc_component_read(component, WM8978_CLOCKING); |
|---|
| 730 | 727 | enum wm8978_sysclk_src current_clk_id = clking & 0x100 ? |
|---|
| 731 | 728 | WM8978_PLL : WM8978_MCLK; |
|---|
| 732 | 729 | unsigned int f_sel, diff, diff_best = INT_MAX; |
|---|
| .. | .. |
|---|
| 839 | 836 | return 0; |
|---|
| 840 | 837 | } |
|---|
| 841 | 838 | |
|---|
| 842 | | -static int wm8978_mute(struct snd_soc_dai *dai, int mute) |
|---|
| 839 | +static int wm8978_mute(struct snd_soc_dai *dai, int mute, int direction) |
|---|
| 843 | 840 | { |
|---|
| 844 | 841 | struct snd_soc_component *component = dai->component; |
|---|
| 845 | 842 | |
|---|
| .. | .. |
|---|
| 856 | 853 | static int wm8978_set_bias_level(struct snd_soc_component *component, |
|---|
| 857 | 854 | enum snd_soc_bias_level level) |
|---|
| 858 | 855 | { |
|---|
| 859 | | - u16 power1 = snd_soc_component_read32(component, WM8978_POWER_MANAGEMENT_1) & ~3; |
|---|
| 856 | + u16 power1 = snd_soc_component_read(component, WM8978_POWER_MANAGEMENT_1) & ~3; |
|---|
| 860 | 857 | |
|---|
| 861 | 858 | switch (level) { |
|---|
| 862 | 859 | case SND_SOC_BIAS_ON: |
|---|
| .. | .. |
|---|
| 896 | 893 | |
|---|
| 897 | 894 | static const struct snd_soc_dai_ops wm8978_dai_ops = { |
|---|
| 898 | 895 | .hw_params = wm8978_hw_params, |
|---|
| 899 | | - .digital_mute = wm8978_mute, |
|---|
| 896 | + .mute_stream = wm8978_mute, |
|---|
| 900 | 897 | .set_fmt = wm8978_set_dai_fmt, |
|---|
| 901 | 898 | .set_clkdiv = wm8978_set_dai_clkdiv, |
|---|
| 902 | 899 | .set_sysclk = wm8978_set_dai_sysclk, |
|---|
| 900 | + .no_capture_mute = 1, |
|---|
| 903 | 901 | }; |
|---|
| 904 | 902 | |
|---|
| 905 | 903 | /* Also supports 12kHz */ |
|---|