1 From 31b533207610f0f703cfdcba3baf404d000f1363 Mon Sep 17 00:00:00 2001
2 From: Matthias Reichl <hias@horus.com>
3 Date: Sun, 18 Nov 2018 15:24:16 +0100
4 Subject: [PATCH] rpi-wm8804-soundcard: drop PWRDN register writes
6 Since kernel 4.0 the PWRDN register bits are under DAPM
7 control from the wm8804 driver.
9 Drop code that modifies that register to avoid interfering
12 Signed-off-by: Matthias Reichl <hias@horus.com>
14 sound/soc/bcm/rpi-wm8804-soundcard.c | 55 ----------------------------
15 1 file changed, 55 deletions(-)
17 --- a/sound/soc/bcm/rpi-wm8804-soundcard.c
18 +++ b/sound/soc/bcm/rpi-wm8804-soundcard.c
19 @@ -54,8 +54,6 @@ struct snd_rpi_wm8804_drvdata {
20 struct snd_soc_dai_link *dai;
21 /* Required - snd_soc_card name */
22 const char *card_name;
23 - /* Optional- Overrides the module paramter */
24 - unsigned short auto_shutdown_output;
25 /* Optional DT node names if card info is defined in DT */
26 const char *card_name_dt;
27 const char *dai_name_dt;
28 @@ -64,51 +62,12 @@ struct snd_rpi_wm8804_drvdata {
29 int (*probe)(struct platform_device *pdev);
32 -static short int auto_shutdown_output;
33 -module_param(auto_shutdown_output, short, 0660);
34 -MODULE_PARM_DESC(auto_shutdown_output, "Shutdown SP/DIF output if playback is stopped");
36 static struct gpio_desc *snd_clk44gpio;
37 static struct gpio_desc *snd_clk48gpio;
39 #define CLK_44EN_RATE 22579200UL
40 #define CLK_48EN_RATE 24576000UL
42 -static int snd_rpi_wm8804_init(struct snd_soc_pcm_runtime *rtd)
44 - struct snd_soc_component *component = rtd->codec_dai->component;
47 - pr_debug("%s\n", __func__);
49 - rc = snd_soc_component_update_bits(component, WM8804_PWRDN, 0x4, 0x0);
50 - return rc < 0 ? rc : 0;
53 -static int snd_rpi_wm8804_digi_startup(struct snd_pcm_substream *substream)
55 - struct snd_soc_pcm_runtime *rtd = substream->private_data;
56 - struct snd_soc_component *component = rtd->codec_dai->component;
59 - pr_debug("%s\n", __func__);
61 - rc = snd_soc_component_update_bits(component, WM8804_PWRDN, 0x3c, 0x00);
62 - return rc < 0 ? rc : 0;
65 -static void snd_rpi_wm8804_digi_shutdown(struct snd_pcm_substream *substream)
67 - struct snd_soc_pcm_runtime *rtd = substream->private_data;
68 - struct snd_soc_component *component = rtd->codec_dai->component;
70 - pr_debug("%s %d\n", __func__, auto_shutdown_output);
72 - if (auto_shutdown_output)
73 - snd_soc_component_update_bits(component, WM8804_PWRDN,
77 static unsigned int snd_rpi_wm8804_enable_clock(unsigned int samplerate)
80 @@ -204,12 +163,6 @@ static int snd_rpi_wm8804_hw_params(stru
84 - /* Enable TX output */
85 - snd_soc_component_update_bits(component, WM8804_PWRDN, 0x4, 0x0);
88 - snd_soc_component_update_bits(component, WM8804_PWRDN, 0x9, 0);
90 /* set sampling frequency status bits */
91 snd_soc_component_update_bits(component, WM8804_SPDTX4, 0x0f,
93 @@ -219,8 +172,6 @@ static int snd_rpi_wm8804_hw_params(stru
95 static struct snd_soc_ops snd_rpi_wm8804_ops = {
96 .hw_params = snd_rpi_wm8804_hw_params,
97 - .startup = snd_rpi_wm8804_digi_startup,
98 - .shutdown = snd_rpi_wm8804_digi_shutdown,
101 static struct snd_soc_dai_link snd_justboom_digi_dai[] = {
102 @@ -233,7 +184,6 @@ static struct snd_soc_dai_link snd_justb
103 static struct snd_rpi_wm8804_drvdata drvdata_justboom_digi = {
104 .card_name = "snd_rpi_justboom_digi",
105 .dai = snd_justboom_digi_dai,
106 - .auto_shutdown_output = 1,
109 static struct snd_soc_dai_link snd_iqaudio_digi_dai[] = {
110 @@ -335,8 +285,6 @@ static int snd_rpi_wm8804_probe(struct p
112 snd_soc_card_set_drvdata(&snd_rpi_wm8804, drvdata);
115 - dai->init = snd_rpi_wm8804_init;
117 dai->ops = &snd_rpi_wm8804_ops;
118 if (!dai->codec_dai_name)
119 @@ -348,9 +296,6 @@ static int snd_rpi_wm8804_probe(struct p
120 SND_SOC_DAIFMT_NB_NF |
121 SND_SOC_DAIFMT_CBM_CFM;
123 - if (drvdata->auto_shutdown_output)
124 - auto_shutdown_output = 1;
126 snd_rpi_wm8804.dai_link = dai;
127 i2s_node = of_parse_phandle(pdev->dev.of_node,
128 "i2s-controller", 0);