aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm27xx/patches-4.19/950-0186-rpi-wm8804-soundcard-drop-PWRDN-register-writes.patch
blob: f73d9c96179a2ce6271860664189babdd029c016 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
From 31b533207610f0f703cfdcba3baf404d000f1363 Mon Sep 17 00:00:00 2001
From: Matthias Reichl <hias@horus.com>
Date: Sun, 18 Nov 2018 15:24:16 +0100
Subject: [PATCH] rpi-wm8804-soundcard: drop PWRDN register writes

Since kernel 4.0 the PWRDN register bits are under DAPM
control from the wm8804 driver.

Drop code that modifies that register to avoid interfering
with DAPM.

Signed-off-by: Matthias Reichl <hias@horus.com>
---
 sound/soc/bcm/rpi-wm8804-soundcard.c | 55 ----------------------------
 1 file changed, 55 deletions(-)

--- a/sound/soc/bcm/rpi-wm8804-soundcard.c
+++ b/sound/soc/bcm/rpi-wm8804-soundcard.c
@@ -54,8 +54,6 @@ struct snd_rpi_wm8804_drvdata {
 	struct snd_soc_dai_link *dai;
 	/* Required - snd_soc_card name */
 	const char *card_name;
-	/* Optional- Overrides the module paramter */
-	unsigned short auto_shutdown_output;
 	/* Optional DT node names if card info is defined in DT */
 	const char *card_name_dt;
 	const char *dai_name_dt;
@@ -64,51 +62,12 @@ struct snd_rpi_wm8804_drvdata {
 	int (*probe)(struct platform_device *pdev);
 };
 
-static short int auto_shutdown_output;
-module_param(auto_shutdown_output, short, 0660);
-MODULE_PARM_DESC(auto_shutdown_output, "Shutdown SP/DIF output if playback is stopped");
-
 static struct gpio_desc *snd_clk44gpio;
 static struct gpio_desc *snd_clk48gpio;
 
 #define CLK_44EN_RATE 22579200UL
 #define CLK_48EN_RATE 24576000UL
 
-static int snd_rpi_wm8804_init(struct snd_soc_pcm_runtime *rtd)
-{
-	struct snd_soc_component *component = rtd->codec_dai->component;
-	int rc;
-
-	pr_debug("%s\n", __func__);
-
-	rc = snd_soc_component_update_bits(component, WM8804_PWRDN, 0x4, 0x0);
-	return rc < 0 ? rc : 0;
-}
-
-static int snd_rpi_wm8804_digi_startup(struct snd_pcm_substream *substream)
-{
-	struct snd_soc_pcm_runtime *rtd = substream->private_data;
-	struct snd_soc_component *component = rtd->codec_dai->component;
-	int rc;
-
-	pr_debug("%s\n", __func__);
-
-	rc = snd_soc_component_update_bits(component, WM8804_PWRDN, 0x3c, 0x00);
-	return rc < 0 ? rc : 0;
-}
-
-static void snd_rpi_wm8804_digi_shutdown(struct snd_pcm_substream *substream)
-{
-	struct snd_soc_pcm_runtime *rtd = substream->private_data;
-	struct snd_soc_component *component = rtd->codec_dai->component;
-
-	pr_debug("%s %d\n", __func__, auto_shutdown_output);
-
-	if (auto_shutdown_output)
-		snd_soc_component_update_bits(component, WM8804_PWRDN,
-				0x3c, 0x3c);
-}
-
 static unsigned int snd_rpi_wm8804_enable_clock(unsigned int samplerate)
 {
 	switch (samplerate) {
@@ -204,12 +163,6 @@ static int snd_rpi_wm8804_hw_params(stru
 		return ret;
 	}
 
-	/* Enable TX output */
-	snd_soc_component_update_bits(component, WM8804_PWRDN, 0x4, 0x0);
-
-	/* Power on */
-	snd_soc_component_update_bits(component, WM8804_PWRDN, 0x9, 0);
-
 	/* set sampling frequency status bits */
 	snd_soc_component_update_bits(component, WM8804_SPDTX4, 0x0f,
 			sampling_freq);
@@ -219,8 +172,6 @@ static int snd_rpi_wm8804_hw_params(stru
 
 static struct snd_soc_ops snd_rpi_wm8804_ops = {
 	.hw_params = snd_rpi_wm8804_hw_params,
-	.startup   = snd_rpi_wm8804_digi_startup,
-	.shutdown  = snd_rpi_wm8804_digi_shutdown,
 };
 
 static struct snd_soc_dai_link snd_justboom_digi_dai[] = {
@@ -233,7 +184,6 @@ static struct snd_soc_dai_link snd_justb
 static struct snd_rpi_wm8804_drvdata drvdata_justboom_digi = {
 	.card_name            = "snd_rpi_justboom_digi",
 	.dai                  = snd_justboom_digi_dai,
-	.auto_shutdown_output = 1,
 };
 
 static struct snd_soc_dai_link snd_iqaudio_digi_dai[] = {
@@ -335,8 +285,6 @@ static int snd_rpi_wm8804_probe(struct p
 
 		snd_soc_card_set_drvdata(&snd_rpi_wm8804, drvdata);
 
-		if (!dai->init)
-			dai->init = snd_rpi_wm8804_init;
 		if (!dai->ops)
 			dai->ops = &snd_rpi_wm8804_ops;
 		if (!dai->codec_dai_name)
@@ -348,9 +296,6 @@ static int snd_rpi_wm8804_probe(struct p
 				SND_SOC_DAIFMT_NB_NF |
 				SND_SOC_DAIFMT_CBM_CFM;
 
-		if (drvdata->auto_shutdown_output)
-			auto_shutdown_output = 1;
-
 		snd_rpi_wm8804.dai_link = dai;
 		i2s_node = of_parse_phandle(pdev->dev.of_node,
 				"i2s-controller", 0);