| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * wm8971.c -- WM8971 ALSA SoC Audio driver |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 6 | 7 | * Author: Kenneth Kiraly <kiraly@lab126.com> |
|---|
| 7 | 8 | * |
|---|
| 8 | 9 | * Based on wm8753.c by Liam Girdwood |
|---|
| 9 | | - * |
|---|
| 10 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 11 | | - * under the terms of the GNU General Public License as published by the |
|---|
| 12 | | - * Free Software Foundation; either version 2 of the License, or (at your |
|---|
| 13 | | - * option) any later version. |
|---|
| 14 | 10 | */ |
|---|
| 15 | 11 | |
|---|
| 16 | 12 | #include <linux/module.h> |
|---|
| .. | .. |
|---|
| 512 | 508 | { |
|---|
| 513 | 509 | struct snd_soc_component *component = dai->component; |
|---|
| 514 | 510 | struct wm8971_priv *wm8971 = snd_soc_component_get_drvdata(component); |
|---|
| 515 | | - u16 iface = snd_soc_component_read32(component, WM8971_IFACE) & 0x1f3; |
|---|
| 516 | | - u16 srate = snd_soc_component_read32(component, WM8971_SRATE) & 0x1c0; |
|---|
| 511 | + u16 iface = snd_soc_component_read(component, WM8971_IFACE) & 0x1f3; |
|---|
| 512 | + u16 srate = snd_soc_component_read(component, WM8971_SRATE) & 0x1c0; |
|---|
| 517 | 513 | int coeff = get_coeff(wm8971->sysclk, params_rate(params)); |
|---|
| 518 | 514 | |
|---|
| 519 | 515 | /* bit size */ |
|---|
| .. | .. |
|---|
| 540 | 536 | return 0; |
|---|
| 541 | 537 | } |
|---|
| 542 | 538 | |
|---|
| 543 | | -static int wm8971_mute(struct snd_soc_dai *dai, int mute) |
|---|
| 539 | +static int wm8971_mute(struct snd_soc_dai *dai, int mute, int direction) |
|---|
| 544 | 540 | { |
|---|
| 545 | 541 | struct snd_soc_component *component = dai->component; |
|---|
| 546 | | - u16 mute_reg = snd_soc_component_read32(component, WM8971_ADCDAC) & 0xfff7; |
|---|
| 542 | + u16 mute_reg = snd_soc_component_read(component, WM8971_ADCDAC) & 0xfff7; |
|---|
| 547 | 543 | |
|---|
| 548 | 544 | if (mute) |
|---|
| 549 | 545 | snd_soc_component_write(component, WM8971_ADCDAC, mute_reg | 0x8); |
|---|
| .. | .. |
|---|
| 565 | 561 | enum snd_soc_bias_level level) |
|---|
| 566 | 562 | { |
|---|
| 567 | 563 | struct wm8971_priv *wm8971 = snd_soc_component_get_drvdata(component); |
|---|
| 568 | | - u16 pwr_reg = snd_soc_component_read32(component, WM8971_PWR1) & 0xfe3e; |
|---|
| 564 | + u16 pwr_reg = snd_soc_component_read(component, WM8971_PWR1) & 0xfe3e; |
|---|
| 569 | 565 | |
|---|
| 570 | 566 | switch (level) { |
|---|
| 571 | 567 | case SND_SOC_BIAS_ON: |
|---|
| .. | .. |
|---|
| 606 | 602 | |
|---|
| 607 | 603 | static const struct snd_soc_dai_ops wm8971_dai_ops = { |
|---|
| 608 | 604 | .hw_params = wm8971_pcm_hw_params, |
|---|
| 609 | | - .digital_mute = wm8971_mute, |
|---|
| 605 | + .mute_stream = wm8971_mute, |
|---|
| 610 | 606 | .set_fmt = wm8971_set_dai_fmt, |
|---|
| 611 | 607 | .set_sysclk = wm8971_set_dai_sysclk, |
|---|
| 608 | + .no_capture_mute = 1, |
|---|
| 612 | 609 | }; |
|---|
| 613 | 610 | |
|---|
| 614 | 611 | static struct snd_soc_dai_driver wm8971_dai = { |
|---|