forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/sound/soc/codecs/rt1305.c
....@@ -1,12 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * rt1305.c -- RT1305 ALSA SoC amplifier component driver
34 *
45 * Copyright 2018 Realtek Semiconductor Corp.
56 * Author: Shuming Fan <shumingf@realtek.com>
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License version 2 as
9
- * published by the Free Software Foundation.
107 */
118
129 #include <linux/module.h>
....@@ -414,7 +411,7 @@
414411 struct rt1305_priv *rt1305 = snd_soc_component_get_drvdata(component);
415412 unsigned int val;
416413
417
- snd_soc_component_read(component, RT1305_CLK_1, &val);
414
+ val = snd_soc_component_read(component, RT1305_CLK_1);
418415
419416 if (rt1305->sysclk_src == RT1305_FS_SYS_PRE_S_PLL1 &&
420417 (val & RT1305_SEL_PLL_SRC_2_RCCLK))
....@@ -611,7 +608,8 @@
611608
612609 static int rt1305_get_clk_info(int sclk, int rate)
613610 {
614
- int i, pd[] = {1, 2, 3, 4, 6, 8, 12, 16};
611
+ int i;
612
+ static const int pd[] = {1, 2, 3, 4, 6, 8, 12, 16};
615613
616614 if (sclk <= 0 || rate <= 0)
617615 return -EINVAL;
....@@ -963,7 +961,8 @@
963961 .num_reg_defaults = ARRAY_SIZE(rt1305_reg),
964962 .ranges = rt1305_ranges,
965963 .num_ranges = ARRAY_SIZE(rt1305_ranges),
966
- .use_single_rw = true,
964
+ .use_single_read = true,
965
+ .use_single_write = true,
967966 };
968967
969968 #if defined(CONFIG_OF)