Skip to contentSkip to conversation

ASoC: codecs-ac97: make selectable in config

PATCH Applied Maciej S. Szmigiero 3 participants 11 messages May 9, 2015 – May 22, 2015

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

PATCH 1/1 ASoC: codecs-ac97: make selectable in config

Make generic ASoC AC'97 CODEC selectable in config.

This way this driver can be used for platforms which don't need specialized AC'97 CODEC drivers but which are not directly selectable in config themselves (for example DT based ones).

sound/soc/codecs/Kconfig +3 -2
@@ -16,7 +16,7 @@ config SND_SOC_ALL_CODECS
 	select SND_SOC_88PM860X if MFD_88PM860X
 	select SND_SOC_L3
 	select SND_SOC_AB8500_CODEC if ABX500_CORE
-	select SND_SOC_AC97_CODEC if SND_SOC_AC97_BUS
+	select SND_SOC_AC97_CODEC
 	select SND_SOC_AD1836 if SPI_MASTER
 	select SND_SOC_AD193X_SPI if SPI_MASTER
 	select SND_SOC_AD193X_I2C if I2C
@@ -212,8 +212,9 @@ config SND_SOC_AB8500_CODEC
 	tristate
 
 config SND_SOC_AC97_CODEC
-	tristate
+	tristate "Build generic ASoC AC97 CODEC driver"
 	select SND_AC97_CODEC
+	select SND_SOC_AC97_BUS
 
 config SND_SOC_AD1836
 	tristate
maintainer
#1 lore raw

sound/soc/codecs/Kconfig config SND_SOC_ALL_CODECS · line 22

Quoted 9 lines · Maciej S. Szmigiero
sound/soc/codecs/Kconfig +1 -1
@@ -16,7 +16,7 @@ config SND_SOC_ALL_CODECS
 	select SND_SOC_88PM860X if MFD_88PM860X
 	select SND_SOC_L3
 	select SND_SOC_AB8500_CODEC if ABX500_CORE
-	select SND_SOC_AC97_CODEC if SND_SOC_AC97_BUS
+	select SND_SOC_AC97_CODEC
 	select SND_SOC_AD1836 if SPI_MASTER
 	select SND_SOC_AD193X_SPI if SPI_MASTER
 	select SND_SOC_AD193X_I2C if I2C

No, you're missing the point of what _ALL_CODECS does - it builds everything possible. This will break the build for systems without AC'97 support.

#2 lore raw

Thanks for looking into the patch.

W dniu 12.05.2015 19:58, Mark Brown pisze:

Quoted 15 lines · Maciej S. Szmigiero

sound/soc/codecs/Kconfig config SND_SOC_ALL_CODECS · line 22

Quoted 10 lines
sound/soc/codecs/Kconfig +1 -1
@@ -16,7 +16,7 @@ config SND_SOC_ALL_CODECS
 	select SND_SOC_88PM860X if MFD_88PM860X
 	select SND_SOC_L3
 	select SND_SOC_AB8500_CODEC if ABX500_CORE
-	select SND_SOC_AC97_CODEC if SND_SOC_AC97_BUS
+	select SND_SOC_AC97_CODEC
 	select SND_SOC_AD1836 if SPI_MASTER
 	select SND_SOC_AD193X_SPI if SPI_MASTER
 	select SND_SOC_AD193X_I2C if I2C

No, you're missing the point of what _ALL_CODECS does - it builds everything possible. This will break the build for systems without AC'97 support.

How?
In the second hunk of the patch I've made SND_SOC_AC97_CODEC select SND_SOC_AC97_BUS.

ASoC AC'97 CODEC uses only AC'97 symbols defined in pci/ac97/ac97_codec.c, pci/ac97/ac97_pcm.c and sound/soc/soc-ac97.c.

pci/ac97/ac97_codec.c, pci/ac97/ac97_pcm.c will be built via SND_SOC_ALL_CODECS -> SND_SOC_AC97_CODEC -> SND_AC97_CODEC dependency.

sound/soc/soc-ac97.c will be build via SND_SOC_ALL_CODECS -> SND_SOC_AC97_CODEC -> SND_SOC_AC97_BUS dependency.

Best regards,
Maciej Szmigiero

maintainer
#3 lore raw
Quoted 17 lines · Maciej S. Szmigiero

W dniu 12.05.2015 19:58, Mark Brown pisze:

Quoted 15 lines · Maciej S. Szmigiero

sound/soc/codecs/Kconfig config SND_SOC_ALL_CODECS · line 22

Quoted 10 lines
sound/soc/codecs/Kconfig +1 -1
@@ -16,7 +16,7 @@ config SND_SOC_ALL_CODECS
 	select SND_SOC_88PM860X if MFD_88PM860X
 	select SND_SOC_L3
 	select SND_SOC_AB8500_CODEC if ABX500_CORE
-	select SND_SOC_AC97_CODEC if SND_SOC_AC97_BUS
+	select SND_SOC_AC97_CODEC
 	select SND_SOC_AD1836 if SPI_MASTER
 	select SND_SOC_AD193X_SPI if SPI_MASTER
 	select SND_SOC_AD193X_I2C if I2C

No, you're missing the point of what _ALL_CODECS does - it builds everything possible. This will break the build for systems without AC'97 support.

Quoted 3 lines

