hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/sound/soc/codecs/rt5640.c
....@@ -1,13 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * rt5640.c -- RT5640/RT5639 ALSA SoC audio codec driver
34 *
45 * Copyright 2011 Realtek Semiconductor Corp.
56 * Author: Johnny Hsu <johnnyhsu@realtek.com>
67 * Copyright (c) 2013, NVIDIA CORPORATION. All rights reserved.
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/module.h>
....@@ -977,11 +974,11 @@
977974 switch (event) {
978975 case SND_SOC_DAPM_POST_PMU:
979976 rt5640_pmu_depop(component);
980
- rt5640->hp_mute = 0;
977
+ rt5640->hp_mute = false;
981978 break;
982979
983980 case SND_SOC_DAPM_PRE_PMD:
984
- rt5640->hp_mute = 1;
981
+ rt5640->hp_mute = true;
985982 msleep(70);
986983 break;
987984
....@@ -1656,7 +1653,7 @@
16561653 if (component == NULL)
16571654 return -EINVAL;
16581655
1659
- val = snd_soc_component_read32(component, RT5640_I2S1_SDP);
1656
+ val = snd_soc_component_read(component, RT5640_I2S1_SDP);
16601657 val = (val & RT5640_I2S_IF_MASK) >> RT5640_I2S_IF_SFT;
16611658 switch (dai_id) {
16621659 case RT5640_AIF1:
....@@ -1667,7 +1664,7 @@
16671664 break;
16681665 case RT5640_IF_113:
16691666 ret |= RT5640_U_IF1;
1670
- /* fall through */
1667
+ fallthrough;
16711668 case RT5640_IF_312:
16721669 case RT5640_IF_213:
16731670 ret |= RT5640_U_IF2;
....@@ -1683,7 +1680,7 @@
16831680 break;
16841681 case RT5640_IF_223:
16851682 ret |= RT5640_U_IF1;
1686
- /* fall through */
1683
+ fallthrough;
16871684 case RT5640_IF_123:
16881685 case RT5640_IF_321:
16891686 ret |= RT5640_U_IF2;
....@@ -2086,7 +2083,7 @@
20862083 snd_soc_component_update_bits(component, RT5640_ASRC_2,
20872084 asrc2_mask, asrc2_value);
20882085
2089
- if (snd_soc_component_read32(component, RT5640_ASRC_2)) {
2086
+ if (snd_soc_component_read(component, RT5640_ASRC_2)) {
20902087 rt5640->asrc_en = true;
20912088 snd_soc_component_update_bits(component, RT5640_JD_CTRL, 0x3, 0x3);
20922089 } else {
....@@ -2151,7 +2148,7 @@
21512148 {
21522149 int val;
21532150
2154
- val = snd_soc_component_read32(component, RT5640_IRQ_CTRL2);
2151
+ val = snd_soc_component_read(component, RT5640_IRQ_CTRL2);
21552152 dev_dbg(component->dev, "irq ctrl2 %#04x\n", val);
21562153
21572154 return (val & RT5640_MB1_OC_STATUS);
....@@ -2162,7 +2159,7 @@
21622159 struct rt5640_priv *rt5640 = snd_soc_component_get_drvdata(component);
21632160 int val;
21642161
2165
- val = snd_soc_component_read32(component, RT5640_INT_IRQ_ST);
2162
+ val = snd_soc_component_read(component, RT5640_INT_IRQ_ST);
21662163 dev_dbg(component->dev, "irq status %#04x\n", val);
21672164
21682165 if (rt5640->jd_inverted)
....@@ -2489,7 +2486,7 @@
24892486 snd_soc_component_update_bits(component, RT5640_MICBIAS, 0x0030, 0x0030);
24902487 snd_soc_component_update_bits(component, RT5640_DSP_PATH2, 0xfc00, 0x0c00);
24912488
2492
- switch (snd_soc_component_read32(component, RT5640_RESET) & RT5640_ID_MASK) {
2489
+ switch (snd_soc_component_read(component, RT5640_RESET) & RT5640_ID_MASK) {
24932490 case RT5640_ID_5640:
24942491 case RT5640_ID_5642:
24952492 snd_soc_add_component_controls(component,
....@@ -2713,7 +2710,8 @@
27132710 static const struct regmap_config rt5640_regmap = {
27142711 .reg_bits = 8,
27152712 .val_bits = 16,
2716
- .use_single_rw = true,
2713
+ .use_single_read = true,
2714
+ .use_single_write = true,
27172715
27182716 .max_register = RT5640_VENDOR_ID2 + 1 + (ARRAY_SIZE(rt5640_ranges) *
27192717 RT5640_PR_SPACING),
....@@ -2830,7 +2828,7 @@
28302828 regmap_update_bits(rt5640->regmap, RT5640_DUMMY1,
28312829 RT5640_MCLK_DET, RT5640_MCLK_DET);
28322830
2833
- rt5640->hp_mute = 1;
2831
+ rt5640->hp_mute = true;
28342832 rt5640->irq = i2c->irq;
28352833 INIT_DELAYED_WORK(&rt5640->bp_work, rt5640_button_press_work);
28362834 INIT_WORK(&rt5640->jack_work, rt5640_jack_work);