Skip to contentSkip to conversation

ASoC: AMD: Use single dai for da7219 playback and capture

PATCH Superseded Akshu Agrawal 3 participants 12 messages Mar 12, 2018 – Apr 26, 2018

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ASoC: AMD: Use single dai for da7219 playback and capture

BT I2S is a bi-directional dai, we will use the same cpu dai for playback and capture.

TEST=Build, apply grunt_mixer_settings:
iotools mmio_write32 0xfed80e40 0x040c40c0
iotools mmio_write32 0xfed80e28 0x10000
aplay -D hw:0,0 -vv <file>
arecord -D hw:0,0 -f dat -d 5 -vv <file>

---
 sound/soc/amd/acp-da7219-max98357a.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)
sound/soc/amd/acp-da7219-max98357a.c +2 -12
index bbe0f10..d07c2a1 100644
@@ -124,8 +124,8 @@ static int cz_fe_startup(struct snd_pcm_substream *substream)
 
 static struct snd_soc_dai_link cz_dai_7219_98357[] = {
 	{
-		.name = "amd-da7219-play",
-		.stream_name = "Playback",
+		.name = "amd-da7219-play-cap",
+		.stream_name = "Playback and Capture",
 		.platform_name = "acp_audio_dma.0.auto",
 		.cpu_dai_name = "designware-i2s.3.auto",
 		.codec_dai_name = "da7219-hifi",
@@ -134,16 +134,6 @@ static int cz_fe_startup(struct snd_pcm_substream *substream)
 				| SND_SOC_DAIFMT_CBM_CFM,
 		.init = cz_da7219_init,
 		.dpcm_playback = 1,
-	},
-	{
-		.name = "amd-da7219-cap",
-		.stream_name = "Capture",
-		.platform_name = "acp_audio_dma.0.auto",
-		.cpu_dai_name = "designware-i2s.4.auto",
-		.codec_dai_name = "da7219-hifi",
-		.codec_name = "i2c-DLGS7219:00",
-		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
-				| SND_SOC_DAIFMT_CBM_CFM,
 		.dpcm_capture = 1,
 		.ops = &cz_da7219_cap_ops,
 	},
Signature · 1 line
1.9.1
#1 lore raw

PATCH 2/2 ASoC: AMD: Enable da7219 master clock using common clock framework

DA7219 is clock master for other codecs. DA7219 has exposed clock control by using common clock framework and same is used to enable and disable clock for all codecs in the system.

TEST=Build, apply grunt_mixer_settings:
iotools mmio_write32 0xfed80e40 0x040c40c0
iotools mmio_write32 0xfed80e28 0x10000
aplay -D hw:0,0 -vv <file>
arecord -D hw:0,0 -f dat -d 5 -vv <file>
aplay -D hw:0,1 -vv <file>

---
 sound/soc/amd/acp-da7219-max98357a.c | 41 ++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
sound/soc/amd/acp-da7219-max98357a.c +41 -0
index d07c2a1..1441be3 100644
@@ -42,6 +42,7 @@
 #define DUAL_CHANNEL		2
 
 static struct snd_soc_jack cz_jack;
+struct clk *da7219_dai_clk;
 
 static int cz_da7219_init(struct snd_soc_pcm_runtime *rtd)
 {
@@ -66,6 +67,8 @@ static int cz_da7219_init(struct snd_soc_pcm_runtime *rtd)
 		return ret;
 	}
 
+	da7219_dai_clk = clk_get(codec->dev, "da7219-dai-clks");
+
 	ret = snd_soc_card_jack_new(card, "Headset Jack",
 				SND_JACK_HEADPHONE | SND_JACK_MICROPHONE |
 				SND_JACK_BTN_0 | SND_JACK_BTN_1 |
@@ -81,6 +84,30 @@ static int cz_da7219_init(struct snd_soc_pcm_runtime *rtd)
 	return 0;
 }
 
+static int cz_da7219_hw_params(struct snd_pcm_substream *substream,
+			     struct snd_pcm_hw_params *params)
+{
+	int ret = 0;
+	struct snd_soc_pcm_runtime *rtd = substream->private_data;
+
+	ret = clk_prepare_enable(da7219_dai_clk);
+	if (ret < 0) {
+		dev_err(rtd->dev, "can't enable master clock %d\n", ret);
+		return ret;
+	}
+
+	return ret;
+}
+
+static int cz_da7219_hw_free(struct snd_pcm_substream *substream)
+{
+	int ret = 0;
+
+	clk_disable_unprepare(da7219_dai_clk);
+
+	return ret;
+}
+
 static const unsigned int channels[] = {
 	DUAL_CHANNEL,
 };
@@ -119,9 +146,21 @@ static int cz_fe_startup(struct snd_pcm_substream *substream)
 }
 
 static struct snd_soc_ops cz_da7219_cap_ops = {
+	.hw_params = cz_da7219_hw_params,
+	.hw_free = cz_da7219_hw_free,
 	.startup = cz_fe_startup,
 };
 
