forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/sound/soc/codecs/da7218.c
....@@ -1,14 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * da7218.c - DA7218 ALSA SoC Codec Driver
34 *
45 * Copyright (c) 2015 Dialog Semiconductor
56 *
67 * Author: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
7
- *
8
- * This program is free software; you can redistribute it and/or modify it
9
- * under the terms of the GNU General Public License as published by the
10
- * Free Software Foundation; either version 2 of the License, or (at your
11
- * option) any later version.
128 */
139
1410 #include <linux/clk.h>
....@@ -302,22 +298,22 @@
302298 bool calibrated = false;
303299
304300 /* Save current state of MIC control registers */
305
- mic_1_ctrl = snd_soc_component_read32(component, DA7218_MIC_1_CTRL);
306
- mic_2_ctrl = snd_soc_component_read32(component, DA7218_MIC_2_CTRL);
301
+ mic_1_ctrl = snd_soc_component_read(component, DA7218_MIC_1_CTRL);
302
+ mic_2_ctrl = snd_soc_component_read(component, DA7218_MIC_2_CTRL);
307303
308304 /* Save current state of input mixer control registers */
309
- mixin_1_ctrl = snd_soc_component_read32(component, DA7218_MIXIN_1_CTRL);
310
- mixin_2_ctrl = snd_soc_component_read32(component, DA7218_MIXIN_2_CTRL);
305
+ mixin_1_ctrl = snd_soc_component_read(component, DA7218_MIXIN_1_CTRL);
306
+ mixin_2_ctrl = snd_soc_component_read(component, DA7218_MIXIN_2_CTRL);
311307
312308 /* Save current state of input filter control registers */
313
- in_1l_filt_ctrl = snd_soc_component_read32(component, DA7218_IN_1L_FILTER_CTRL);
314
- in_1r_filt_ctrl = snd_soc_component_read32(component, DA7218_IN_1R_FILTER_CTRL);
315
- in_2l_filt_ctrl = snd_soc_component_read32(component, DA7218_IN_2L_FILTER_CTRL);
316
- in_2r_filt_ctrl = snd_soc_component_read32(component, DA7218_IN_2R_FILTER_CTRL);
309
+ in_1l_filt_ctrl = snd_soc_component_read(component, DA7218_IN_1L_FILTER_CTRL);
310
+ in_1r_filt_ctrl = snd_soc_component_read(component, DA7218_IN_1R_FILTER_CTRL);
311
+ in_2l_filt_ctrl = snd_soc_component_read(component, DA7218_IN_2L_FILTER_CTRL);
312
+ in_2r_filt_ctrl = snd_soc_component_read(component, DA7218_IN_2R_FILTER_CTRL);
317313
318314 /* Save current state of input HPF control registers */
319
- in_1_hpf_ctrl = snd_soc_component_read32(component, DA7218_IN_1_HPF_FILTER_CTRL);
320
- in_2_hpf_ctrl = snd_soc_component_read32(component, DA7218_IN_2_HPF_FILTER_CTRL);
315
+ in_1_hpf_ctrl = snd_soc_component_read(component, DA7218_IN_1_HPF_FILTER_CTRL);
316
+ in_2_hpf_ctrl = snd_soc_component_read(component, DA7218_IN_2_HPF_FILTER_CTRL);
321317
322318 /* Enable then Mute MIC PGAs */
323319 snd_soc_component_update_bits(component, DA7218_MIC_1_CTRL, DA7218_MIC_1_AMP_EN_MASK,
....@@ -373,7 +369,7 @@
373369 snd_soc_component_update_bits(component, DA7218_CALIB_CTRL, DA7218_CALIB_AUTO_EN_MASK,
374370 DA7218_CALIB_AUTO_EN_MASK);
375371 do {
376
- calib_ctrl = snd_soc_component_read32(component, DA7218_CALIB_CTRL);
372
+ calib_ctrl = snd_soc_component_read(component, DA7218_CALIB_CTRL);
377373 if (calib_ctrl & DA7218_CALIB_AUTO_EN_MASK) {
378374 ++i;
379375 usleep_range(DA7218_ALC_CALIB_DELAY_MIN,
....@@ -617,7 +613,7 @@
617613 }
618614
619615 /* Make sure at least out filter1 enabled to allow programming */
620
- out_filt1l = snd_soc_component_read32(component, DA7218_OUT_1L_FILTER_CTRL);
616
+ out_filt1l = snd_soc_component_read(component, DA7218_OUT_1L_FILTER_CTRL);
621617 snd_soc_component_write(component, DA7218_OUT_1L_FILTER_CTRL,
622618 out_filt1l | DA7218_OUT_1L_FILTER_EN_MASK);
623619
....@@ -1423,7 +1419,7 @@
14231419 i = 0;
14241420 success = false;
14251421 do {
1426
- refosc_cal = snd_soc_component_read32(component, DA7218_PLL_REFOSC_CAL);
1422
+ refosc_cal = snd_soc_component_read(component, DA7218_PLL_REFOSC_CAL);
14271423 if (!(refosc_cal & DA7218_PLL_REFOSC_CAL_START_MASK)) {
14281424 success = true;
14291425 } else {
....@@ -1442,7 +1438,7 @@
14421438 DA7218_PC_RESYNC_AUTO_MASK);
14431439
14441440 /* If SRM not enabled, we don't need to check status */
1445
- pll_ctrl = snd_soc_component_read32(component, DA7218_PLL_CTRL);
1441
+ pll_ctrl = snd_soc_component_read(component, DA7218_PLL_CTRL);
14461442 if ((pll_ctrl & DA7218_PLL_MODE_MASK) != DA7218_PLL_MODE_SRM)
14471443 return 0;
14481444
....@@ -1450,7 +1446,7 @@
14501446 i = 0;
14511447 success = false;
14521448 do {
1453
- pll_status = snd_soc_component_read32(component, DA7218_PLL_STATUS);
1449
+ pll_status = snd_soc_component_read(component, DA7218_PLL_STATUS);
14541450 if (pll_status & DA7218_PLL_SRM_STATUS_SRM_LOCK) {
14551451 success = true;
14561452 } else {
....@@ -2240,7 +2236,7 @@
22402236 u8 jack_status;
22412237 int report;
22422238
2243
- jack_status = snd_soc_component_read32(component, DA7218_EVENT_STATUS);
2239
+ jack_status = snd_soc_component_read(component, DA7218_EVENT_STATUS);
22442240
22452241 if (jack_status & DA7218_HPLDET_JACK_STS_MASK)
22462242 report = SND_JACK_HEADPHONE;
....@@ -2260,7 +2256,7 @@
22602256 u8 status;
22612257
22622258 /* Read IRQ status reg */
2263
- status = snd_soc_component_read32(component, DA7218_EVENT);
2259
+ status = snd_soc_component_read(component, DA7218_EVENT);
22642260 if (!status)
22652261 return IRQ_NONE;
22662262