diff mbox

ASoC: codecs-ac97: make selectable in config

Message ID 554E8634.2010008@maciej.szmigiero.name (mailing list archive)
State Accepted
Commit a60abdf93b6935d523874badee62f538739d055c
Headers show

Commit Message

Maciej S. Szmigiero May 9, 2015, 10:12 p.m. UTC
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).

Signed-off-by: Maciej Szmigiero <mail@maciej.szmigiero.name>

Comments

Mark Brown May 12, 2015, 5:58 p.m. UTC | #1
On Sun, May 10, 2015 at 12:12:04AM +0200, Maciej S. Szmigiero wrote:

> @@ -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.
Maciej S. Szmigiero May 13, 2015, 8:57 p.m. UTC | #2
Thanks for looking into the patch.

W dniu 12.05.2015 19:58, Mark Brown pisze:
> On Sun, May 10, 2015 at 12:12:04AM +0200, Maciej S. Szmigiero wrote:
> 
>> @@ -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
Mark Brown May 14, 2015, 5:53 p.m. UTC | #3
On Wed, May 13, 2015 at 10:57:24PM +0200, Maciej S. Szmigiero wrote:
> W dniu 12.05.2015 19:58, Mark Brown pisze:
> > On Sun, May 10, 2015 at 12:12:04AM +0200, Maciej S. Szmigiero wrote:

> >> @@ -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.

select doesn't respect dependencies, it'll just force on the selected
symbol.
Lars-Peter Clausen May 14, 2015, 6:46 p.m. UTC | #4
On 05/14/2015 07:53 PM, Mark Brown wrote:
> On Wed, May 13, 2015 at 10:57:24PM +0200, Maciej S. Szmigiero wrote:
>> W dniu 12.05.2015 19:58, Mark Brown pisze:
>>> On Sun, May 10, 2015 at 12:12:04AM +0200, Maciej S. Szmigiero wrote:
>
>>>> @@ -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.
>
> 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
Mark Brown May 14, 2015, 7:10 p.m. UTC | #5
On Thu, May 14, 2015 at 08:46:09PM +0200, Lars-Peter Clausen wrote:
> On 05/14/2015 07:53 PM, Mark Brown wrote:

> >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.
Lars-Peter Clausen May 14, 2015, 7:24 p.m. UTC | #6
On 05/14/2015 09:10 PM, Mark Brown wrote:
> On Thu, May 14, 2015 at 08:46:09PM +0200, Lars-Peter Clausen wrote:
>> On 05/14/2015 07:53 PM, Mark Brown wrote:
>
>>> 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.

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.
Mark Brown May 14, 2015, 7:28 p.m. UTC | #7
On Thu, May 14, 2015 at 09:24:15PM +0200, Lars-Peter Clausen wrote:
> On 05/14/2015 09:10 PM, Mark Brown wrote:

> >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.

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.
Lars-Peter Clausen May 14, 2015, 7:38 p.m. UTC | #8
On 05/14/2015 09:28 PM, Mark Brown wrote:
> On Thu, May 14, 2015 at 09:24:15PM +0200, Lars-Peter Clausen wrote:
>> On 05/14/2015 09:10 PM, Mark Brown wrote:
>
>>> 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.
>
> 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.
Mark Brown May 14, 2015, 7:43 p.m. UTC | #9
On Thu, May 14, 2015 at 09:38:55PM +0200, Lars-Peter Clausen wrote:

> 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).
Mark Brown May 22, 2015, 12:41 p.m. UTC | #10
On Sun, May 10, 2015 at 12:12:04AM +0200, Maciej S. Szmigiero wrote:
> Make generic ASoC AC'97 CODEC selectable in config.

Applied, thanks.
diff mbox

Patch

--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -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