How?
In the second hunk of the patch I've made SND_SOC_AC97_CODEC select SND_SOC_AC97_BUS.

select doesn't respect dependencies, it'll just force on the selected symbol.

#4 lore raw
Quoted 18 lines · Mark Brown
Quoted 16 lines · Maciej S. Szmigiero

W dniu 12.05.2015 19:58, Mark Brown pisze:

Quoted 15 lines · Maciej S. Szmigiero

sound/soc/codecs/Kconfig config SND_SOC_ALL_CODECS · line 22

Quoted 10 lines
sound/soc/codecs/Kconfig +1 -1
@@ -16,7 +16,7 @@ config SND_SOC_ALL_CODECS
  	select SND_SOC_88PM860X if MFD_88PM860X
  	select SND_SOC_L3
  	select SND_SOC_AB8500_CODEC if ABX500_CORE
-	select SND_SOC_AC97_CODEC if SND_SOC_AC97_BUS
+	select SND_SOC_AC97_CODEC
  	select SND_SOC_AD1836 if SPI_MASTER
  	select SND_SOC_AD193X_SPI if SPI_MASTER
  	select SND_SOC_AD193X_I2C if I2C

No, you're missing the point of what _ALL_CODECS does - it builds everything possible. This will break the build for systems without AC'97 support.

Quoted 6 lines
Quoted 3 lines

How?
In the second hunk of the patch I've made SND_SOC_AC97_CODEC select SND_SOC_AC97_BUS.

select doesn't respect dependencies, it'll just force on the selected symbol.

The patch works fine, neither SND_SOC_AC97_BUS nor the symbols selected by SND_SOC_AC97_BUS have any dependencies.

Although one might argue that only AC97 host driver should select SND_SOC_AC97_BUS and the CODEC drivers should depend on it.

- Lars

maintainer
#5 lore raw
Quoted 7 lines · Lars-Peter Clausen
Quoted 2 lines · Mark Brown

select doesn't respect dependencies, it'll just force on the selected symbol.

The patch works fine, neither SND_SOC_AC97_BUS nor the symbols selected by SND_SOC_AC97_BUS have any dependencies.

Does the select from SND_SOC_AC97_BUS actually happen if it is selected by SND_SOC_ALL_CODECS? That's the issue, if it works now it's a relatively recent thing.

#6 lore raw
Quoted 6 lines · Mark Brown
Quoted 4 lines · Lars-Peter Clausen
Quoted 2 lines · Mark Brown

select doesn't respect dependencies, it'll just force on the selected symbol.

Quoted 6 lines
Quoted 2 lines

The patch works fine, neither SND_SOC_AC97_BUS nor the symbols selected by SND_SOC_AC97_BUS have any dependencies.

Does the select from SND_SOC_AC97_BUS actually happen if it is selected by SND_SOC_ALL_CODECS? That's the issue, if it works now it's a relatively recent thing.

I'm not sure I fully understand what you mean.

The Kconfig entry for the CODEC has no 'depends on'. It does a 'select SND_SOC_AC97_BUS', which means all built time dependencies are pulled in this way. So if SND_SOC_ALL_CODECS selects the CODEC unconditionally that should work fine, since no dependencies are bypassed.

maintainer
#7 lore raw
Quoted 6 lines · Lars-Peter Clausen
Quoted 3 lines · Mark Brown

Does the select from SND_SOC_AC97_BUS actually happen if it is selected by SND_SOC_ALL_CODECS? That's the issue, if it works now it's a relatively recent thing.

Quoted 6 lines

I'm not sure I fully understand what you mean.

The Kconfig entry for the CODEC has no 'depends on'. It does a 'select SND_SOC_AC97_BUS', which means all built time dependencies are pulled in this way. So if SND_SOC_ALL_CODECS selects the CODEC unconditionally that should work fine, since no dependencies are bypassed.

No, it's not just dependencies but also selects that get ignored (or used to anyway like I say) - a select just forces the symbol on.

#8 lore raw
Quoted 9 lines · Mark Brown
Quoted 7 lines · Lars-Peter Clausen
Quoted 3 lines · Mark Brown

Does the select from SND_SOC_AC97_BUS actually happen if it is selected by SND_SOC_ALL_CODECS? That's the issue, if it works now it's a relatively recent thing.

I'm not sure I fully understand what you mean.

Quoted 8 lines
Quoted 4 lines

The Kconfig entry for the CODEC has no 'depends on'. It does a 'select SND_SOC_AC97_BUS', which means all built time dependencies are pulled in this way. So if SND_SOC_ALL_CODECS selects the CODEC unconditionally that should work fine, since no dependencies are bypassed.

No, it's not just dependencies but also selects that get ignored (or used to anyway like I say) - a select just forces the symbol on.

select forces a symbol on regardless of whether its dependencies are met or not. But for any symbol that is on, no matter whether it was manually selected or selected by a 'select' from another symbol, any symbols selected by that symbol will be turned on. It's been that way as long as I can remember.

maintainer
#9 lore raw
Quoted 5 lines · Lars-Peter Clausen

select forces a symbol on regardless of whether its dependencies are met or not. But for any symbol that is on, no matter whether it was manually selected or selected by a 'select' from another symbol, any symbols selected by that symbol will be turned on. It's been that way as long as I can remember.

Ah, good - that's not always been the case (or perhaps not always reliably been the case which is about the same thing).