Skip to contentSkip to conversation

ASoC: Tegra and i.MX are mutually exclusive

PATCH In review Arnd Bergmann 4 participants 5 messages Jun 24, 2013 – Jun 25, 2013

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

PATCH 1/1 ASoC: Tegra and i.MX are mutually exclusive

Both Tegra and i.MX provide ac97 operations, which can only exist once in the kernel. They can both be built as loadable modules (only one of them needs to be loaded anyway), but we have to disallow enabling them both as built-in.

sound/soc/fsl/Kconfig +1 -0
index 3843a18..5958948 100644
@@ -99,6 +99,7 @@ endif # SND_POWERPC_SOC
 menuconfig SND_IMX_SOC
 	tristate "SoC Audio for Freescale i.MX CPUs"
 	depends on ARCH_MXC
+	depends on SND_SOC_TEGRA=n || (SND_SOC_TEGRA=m && m)
 	help
 	  Say Y or M if you want to add support for codecs attached to
 	  the i.MX CPUs.
#1 lore raw

sound/soc/fsl/Kconfig endif # SND_POWERPC_SOC · line 102

Quoted 11 lines · Arnd Bergmann

Both Tegra and i.MX provide ac97 operations, which can only exist once in the kernel. They can both be built as loadable modules (only one of them needs to be loaded anyway), but we have to disallow enabling them both as built-in.

sound/soc/fsl/Kconfig +1 -0
 
 menuconfig SND_IMX_SOC
 	tristate "SoC Audio for Freescale i.MX CPUs"
 	depends on ARCH_MXC
+	depends on SND_SOC_TEGRA=n || (SND_SOC_TEGRA=m && m)

I can easily see how this prevents adding SND_IMX_SOC to a config if SND_SOC_TEGRA is enabled, but I'm not sure about the other way around; does Kconfig check that adding a new SND_SOC_TEGRA wouldn't invalidate any of the depends of any already-selected options?

In other words, do you need to make the "same" change to Tegra?

#2 lore raw
Quoted 13 lines · On Monday 24 June 2013 09:28:08 Stephen Warren wrote:

sound/soc/fsl/Kconfig endif # SND_POWERPC_SOC · line 102

Quoted 11 lines · Arnd Bergmann

Both Tegra and i.MX provide ac97 operations, which can only exist once in the kernel. They can both be built as loadable modules (only one of them needs to be loaded anyway), but we have to disallow enabling them both as built-in.

sound/soc/fsl/Kconfig +1 -0
 
 menuconfig SND_IMX_SOC
      tristate "SoC Audio for Freescale i.MX CPUs"
      depends on ARCH_MXC
+     depends on SND_SOC_TEGRA=n || (SND_SOC_TEGRA=m && m)
Quoted 4 lines

I can easily see how this prevents adding SND_IMX_SOC to a config if SND_SOC_TEGRA is enabled, but I'm not sure about the other way around; does Kconfig check that adding a new SND_SOC_TEGRA wouldn't invalidate any of the depends of any already-selected options?

If you start out with a config that has SND_IMX_SOC and select SND_SOC_TEGRA, SND_IMX_SOC gets turned off.

Quoted 1 line

In other words, do you need to make the "same" change to Tegra?

No, that would create a circular dependency that is not allowed in Kconfig.

Arnd

#3 lore raw
In reply to Arnd Bergmann
Quoted 5 lines · Arnd Bergmann

Both Tegra and i.MX provide ac97 operations, which can only exist once in the kernel. They can both be built as loadable modules (only one of them needs to be loaded anyway), but we have to disallow enabling them both as built-in.

It's just the ac97 drivers that are mutually exclusive. I'm not sure whether it makes sense to make the whole platforms mutually exclusive for this.

Also this is not limited to tegra and imx. As more platforms are converted to multiplatform ARM the same issue will pop up for other platforms as well. I don't think your solution will scale really well for multiple platforms. The best solution would of course be to make AC97 work properly with multiple AC97 drivers. But maybe we can get away with a 'choice' Kconfig entry which allows you to select which platforms AC97 driver you want to build.

Quoted 19 lines
sound/soc/fsl/Kconfig +1 -0
index 3843a18..5958948 100644
@@ -99,6 +99,7 @@ endif # SND_POWERPC_SOC
 menuconfig SND_IMX_SOC
 	tristate "SoC Audio for Freescale i.MX CPUs"
 	depends on ARCH_MXC
+	depends on SND_SOC_TEGRA=n || (SND_SOC_TEGRA=m && m)
 	help
 	  Say Y or M if you want to add support for codecs attached to
 	  the i.MX CPUs.

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

maintainer
#4 lore raw
Quoted 2 lines · Lars-Peter Clausen

It's just the ac97 drivers that are mutually exclusive. I'm not sure whether it makes sense to make the whole platforms mutually exclusive for this.

I agree, this is excessive and seems to rather defeat the point of having multi-platform in the first place. It makes it impossible to build the sound drivers multi-platform all for the sake of a bus which is used by approximately nothing these days (hence the lack of love the code has had).

Quoted 6 lines

Also this is not limited to tegra and imx. As more platforms are converted to multiplatform ARM the same issue will pop up for other platforms as well. I don't think your solution will scale really well for multiple platforms. The best solution would of course be to make AC97 work properly with multiple AC97 drivers. But maybe we can get away with a 'choice' Kconfig entry which allows you to select which platforms AC97 driver you want to build.

It should be easy enough to refactor so that we assign the ops pointer
when the driver is loaded instead of at link time which isn't solving
the issue but makes it better. I'll send some patches.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130625/bfcd2a96/attachment.sig>