forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/sound/soc/codecs/es8328.c
....@@ -1,13 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * es8328.c -- ES8328 ALSA SoC Audio driver
34 *
45 * Copyright 2014 Sutajio Ko-Usagi PTE LTD
56 *
67 * 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.
118 */
129
1310 #include <linux/clk.h>
....@@ -112,7 +109,6 @@
112109
113110 static const DECLARE_TLV_DB_SCALE(play_tlv, -3000, 100, 0);
114111 static const DECLARE_TLV_DB_SCALE(dac_adc_tlv, -9600, 50, 0);
115
-static const DECLARE_TLV_DB_SCALE(pga_tlv, 0, 300, 0);
116112 static const DECLARE_TLV_DB_SCALE(bypass_tlv, -1500, 300, 0);
117113 static const DECLARE_TLV_DB_SCALE(mic_tlv, 0, 300, 0);
118114
....@@ -175,13 +171,16 @@
175171 if (deemph > 1)
176172 return -EINVAL;
177173
174
+ if (es8328->deemph == deemph)
175
+ return 0;
176
+
178177 ret = es8328_set_deemph(component);
179178 if (ret < 0)
180179 return ret;
181180
182181 es8328->deemph = deemph;
183182
184
- return 0;
183
+ return 1;
185184 }
186185
187186
....@@ -463,7 +462,7 @@
463462 { "ROUT2", NULL, "Right Out 2" },
464463 };
465464
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)
467466 {
468467 return snd_soc_component_update_bits(dai->component, ES8328_DACCONTROL3,
469468 ES8328_DACCONTROL3_DACMUTE,
....@@ -576,14 +575,14 @@
576575 break;
577576 case 22579200:
578577 mclkdiv2 = 1;
579
- /* fallthru */
578
+ fallthrough;
580579 case 11289600:
581580 es8328->sysclk_constraints = &constraints_11289;
582581 es8328->mclk_ratios = ratios_11289;
583582 break;
584583 case 24576000:
585584 mclkdiv2 = 1;
586
- /* fallthru */
585
+ fallthrough;
587586 case 12288000:
588587 es8328->sysclk_constraints = &constraints_12288;
589588 es8328->mclk_ratios = ratios_12288;
....@@ -591,7 +590,7 @@
591590
592591 case 24000000:
593592 mclkdiv2 = 1;
594
- /* fallthru */
593
+ fallthrough;
595594 case 12000000:
596595 es8328->sysclk_constraints = &constraints_12000;
597596 es8328->mclk_ratios = ratios_12000;
....@@ -714,9 +713,10 @@
714713 static const struct snd_soc_dai_ops es8328_dai_ops = {
715714 .startup = es8328_startup,
716715 .hw_params = es8328_hw_params,
717
- .digital_mute = es8328_mute,
716
+ .mute_stream = es8328_mute,
718717 .set_sysclk = es8328_set_sysclk,
719718 .set_fmt = es8328_set_dai_fmt,
719
+ .no_capture_mute = 1,
720720 };
721721
722722 static struct snd_soc_dai_driver es8328_dai = {
....@@ -842,7 +842,8 @@
842842 .val_bits = 8,
843843 .max_register = ES8328_REG_MAX,
844844 .cache_type = REGCACHE_RBTREE,
845
- .use_single_rw = true,
845
+ .use_single_read = true,
846
+ .use_single_write = true,
846847 };
847848 EXPORT_SYMBOL_GPL(es8328_regmap_config);
848849