alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: rockchip: Use dummy_dai for rt5514 dsp dailink
@ 2017-11-21  8:25 Jeffy Chen
  2017-12-16  3:25 ` Brian Norris
  2018-01-25 12:15 ` Applied "ASoC: rockchip: Use dummy_dai for rt5514 dsp dailink" to the asoc tree Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Jeffy Chen @ 2017-11-21  8:25 UTC (permalink / raw)
  To: linux-kernel
  Cc: alsa-devel, Heiko Stuebner, Liam Girdwood, Mark Brown, Jeffy Chen,
	Takashi Iwai, linux-rockchip, mka, linux-arm-kernel, cychiang

The rt5514 dsp captures pcm data through spi directly, so we should not
use rockchip-i2s as it's cpu dai like other codecs.

Use dummy_dai for rt5514 dsp dailink to make voice wakeup work again.

Reported-by: Jimmy Cheng-Yi Chiang <cychiang@google.com>
Fixes: (72cfb0f20c75 ASoC: rockchip: Use codec of_node and dai_name for rt5514 dsp)
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---

 sound/soc/rockchip/rk3399_gru_sound.c | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/sound/soc/rockchip/rk3399_gru_sound.c b/sound/soc/rockchip/rk3399_gru_sound.c
index d64fbbd50544..aa8ffd035377 100644
--- a/sound/soc/rockchip/rk3399_gru_sound.c
+++ b/sound/soc/rockchip/rk3399_gru_sound.c
@@ -367,7 +367,8 @@ static const struct snd_soc_dai_link rockchip_dais[] = {
 	[DAILINK_RT5514_DSP] = {
 		.name = "RT5514 DSP",
 		.stream_name = "Wake on Voice",
-		.codec_dai_name = "rt5514-dsp-cpu-dai",
+		.codec_name = "snd-soc-dummy",
+		.codec_dai_name = "snd-soc-dummy-dai",
 	},
 };
 