+static struct snd_soc_ops cz_max_play_ops = {
+	.hw_params = cz_da7219_hw_params,
+	.hw_free = cz_da7219_hw_free,
+};
+
+static struct snd_soc_ops cz_dmic_cap_ops = {
+	.hw_params = cz_da7219_hw_params,
+	.hw_free = cz_da7219_hw_free,
+};
+
 static struct snd_soc_dai_link cz_dai_7219_98357[] = {
 	{
 		.name = "amd-da7219-play-cap",
@@ -147,6 +186,7 @@ static int cz_fe_startup(struct snd_pcm_substream *substream)
 		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
 				| SND_SOC_DAIFMT_CBM_CFM,
 		.dpcm_playback = 1,
+		.ops = &cz_max_play_ops,
 	},
 	{
 		.name = "dmic",
@@ -158,6 +198,7 @@ static int cz_fe_startup(struct snd_pcm_substream *substream)
 		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
 				| SND_SOC_DAIFMT_CBM_CFM,
 		.dpcm_capture = 1,
+		.ops = &cz_dmic_cap_ops,
 	},
 };
 
Signature · 1 line
1.9.1
#2 lore raw

Re: [PATCH 2/2] ASoC: AMD: Enable da7219 master clock using common clock framework

Thank you for the patch! Yet something to improve:

Hi Akshu,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on next-20180309]
[cannot apply to v4.16-rc4 v4.16-rc3 v4.16-rc2 v4.16-rc5]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Akshu-Agrawal/ASoC-AMD-Use-single-dai-for-da7219-playback-and-capture/20180313-035239
config: sh-allmodconfig (attached as .config)
compiler: sh4-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=sh

All errors (new ones prefixed by >>):

sound/soc/amd/acp-da7219-max98357a.c: In function 'cz_da7219_init':

>> sound/soc/amd/acp-da7219-max98357a.c:70:19: error: implicit declaration of function 'clk_get'; did you mean 'key_get'? [-Werror=implicit-function-declaration]
     da7219_dai_clk = clk_get(codec->dev, "da7219-dai-clks");
                      ^~~~~~~
                      key_get
>> sound/soc/amd/acp-da7219-max98357a.c:70:27: error: 'codec' undeclared (first use in this function); did you mean 'cdev'?
     da7219_dai_clk = clk_get(codec->dev, "da7219-dai-clks");
                              ^~~~~
                              cdev
   sound/soc/amd/acp-da7219-max98357a.c:70:27: note: each undeclared identifier is reported only once for each function it appears in
   sound/soc/amd/acp-da7219-max98357a.c: In function 'cz_da7219_hw_params':
>> sound/soc/amd/acp-da7219-max98357a.c:93:8: error: implicit declaration of function 'clk_prepare_enable'; did you mean 'preempt_enable'? [-Werror=implicit-function-declaration]
     ret = clk_prepare_enable(da7219_dai_clk);
           ^~~~~~~~~~~~~~~~~~
           preempt_enable
   sound/soc/amd/acp-da7219-max98357a.c: In function 'cz_da7219_hw_free':
>> sound/soc/amd/acp-da7219-max98357a.c:106:2: error: implicit declaration of function 'clk_disable_unprepare'; did you mean 'acpi_disable_gpe'? [-Werror=implicit-function-declaration]
     clk_disable_unprepare(da7219_dai_clk);
     ^~~~~~~~~~~~~~~~~~~~~
     acpi_disable_gpe

cc1: some warnings being treated as errors

