| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * es8328.c -- ES8328 ALSA SoC Audio driver |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright 2014 Sutajio Ko-Usagi PTE LTD |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * Author: Sean Cross <xobs@kosagi.com> |
|---|
| 7 | | - * |
|---|
| 8 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 9 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 10 | | - * published by the Free Software Foundation. |
|---|
| 11 | 8 | */ |
|---|
| 12 | 9 | |
|---|
| 13 | 10 | #include <linux/clk.h> |
|---|
| .. | .. |
|---|
| 112 | 109 | |
|---|
| 113 | 110 | static const DECLARE_TLV_DB_SCALE(play_tlv, -3000, 100, 0); |
|---|
| 114 | 111 | static const DECLARE_TLV_DB_SCALE(dac_adc_tlv, -9600, 50, 0); |
|---|
| 115 | | -static const DECLARE_TLV_DB_SCALE(pga_tlv, 0, 300, 0); |
|---|
| 116 | 112 | static const DECLARE_TLV_DB_SCALE(bypass_tlv, -1500, 300, 0); |
|---|
| 117 | 113 | static const DECLARE_TLV_DB_SCALE(mic_tlv, 0, 300, 0); |
|---|
| 118 | 114 | |
|---|
| .. | .. |
|---|
| 175 | 171 | if (deemph > 1) |
|---|
| 176 | 172 | return -EINVAL; |
|---|
| 177 | 173 | |
|---|
| 174 | + if (es8328->deemph == deemph) |
|---|
| 175 | + return 0; |
|---|
| 176 | + |
|---|
| 178 | 177 | ret = es8328_set_deemph(component); |
|---|
| 179 | 178 | if (ret < 0) |
|---|
| 180 | 179 | return ret; |
|---|
| 181 | 180 | |
|---|
| 182 | 181 | es8328->deemph = deemph; |
|---|
| 183 | 182 | |
|---|
| 184 | | - return 0; |
|---|
| 183 | + return 1; |
|---|
| 185 | 184 | } |
|---|
| 186 | 185 | |
|---|
| 187 | 186 | |
|---|
| .. | .. |
|---|
| 463 | 462 | { "ROUT2", NULL, "Right Out 2" }, |
|---|
| 464 | 463 | }; |
|---|
| 465 | 464 | |
|---|
| 466 | | -static int es8328_mute(struct snd_soc_dai *dai, int mute) |
|---|
| 465 | +static int es8328_mute(struct snd_soc_dai *dai, int mute, int direction) |
|---|
| 467 | 466 | { |
|---|
| 468 | 467 | return snd_soc_component_update_bits(dai->component, ES8328_DACCONTROL3, |
|---|
| 469 | 468 | ES8328_DACCONTROL3_DACMUTE, |
|---|
| .. | .. |
|---|
| 576 | 575 | break; |
|---|
| 577 | 576 | case 22579200: |
|---|
| 578 | 577 | mclkdiv2 = 1; |
|---|
| 579 | | - /* fallthru */ |
|---|
| 578 | + fallthrough; |
|---|
| 580 | 579 | case 11289600: |
|---|
| 581 | 580 | es8328->sysclk_constraints = &constraints_11289; |
|---|
| 582 | 581 | es8328->mclk_ratios = ratios_11289; |
|---|
| 583 | 582 | break; |
|---|
| 584 | 583 | case 24576000: |
|---|
| 585 | 584 | mclkdiv2 = 1; |
|---|
| 586 | | - /* fallthru */ |
|---|
| 585 | + fallthrough; |
|---|
| 587 | 586 | case 12288000: |
|---|
| 588 | 587 | es8328->sysclk_constraints = &constraints_12288; |
|---|
| 589 | 588 | es8328->mclk_ratios = ratios_12288; |
|---|
| .. | .. |
|---|
| 591 | 590 | |
|---|
| 592 | 591 | case 24000000: |
|---|
| 593 | 592 | mclkdiv2 = 1; |
|---|
| 594 | | - /* fallthru */ |
|---|
| 593 | + fallthrough; |
|---|
| 595 | 594 | case 12000000: |
|---|
| 596 | 595 | es8328->sysclk_constraints = &constraints_12000; |
|---|
| 597 | 596 | es8328->mclk_ratios = ratios_12000; |
|---|
| .. | .. |
|---|
| 714 | 713 | static const struct snd_soc_dai_ops es8328_dai_ops = { |
|---|
| 715 | 714 | .startup = es8328_startup, |
|---|
| 716 | 715 | .hw_params = es8328_hw_params, |
|---|
| 717 | | - .digital_mute = es8328_mute, |
|---|
| 716 | + .mute_stream = es8328_mute, |
|---|
| 718 | 717 | .set_sysclk = es8328_set_sysclk, |
|---|
| 719 | 718 | .set_fmt = es8328_set_dai_fmt, |
|---|
| 719 | + .no_capture_mute = 1, |
|---|
| 720 | 720 | }; |
|---|
| 721 | 721 | |
|---|
| 722 | 722 | static struct snd_soc_dai_driver es8328_dai = { |
|---|
| .. | .. |
|---|
| 842 | 842 | .val_bits = 8, |
|---|
| 843 | 843 | .max_register = ES8328_REG_MAX, |
|---|
| 844 | 844 | .cache_type = REGCACHE_RBTREE, |
|---|
| 845 | | - .use_single_rw = true, |
|---|
| 845 | + .use_single_read = true, |
|---|
| 846 | + .use_single_write = true, |
|---|
| 846 | 847 | }; |
|---|
| 847 | 848 | EXPORT_SYMBOL_GPL(es8328_regmap_config); |
|---|
| 848 | 849 | |
|---|