Skip to contentSkip to conversation

ASoC: bdw-rt5677: add spi driver compile switches

PATCH In review Curtis Malainey 3 participants 3 messages Jan 3, 2020 – Jan 6, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: bdw-rt5677: add spi driver compile switches

If the SPI driver is not compiled in then the RT5677_SPI driver will not be included as well which will cause the bdw-rt5677 driver to fail to probe since the DSP components are managed by the RT5677_SPI driver. The solution is to remove them when the driver is not present as part of the build.

Cc Pierre-Louis Bossart <[email protected]>
CC Pan Xiuli <[email protected]>
---
 sound/soc/intel/boards/bdw-rt5677.c | 4 ++++
 1 file changed, 4 insertions(+)
sound/soc/intel/boards/bdw-rt5677.c +4 -0
index 2af8e5a62da84..d5ded2c545d2c 100644
@@ -74,11 +74,13 @@ static const struct snd_soc_dapm_route bdw_rt5677_map[] = {
 	/* CODEC BE connections */
 	{"SSP0 CODEC IN", NULL, "AIF1 Capture"},
 	{"AIF1 Playback", NULL, "SSP0 CODEC OUT"},
+#if IS_ENABLED(CONFIG_SND_SOC_RT5677_SPI)
 	{"DSP Capture", NULL, "DSP Buffer"},
 
 	/* DSP Clock Connections */
 	{ "DSP Buffer", NULL, "SSP0 CODEC IN" },
 	{ "SSP0 CODEC IN", NULL, "DSPTX" },
+#endif
 };
 
 static const struct snd_kcontrol_new bdw_rt5677_controls[] = {
@@ -319,6 +321,7 @@ static struct snd_soc_dai_link bdw_rt5677_dais[] = {
 		SND_SOC_DAILINK_REG(fe, dummy, platform),
 	},
 
+#if IS_ENABLED(CONFIG_SND_SOC_RT5677_SPI)
 	/* Non-DPCM links */
 	{
 		.name = "Codec DSP",
@@ -326,6 +329,7 @@ static struct snd_soc_dai_link bdw_rt5677_dais[] = {
 		.ops = &bdw_rt5677_dsp_ops,
 		SND_SOC_DAILINK_REG(dsp),
 	},
+#endif
 
 	/* Back End DAI links */
 	{
Signature · 6 lines
2.24.1.735.g03f4e72817-goog

_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
#1 lore raw
Quoted 5 lines · Curtis Malainey

If the SPI driver is not compiled in then the RT5677_SPI driver will not be included as well which will cause the bdw-rt5677 driver to fail to probe since the DSP components are managed by the RT5677_SPI driver. The solution is to remove them when the driver is not present as part of the build.

it should be the other way around, this machine driver should have a dependency on SPI and select RT5677_SPI?

That said, even with this fix, I still see issues, somehow the spi-RT5677AA component does not probe/register, see https://github.com/thesofproject/linux/pull/1659

There must be an additional issue with SPI support here.

Quoted 36 lines
Cc Pierre-Louis Bossart <[email protected]>
CC Pan Xiuli <[email protected]>
---
  sound/soc/intel/boards/bdw-rt5677.c | 4 ++++
  1 file changed, 4 insertions(+)
sound/soc/intel/boards/bdw-rt5677.c +3 -0
index 2af8e5a62da84..d5ded2c545d2c 100644
@@ -74,11 +74,13 @@ static const struct snd_soc_dapm_route bdw_rt5677_map[] = {
  	/* CODEC BE connections */
  	{"SSP0 CODEC IN", NULL, "AIF1 Capture"},
  	{"AIF1 Playback", NULL, "SSP0 CODEC OUT"},
+#if IS_ENABLED(CONFIG_SND_SOC_RT5677_SPI)
  	{"DSP Capture", NULL, "DSP Buffer"},
 
  	/* DSP Clock Connections */
  	{ "DSP Buffer", NULL, "SSP0 CODEC IN" },
  	{ "SSP0 CODEC IN", NULL, "DSPTX" },
+#endif
  };
 
  static const struct snd_kcontrol_new bdw_rt5677_controls[] = {
@@ -319,6 +321,7 @@ static struct snd_soc_dai_link bdw_rt5677_dais[] = {
  		SND_SOC_DAILINK_REG(fe, dummy, platform),
  	},
 
+#if IS_ENABLED(CONFIG_SND_SOC_RT5677_SPI)
  	/* Non-DPCM links */
  	{
  		.name = "Codec DSP",

sound/soc/intel/boards/bdw-rt5677.c static struct snd_soc_dai_link bdw_rt5677_dais[] = { · line 335

Quoted 7 lines
sound/soc/intel/boards/bdw-rt5677.c +1 -0
@@ -326,6 +329,7 @@ static struct snd_soc_dai_link bdw_rt5677_dais[] = {
  		.ops = &bdw_rt5677_dsp_ops,
  		SND_SOC_DAILINK_REG(dsp),
  	},
+#endif
 
  	/* Back End DAI links */
  	{

_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#2 lore raw
Quoted 10 lines · Pierre-Louis Bossart
Quoted 5 lines · Curtis Malainey

If the SPI driver is not compiled in then the RT5677_SPI driver will not be included as well which will cause the bdw-rt5677 driver to fail to probe since the DSP components are managed by the RT5677_SPI driver. The solution is to remove them when the driver is not present as part of the build.

Quoted 9 lines

it should be the other way around, this machine driver should have a dependency on SPI and select RT5677_SPI?

That said, even with this fix, I still see issues, somehow the spi-RT5677AA component does not probe/register, see
https://github.com/thesofproject/linux/pull/1659

There must be an additional issue with SPI support here.

Good point, we should select the dependencies. I commented on your bug as to what the issue might be.

Quoted 40 lines
Quoted 40 lines
Cc Pierre-Louis Bossart <[email protected]>
CC Pan Xiuli <[email protected]>
---
  sound/soc/intel/boards/bdw-rt5677.c | 4 ++++
  1 file changed, 4 insertions(+)
sound/soc/intel/boards/bdw-rt5677.c +4 -0
index 2af8e5a62da84..d5ded2c545d2c 100644
@@ -74,11 +74,13 @@ static const struct snd_soc_dapm_route bdw_rt5677_map[] = {
      /* CODEC BE connections */
      {"SSP0 CODEC IN", NULL, "AIF1 Capture"},
      {"AIF1 Playback", NULL, "SSP0 CODEC OUT"},
+#if IS_ENABLED(CONFIG_SND_SOC_RT5677_SPI)
      {"DSP Capture", NULL, "DSP Buffer"},
 
      /* DSP Clock Connections */
      { "DSP Buffer", NULL, "SSP0 CODEC IN" },
      { "SSP0 CODEC IN", NULL, "DSPTX" },
+#endif
  };
 
  static const struct snd_kcontrol_new bdw_rt5677_controls[] = {
@@ -319,6 +321,7 @@ static struct snd_soc_dai_link bdw_rt5677_dais[] = {
              SND_SOC_DAILINK_REG(fe, dummy, platform),
      },
 
+#if IS_ENABLED(CONFIG_SND_SOC_RT5677_SPI)
      /* Non-DPCM links */
      {
              .name = "Codec DSP",
@@ -326,6 +329,7 @@ static struct snd_soc_dai_link bdw_rt5677_dais[] = {
              .ops = &bdw_rt5677_dsp_ops,
              SND_SOC_DAILINK_REG(dsp),
      },
+#endif
 
Quoted 3 lines

sound/soc/intel/boards/bdw-rt5677.c static struct snd_soc_dai_link bdw_rt5677_dais[] = { · line 335

Quoted 3 lines
sound/soc/intel/boards/bdw-rt5677.c +0 -0
      /* Back End DAI links */
      {

_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel