ASoC: rockchip: Use dummy_dai for rt5514 dsp dailink
authorJeffy Chen <jeffy.chen@rock-chips.com>
Tue, 21 Nov 2017 08:25:17 +0000 (16:25 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Apr 2018 09:02:11 +0000 (11:02 +0200)
[ Upstream commit fde7f9dbc71365230eeb8c8ea97ce9b552c8e5bd ]

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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/soc/rockchip/rk3399_gru_sound.c

index 0513fe48035309a90e806eec2cebbb9765338132..21ac8d6cce3a054d1a055423d332129289dce278 100644 (file)
@@ -387,7 +387,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",
        },
 };
 
@@ -432,7 +433,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);
@@ -442,7 +454,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;
        }