vim +70 sound/soc/amd/acp-da7219-max98357a.c

    46	
    47	static int cz_da7219_init(struct snd_soc_pcm_runtime *rtd)
    48	{
    49		int ret;
    50		struct snd_soc_card *card = rtd->card;
    51		struct snd_soc_dai *codec_dai = rtd->codec_dai;
    52		struct snd_soc_component *component = codec_dai->component;
    53	
    54		dev_info(rtd->dev, "codec dai name = %s\n", codec_dai->name);
    55	
    56		ret = snd_soc_dai_set_sysclk(codec_dai, DA7219_CLKSRC_MCLK,
    57					     CZ_PLAT_CLK, SND_SOC_CLOCK_IN);
    58		if (ret < 0) {
    59			dev_err(rtd->dev, "can't set codec sysclk: %d\n", ret);
    60			return ret;
    61		}
    62	
    63		ret = snd_soc_dai_set_pll(codec_dai, 0, DA7219_SYSCLK_PLL,
    64					  CZ_PLAT_CLK, MCLK_RATE);
    65		if (ret < 0) {
    66			dev_err(rtd->dev, "can't set codec pll: %d\n", ret);
    67			return ret;
    68		}
    69	
  > 70		da7219_dai_clk = clk_get(codec->dev, "da7219-dai-clks");
    71	
    72		ret = snd_soc_card_jack_new(card, "Headset Jack",
    73					SND_JACK_HEADPHONE | SND_JACK_MICROPHONE |
    74					SND_JACK_BTN_0 | SND_JACK_BTN_1 |
    75					SND_JACK_BTN_2 | SND_JACK_BTN_3,
    76					&cz_jack, NULL, 0);
    77		if (ret) {
    78			dev_err(card->dev, "HP jack creation failed %d\n", ret);
    79			return ret;
    80		}
    81	
    82		da7219_aad_jack_det(component, &cz_jack);
    83	
    84		return 0;
    85	}
    86	
    87	static int cz_da7219_hw_params(struct snd_pcm_substream *substream,
    88				     struct snd_pcm_hw_params *params)
    89	{
    90		int ret = 0;
    91		struct snd_soc_pcm_runtime *rtd = substream->private_data;
    92	
  > 93		ret = clk_prepare_enable(da7219_dai_clk);
    94		if (ret < 0) {
    95			dev_err(rtd->dev, "can't enable master clock %d\n", ret);
    96			return ret;
    97		}
    98	
    99		return ret;
   100	}
   101	
   102	static int cz_da7219_hw_free(struct snd_pcm_substream *substream)
   103	{
   104		int ret = 0;
   105	
 > 106		clk_disable_unprepare(da7219_dai_clk);

107
108 return ret;
109 }
110

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#3 lore raw

Re: [PATCH 2/2] ASoC: AMD: Enable da7219 master clock using common clock framework

In reply to Akshu Agrawal
Thank you for the patch! Yet something to improve:

