hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/sound/soc/codecs/tas2552.c
....@@ -1,18 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * tas2552.c - ALSA SoC Texas Instruments TAS2552 Mono Audio Amplifier
34 *
4
- * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com
5
+ * Copyright (C) 2014 Texas Instruments Incorporated - https://www.ti.com
56 *
67 * Author: Dan Murphy <dmurphy@ti.com>
7
- *
8
- * This program is free software; you can redistribute it and/or
9
- * modify it under the terms of the GNU General Public License
10
- * version 2 as published by the Free Software Foundation.
11
- *
12
- * This program is distributed in the hope that it will be useful, but
13
- * WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
- * General Public License for more details.
168 */
179
1810 #include <linux/module.h>
....@@ -177,7 +169,7 @@
177169 pll_clkin += tas2552->tdm_delay;
178170 }
179171
180
- pll_enable = snd_soc_component_read32(component, TAS2552_CFG_2) & TAS2552_PLL_ENABLE;
172
+ pll_enable = snd_soc_component_read(component, TAS2552_CFG_2) & TAS2552_PLL_ENABLE;
181173 snd_soc_component_update_bits(component, TAS2552_CFG_2, TAS2552_PLL_ENABLE, 0);
182174
183175 if (pll_clkin == pll_clk)
....@@ -195,7 +187,7 @@
195187 unsigned int d, q, t;
196188 u8 j;
197189 u8 pll_sel = (tas2552->pll_clk_id << 3) & TAS2552_PLL_SRC_MASK;
198
- u8 p = snd_soc_component_read32(component, TAS2552_PLL_CTRL_1);
190
+ u8 p = snd_soc_component_read(component, TAS2552_PLL_CTRL_1);
199191
200192 p = (p >> 7);
201193
....@@ -415,7 +407,7 @@
415407 clk_id = TAS2552_PLL_CLKIN_BCLK;
416408 freq = 0;
417409 }
418
- /* fall through */
410
+ fallthrough;
419411 case TAS2552_PLL_CLKIN_BCLK:
420412 case TAS2552_PLL_CLKIN_1_8_FIXED:
421413 mask = TAS2552_PLL_SRC_MASK;
....@@ -473,7 +465,7 @@
473465 return 0;
474466 }
475467
476
-static int tas2552_mute(struct snd_soc_dai *dai, int mute)
468
+static int tas2552_mute(struct snd_soc_dai *dai, int mute, int direction)
477469 {
478470 u8 cfg1_reg = 0;
479471 struct snd_soc_component *component = dai->component;
....@@ -527,7 +519,8 @@
527519 .set_sysclk = tas2552_set_dai_sysclk,
528520 .set_fmt = tas2552_set_dai_fmt,
529521 .set_tdm_slot = tas2552_set_dai_tdm_slot,
530
- .digital_mute = tas2552_mute,
522
+ .mute_stream = tas2552_mute,
523
+ .no_capture_mute = 1,
531524 };
532525
533526 /* Formats supported by TAS2552 driver. */
....@@ -610,6 +603,7 @@
610603 return 0;
611604
612605 probe_fail:
606
+ pm_runtime_put_noidle(component->dev);
613607 gpiod_set_value(tas2552->enable_gpio, 0);
614608
615609 regulator_bulk_disable(ARRAY_SIZE(tas2552->supplies),