@@ -528,7 +529,18 @@ static int rockchip_sound_of_parse_dais(struct device *dev,
 		if (index < 0)
 			continue;
 
-		np_cpu = (index == DAILINK_CDNDP) ? np_cpu1 : np_cpu0;
+		switch (index) {
+		case DAILINK_CDNDP:
+			np_cpu = np_cpu1;
+			break;
+		case DAILINK_RT5514_DSP:
+			np_cpu = np_codec;
+			break;
+		default:
+			np_cpu = np_cpu0;
+			break;
+		}
+
 		if (!np_cpu) {
 			dev_err(dev, "Missing 'rockchip,cpu' for %s\n",
 				rockchip_dais[index].name);
@@ -538,7 +550,8 @@ static int rockchip_sound_of_parse_dais(struct device *dev,
 		dai = &card->dai_link[card->num_links++];
 		*dai = rockchip_dais[index];
 
-		dai->codec_of_node = np_codec;
+		if (!dai->codec_name)
+			dai->codec_of_node = np_codec;
 		dai->platform_of_node = np_cpu;
 		dai->cpu_of_node = np_cpu;
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: rockchip: Use dummy_dai for rt5514 dsp dailink
  2017-11-21  8:25 [PATCH] ASoC: rockchip: Use dummy_dai for rt5514 dsp dailink Jeffy Chen
@ 2017-12-16  3:25 ` Brian Norris
  2018-01-25 12:15 ` Applied "ASoC: rockchip: Use dummy_dai for rt5514 dsp dailink" to the asoc tree Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Brian Norris @ 2017-12-16  3:25 UTC (permalink / raw)
  To: Jeffy Chen
  Cc: alsa-devel, Doug Anderson, Heiko Stuebner, linux-kernel,
	Liam Girdwood, Takashi Iwai, linux-rockchip, Mark Brown,
	Enric Balletbo i Serra, mka, linux-arm-kernel, cychiang

Hi,

On Tue, Nov 21, 2017 at 04:25:17PM +0800, Jeffy Chen wrote:
> The rt5514 dsp captures pcm data through spi directly, so we should not
> use rockchip-i2s as it's cpu dai like other codecs.
> 
> Use dummy_dai for rt5514 dsp dailink to make voice wakeup work again.
> 
> Reported-by: Jimmy Cheng-Yi Chiang <cychiang@google.com>
> Fixes: (72cfb0f20c75 ASoC: rockchip: Use codec of_node and dai_name for rt5514 dsp)
> Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>

I didn't review this closely (and I don't know ASoC that well), but this
does fix regressions I've seen on 4.15 RCs, where

(a) the rt5514 DAI link doesn't get set up
(b) the rt5514 *always* causes my device to wake up, because we arm the
    wakeup IRQ even though we never actually configured the DSP
(c) there are system crashes on resume because the rt5514-spi driver
    assumes that the DAI link was correctly configured (that's the
    subject of another patch I sent [1]

I believe this was working fine on 4.14? At least, I know (b) didn't
happen, and I'm not sure about (a). (c) is a new issue in 4.15-rc1.

Anyway, that's all to say:

Tested-by: Brian Norris <briannorris@chromium.org>

on the "kevin" Chromebook (Samsung Chromebook Plus).

I also suspect this might be regression-fixing material, for 4.15. Or if
not, at least something like patch [1] should be.

Thanks,
Brian

[1] https://patchwork.kernel.org/patch/10116761/
    [PATCH for-4.15] ASoC: rt5514: don't assume rt5514 component was "attached"

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Applied "ASoC: rockchip: Use dummy_dai for rt5514 dsp dailink" to the asoc tree
  2017-11-21  8:25 [PATCH] ASoC: rockchip: Use dummy_dai for rt5514 dsp dailink Jeffy Chen
  2017-12-16  3:25 ` Brian Norris
@ 2018-01-25 12:15 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2018-01-25 12:15 UTC (permalink / raw)
  To: Jeffy Chen
  Cc: Jimmy Cheng-Yi Chiang, Brian Norris, Mark Brown, linux-kernel,
	alsa-devel, Heiko Stuebner, Liam Girdwood

The patch

   ASoC: rockchip: Use dummy_dai for rt5514 dsp dailink

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

>From fde7f9dbc71365230eeb8c8ea97ce9b552c8e5bd Mon Sep 17 00:00:00 2001
From: Jeffy Chen <jeffy.chen@rock-chips.com>
Date: Tue, 21 Nov 2017 16:25:17 +0800
Subject: [PATCH] ASoC: rockchip: Use dummy_dai for rt5514 dsp dailink

The rt5514 dsp captures pcm data through spi directly, so we should not
use rockchip-i2s as it's cpu dai like other codecs.

Use dummy_dai for rt5514 dsp dailink to make voice wakeup work again.

Reported-by: Jimmy Cheng-Yi Chiang <cychiang@google.com>
Fixes: (72cfb0f20c75 ASoC: rockchip: Use codec of_node and dai_name for rt5514 dsp)
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/rockchip/rk3399_gru_sound.c | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/sound/soc/rockchip/rk3399_gru_sound.c b/sound/soc/rockchip/rk3399_gru_sound.c
index d64fbbd50544..aa8ffd035377 100644
--- a/sound/soc/rockchip/rk3399_gru_sound.c
+++ b/sound/soc/rockchip/rk3399_gru_sound.c
@@ -367,7 +367,8 @@ static const struct snd_soc_dai_link rockchip_dais[] = {
 	[DAILINK_RT5514_DSP] = {
 		.name = "RT5514 DSP",
 		.stream_name = "Wake on Voice",
-		.codec_dai_name = "rt5514-dsp-cpu-dai",
+		.codec_name = "snd-soc-dummy",
+		.codec_dai_name = "snd-soc-dummy-dai",
 	},
 };
 
@@ -528,7 +529,18 @@ static int rockchip_sound_of_parse_dais(struct device *dev,
 		if (index < 0)
 			continue;
 
-		np_cpu = (index == DAILINK_CDNDP) ? np_cpu1 : np_cpu0;
+		switch (index) {
+		case DAILINK_CDNDP:
+			np_cpu = np_cpu1;
+			break;
+		case DAILINK_RT5514_DSP:
+			np_cpu = np_codec;
+			break;
+		default:
+			np_cpu = np_cpu0;
+			break;
+		}
+
 		if (!np_cpu) {
 			dev_err(dev, "Missing 'rockchip,cpu' for %s\n",
 				rockchip_dais[index].name);
@@ -538,7 +550,8 @@ static int rockchip_sound_of_parse_dais(struct device *dev,
 		dai = &card->dai_link[card->num_links++];
 		*dai = rockchip_dais[index];
 
-		dai->codec_of_node = np_codec;
+		if (!dai->codec_name)
+			dai->codec_of_node = np_codec;
 		dai->platform_of_node = np_cpu;
 		dai->cpu_of_node = np_cpu;
 
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-01-25 12:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-21  8:25 [PATCH] ASoC: rockchip: Use dummy_dai for rt5514 dsp dailink Jeffy Chen
2017-12-16  3:25 ` Brian Norris
2018-01-25 12:15 ` Applied "ASoC: rockchip: Use dummy_dai for rt5514 dsp dailink" to the asoc tree Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).