forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/sound/soc/codecs/ab8500-codec.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (C) ST-Ericsson SA 2012
34 *
....@@ -13,10 +14,6 @@
1314 * for ST-Ericsson.
1415 *
1516 * License terms:
16
- *
17
- * This program is free software; you can redistribute it and/or modify it
18
- * under the terms of the GNU General Public License version 2 as published
19
- * by the Free Software Foundation.
2017 */
2118
2219 #include <linux/kernel.h>
....@@ -1062,10 +1059,10 @@
10621059 snd_soc_component_update_bits(component, AB8500_ANCCONF1,
10631060 BIT(AB8500_ANCCONF1_ANCIIRINIT),
10641061 BIT(AB8500_ANCCONF1_ANCIIRINIT));
1065
- usleep_range(AB8500_ANC_SM_DELAY, AB8500_ANC_SM_DELAY);
1062
+ usleep_range(AB8500_ANC_SM_DELAY, AB8500_ANC_SM_DELAY*2);
10661063 snd_soc_component_update_bits(component, AB8500_ANCCONF1,
10671064 BIT(AB8500_ANCCONF1_ANCIIRINIT), 0);
1068
- usleep_range(AB8500_ANC_SM_DELAY, AB8500_ANC_SM_DELAY);
1065
+ usleep_range(AB8500_ANC_SM_DELAY, AB8500_ANC_SM_DELAY*2);
10691066 } else {
10701067 snd_soc_component_update_bits(component, AB8500_ANCCONF1,
10711068 BIT(AB8500_ANCCONF1_ANCIIRUPDATE),
....@@ -1103,7 +1100,7 @@
11031100 if (apply_fir)
11041101 for (bnk = 0; bnk < AB8500_NR_OF_ANC_COEFF_BANKS; bnk++)
11051102 for (par = 0; par < AB8500_ANC_FIR_COEFFS; par++) {
1106
- val = snd_soc_component_read32(component,
1103
+ val = snd_soc_component_read(component,
11071104 drvdata->anc_fir_values[par]);
11081105 anc_fir(component, bnk, par, val);
11091106 }
....@@ -1111,7 +1108,7 @@
11111108 if (apply_iir)
11121109 for (bnk = 0; bnk < AB8500_NR_OF_ANC_COEFF_BANKS; bnk++)
11131110 for (par = 0; par < AB8500_ANC_IIR_COEFFS; par++) {
1114
- val = snd_soc_component_read32(component,
1111
+ val = snd_soc_component_read(component,
11151112 drvdata->anc_iir_values[par]);
11161113 anc_iir(component, bnk, par, val);
11171114 }
....@@ -1156,7 +1153,7 @@
11561153
11571154 mutex_lock(&drvdata->ctrl_lock);
11581155
1159
- sidconf = snd_soc_component_read32(component, AB8500_SIDFIRCONF);
1156
+ sidconf = snd_soc_component_read(component, AB8500_SIDFIRCONF);
11601157 if (((sidconf & BIT(AB8500_SIDFIRCONF_FIRSIDBUSY)) != 0)) {
11611158 if ((sidconf & BIT(AB8500_SIDFIRCONF_ENFIRSIDS)) == 0) {
11621159 dev_err(component->dev, "%s: Sidetone busy while off!\n",
....@@ -1171,7 +1168,7 @@
11711168 snd_soc_component_write(component, AB8500_SIDFIRADR, 0);
11721169
11731170 for (param = 0; param < AB8500_SID_FIR_COEFFS; param++) {
1174
- val = snd_soc_component_read32(component, drvdata->sid_fir_values[param]);
1171
+ val = snd_soc_component_read(component, drvdata->sid_fir_values[param]);
11751172 snd_soc_component_write(component, AB8500_SIDFIRCOEF1, val >> 8 & 0xff);
11761173 snd_soc_component_write(component, AB8500_SIDFIRCOEF2, val & 0xff);
11771174 }
....@@ -2129,6 +2126,7 @@
21292126 dev_err(dai->component->dev,
21302127 "%s: ERROR: The device is either a master or a slave.\n",
21312128 __func__);
2129
+ fallthrough;
21322130 default:
21332131 dev_err(dai->component->dev,
21342132 "%s: ERROR: Unsupporter master mask 0x%x\n",