Hi Akshu,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on next-20180309]
[cannot apply to v4.16-rc4 v4.16-rc3 v4.16-rc2 v4.16-rc5]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Akshu-Agrawal/ASoC-AMD-Use-single-dai-for-da7219-playback-and-capture/20180313-035239
config: i386-allmodconfig (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0 reproduce:

        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

sound/soc/amd/acp-da7219-max98357a.c: In function 'cz_da7219_init':
sound/soc/amd/acp-da7219-max98357a.c:70:19: error: implicit declaration of function 'clk_get'; did you mean 'key_get'? [-Werror=implicit-function-declaration]

     da7219_dai_clk = clk_get(codec->dev, "da7219-dai-clks");
                      ^~~~~~~
                      key_get
   sound/soc/amd/acp-da7219-max98357a.c:70:27: error: 'codec' undeclared (first use in this function); did you mean 'cdev'?
     da7219_dai_clk = clk_get(codec->dev, "da7219-dai-clks");
                              ^~~~~
                              cdev
   sound/soc/amd/acp-da7219-max98357a.c:70:27: note: each undeclared identifier is reported only once for each function it appears in
   sound/soc/amd/acp-da7219-max98357a.c: In function 'cz_da7219_hw_params':
>> sound/soc/amd/acp-da7219-max98357a.c:93:8: error: implicit declaration of function 'clk_prepare_enable'; did you mean 'acpi_pci_irq_enable'? [-Werror=implicit-function-declaration]
     ret = clk_prepare_enable(da7219_dai_clk);
           ^~~~~~~~~~~~~~~~~~
           acpi_pci_irq_enable
   sound/soc/amd/acp-da7219-max98357a.c: In function 'cz_da7219_hw_free':
   sound/soc/amd/acp-da7219-max98357a.c:106:2: error: implicit declaration of function 'clk_disable_unprepare'; did you mean 'acpi_disable_gpe'? [-Werror=implicit-function-declaration]
     clk_disable_unprepare(da7219_dai_clk);
     ^~~~~~~~~~~~~~~~~~~~~
     acpi_disable_gpe

cc1: some warnings being treated as errors

coccinelle warnings: (new ones prefixed by >>)

>> sound/soc/amd/acp-da7219-max98357a.c:104:5-8: Unneeded variable: "ret". Return "0" on line 108

Please review and possibly fold the followup patch.

vim +93 sound/soc/amd/acp-da7219-max98357a.c

    46	
    47	static int cz_da7219_init(struct snd_soc_pcm_runtime *rtd)
    48	{
    49		int ret;
    50		struct snd_soc_card *card = rtd->card;
    51		struct snd_soc_dai *codec_dai = rtd->codec_dai;
    52		struct snd_soc_component *component = codec_dai->component;
    53	
    54		dev_info(rtd->dev, "codec dai name = %s\n", codec_dai->name);
    55	
    56		ret = snd_soc_dai_set_sysclk(codec_dai, DA7219_CLKSRC_MCLK,
    57					     CZ_PLAT_CLK, SND_SOC_CLOCK_IN);
    58		if (ret < 0) {
    59			dev_err(rtd->dev, "can't set codec sysclk: %d\n", ret);
    60			return ret;
    61		}
    62	
    63		ret = snd_soc_dai_set_pll(codec_dai, 0, DA7219_SYSCLK_PLL,
    64					  CZ_PLAT_CLK, MCLK_RATE);
    65		if (ret < 0) {
    66			dev_err(rtd->dev, "can't set codec pll: %d\n", ret);
    67			return ret;
    68		}
    69	
  > 70		da7219_dai_clk = clk_get(codec->dev, "da7219-dai-clks");
    71	
    72		ret = snd_soc_card_jack_new(card, "Headset Jack",
    73					SND_JACK_HEADPHONE | SND_JACK_MICROPHONE |
    74					SND_JACK_BTN_0 | SND_JACK_BTN_1 |
    75					SND_JACK_BTN_2 | SND_JACK_BTN_3,
    76					&cz_jack, NULL, 0);
    77		if (ret) {
    78			dev_err(card->dev, "HP jack creation failed %d\n", ret);
    79			return ret;
    80		}
    81	
    82		da7219_aad_jack_det(component, &cz_jack);
    83	
    84		return 0;
    85	}
    86	
    87	static int cz_da7219_hw_params(struct snd_pcm_substream *substream,
    88				     struct snd_pcm_hw_params *params)
    89	{
    90		int ret = 0;
    91		struct snd_soc_pcm_runtime *rtd = substream->private_data;
    92	
  > 93		ret = clk_prepare_enable(da7219_dai_clk);
    94		if (ret < 0) {
    95			dev_err(rtd->dev, "can't enable master clock %d\n", ret);
    96			return ret;
    97		}
    98	
    99		return ret;
   100	}
   101	
   102	static int cz_da7219_hw_free(struct snd_pcm_substream *substream)
   103	{
 > 104		int ret = 0;
   105	
   106		clk_disable_unprepare(da7219_dai_clk);
   107	
 > 108		return ret;

109 }
110

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#4 lore raw

[PATCH] ASoC: AMD: fix returnvar.cocci warnings

In reply to Akshu Agrawal
sound/soc/amd/acp-da7219-max98357a.c:104:5-8: Unneeded variable: "ret". Return "0" on line 108

From: Fengguang Wu <[email protected]>

sound/soc/amd/acp-da7219-max98357a.c:104:5-8: Unneeded variable: "ret". Return "0" on line 108

Remove unneeded variable used to store return value.

Generated by: scripts/coccinelle/misc/returnvar.cocci

Fixes 7d03b3824d27 ("ASoC: AMD: Enable da7219 master clock using common clock framework")
CC Akshu Agrawal <[email protected]>

---

Please take the patch only if it's a positive warning. Thanks!

 acp-da7219-max98357a.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
sound/soc/amd/acp-da7219-max98357a.c +1 -3
@@ -101,11 +101,9 @@ static int cz_da7219_hw_params(struct sn
 
 static int cz_da7219_hw_free(struct snd_pcm_substream *substream)
 {
-	int ret = 0;
-
 	clk_disable_unprepare(da7219_dai_clk);
 
-	return ret;
+	return 0;
 }
 
 static const unsigned int channels[] = {
#5 lore raw

[RFC PATCH] ASoC: AMD: da7219_dai_clk can be static

In reply to Akshu Agrawal
Fixes: 7d03b3824d27 ("ASoC: AMD: Enable da7219 master clock using common clock framework")
Fixes 7d03b3824d27 ("ASoC: AMD: Enable da7219 master clock using common clock framework")
---
 acp-da7219-max98357a.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/amd/acp-da7219-max98357a.c +1 -1
index 1441be3..d6e7420 100644
@@ -42,7 +42,7 @@
 #define DUAL_CHANNEL		2
 
 static struct snd_soc_jack cz_jack;
-struct clk *da7219_dai_clk;
+static struct clk *da7219_dai_clk;
 
 static int cz_da7219_init(struct snd_soc_pcm_runtime *rtd)
 {
maintainer
#6 lore raw

Applied "ASoC: amd: acp-da7219-max98357: Make symbol da7219_dai_clk static" to the asoc tree

The patch

ASoC: amd: acp-da7219-max98357: Make symbol da7219_dai_clk static

has been applied to the asoc tree at

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From dc29f581fa9d5567c3a01ecfdd7f16b2e613c7fb Mon Sep 17 00:00:00 2001

From: Wei Yongjun <[email protected]>
Date: Thu, 29 Mar 2018 02:14:03 +0000
Subject: [PATCH] ASoC: amd: acp-da7219-max98357: Make symbol da7219_dai_clk
static

Fixes the following sparse warning:

sound/soc/amd/acp-da7219-max98357a.c:46:12: warning:
symbol 'da7219_dai_clk' was not declared. Should it be static?

---
 sound/soc/amd/acp-da7219-max98357a.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/amd/acp-da7219-max98357a.c +1 -1
index b205c782e494..f41560ecbcd1 100644
@@ -43,7 +43,7 @@
 #define DUAL_CHANNEL		2
 
 static struct snd_soc_jack cz_jack;
-struct clk *da7219_dai_clk;
+static struct clk *da7219_dai_clk;
 
 static int cz_da7219_init(struct snd_soc_pcm_runtime *rtd)
 {
Signature · 1 line
2.17.0
maintainer
#7 lore raw

Applied "ASoC: amd: acp-da7219-max98357: Make symbol da7219_dai_clk static" to the asoc tree

In reply to kbuild test robot

The patch

ASoC: amd: acp-da7219-max98357: Make symbol da7219_dai_clk static

has been applied to the asoc tree at

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From ede1d3534f589d69b381e8509f3d01ec1e23c804 Mon Sep 17 00:00:00 2001

From: Wei Yongjun <[email protected]>
Date: Thu, 29 Mar 2018 02:14:03 +0000
Subject: [PATCH] ASoC: amd: acp-da7219-max98357: Make symbol da7219_dai_clk
static

Fixes the following sparse warning:

sound/soc/amd/acp-da7219-max98357a.c:46:12: warning:
symbol 'da7219_dai_clk' was not declared. Should it be static?

---
 sound/soc/amd/acp-da7219-max98357a.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/amd/acp-da7219-max98357a.c +1 -1
index d281c227d64c..215b06bf2039 100644
@@ -44,7 +44,7 @@
 #define DUAL_CHANNEL		2
 
 static struct snd_soc_jack cz_jack;
-struct clk *da7219_dai_clk;
+static struct clk *da7219_dai_clk;
 
 static int cz_da7219_init(struct snd_soc_pcm_runtime *rtd)
 {
Signature · 1 line
2.17.0
maintainer
#8 lore raw

Applied "ASoC: amd: acp-da7219-max98357: Make symbol da7219_dai_clk static" to the asoc tree

In reply to kbuild test robot

The patch

ASoC: amd: acp-da7219-max98357: Make symbol da7219_dai_clk static

has been applied to the asoc tree at

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From dc29f581fa9d5567c3a01ecfdd7f16b2e613c7fb Mon Sep 17 00:00:00 2001

From: Wei Yongjun <[email protected]>
Date: Thu, 29 Mar 2018 02:14:03 +0000
Subject: [PATCH] ASoC: amd: acp-da7219-max98357: Make symbol da7219_dai_clk
static

Fixes the following sparse warning:

sound/soc/amd/acp-da7219-max98357a.c:46:12: warning:
symbol 'da7219_dai_clk' was not declared. Should it be static?

---
 sound/soc/amd/acp-da7219-max98357a.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/amd/acp-da7219-max98357a.c +1 -1
index b205c782e494..f41560ecbcd1 100644
@@ -43,7 +43,7 @@
 #define DUAL_CHANNEL		2
 
 static struct snd_soc_jack cz_jack;
-struct clk *da7219_dai_clk;
+static struct clk *da7219_dai_clk;
 
 static int cz_da7219_init(struct snd_soc_pcm_runtime *rtd)
 {
Signature · 1 line
2.17.0
maintainer
#9 lore raw
In reply to Akshu Agrawal
Quoted 8 lines · Akshu Agrawal

BT I2S is a bi-directional dai, we will use the same cpu dai for playback and capture.

TEST=Build, apply grunt_mixer_settings:
iotools mmio_write32 0xfed80e40 0x040c40c0
iotools mmio_write32 0xfed80e28 0x10000
aplay -D hw:0,0 -vv <file>
arecord -D hw:0,0 -f dat -d 5 -vv <file>

These reproduction instructions don't make much sense outside of your test environment (how is anyone supposed to know what grunt_mixer_settings is?). I'm also rather worried about the random magic numbers you're using with this iowrite tool - what do they do? It sounds like this driver might not work at all without some missing bit...

#10 lore raw
Quoted 10 lines · Mark Brown
Quoted 8 lines · Akshu Agrawal

BT I2S is a bi-directional dai, we will use the same cpu dai for playback and capture.

TEST=Build, apply grunt_mixer_settings:
iotools mmio_write32 0xfed80e40 0x040c40c0
iotools mmio_write32 0xfed80e28 0x10000
aplay -D hw:0,0 -vv <file>
arecord -D hw:0,0 -f dat -d 5 -vv <file>

Quoted 7 lines

These reproduction instructions don't make much sense outside of your test environment (how is anyone supposed to know what grunt_mixer_settings is?). I'm also rather worried about the random magic numbers you're using with this iowrite tool - what do they do? It sounds like this driver might not work at all without some missing bit...

write instructions are actually setting up the oscillator. These are being done in coreboot and patch is being pushed for same. I will remove these noise from TEST field and submit again.

maintainer
#11 lore raw

Applied "ASoC: amd: Use single dai for da7219 playback and capture" to the asoc tree

In reply to Akshu Agrawal

The patch

ASoC: amd: Use single dai for da7219 playback and capture

has been applied to the asoc tree at

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From f155181d23608acd3fb46d0d6b1507b68ffa436b Mon Sep 17 00:00:00 2001

From: Akshu Agrawal <[email protected]>
Date: Mon, 19 Mar 2018 11:07:41 +0530
Subject: [PATCH] ASoC: amd: Use single dai for da7219 playback and capture

BT I2S is a bi-directional dai, we will use the same cpu dai for playback and capture.

TEST=aplay -D hw:0,0 -vv <file>
arecord -D hw:0,0 -f dat -d 5 -vv <file>

---
 sound/soc/amd/acp-da7219-max98357a.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)
sound/soc/amd/acp-da7219-max98357a.c +2 -12
index bbe0f103e6a8..d07c2a1d5d9e 100644
@@ -124,8 +124,8 @@ static struct snd_soc_ops cz_da7219_cap_ops = {
 
 static struct snd_soc_dai_link cz_dai_7219_98357[] = {
 	{
-		.name = "amd-da7219-play",
-		.stream_name = "Playback",
+		.name = "amd-da7219-play-cap",
+		.stream_name = "Playback and Capture",
 		.platform_name = "acp_audio_dma.0.auto",
 		.cpu_dai_name = "designware-i2s.3.auto",
 		.codec_dai_name = "da7219-hifi",
@@ -134,16 +134,6 @@ static struct snd_soc_dai_link cz_dai_7219_98357[] = {
 				| SND_SOC_DAIFMT_CBM_CFM,
 		.init = cz_da7219_init,
 		.dpcm_playback = 1,
-	},
-	{
-		.name = "amd-da7219-cap",
-		.stream_name = "Capture",
-		.platform_name = "acp_audio_dma.0.auto",
-		.cpu_dai_name = "designware-i2s.4.auto",
-		.codec_dai_name = "da7219-hifi",
-		.codec_name = "i2c-DLGS7219:00",
-		.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
-				| SND_SOC_DAIFMT_CBM_CFM,
 		.dpcm_capture = 1,
 		.ops = &cz_da7219_cap_ops,
 	},
Signature · 1 line
2.16.2