Skip to contentSkip to conversation

ASoC: Hide TLV320AIC26 configuration option for non-OpenFirwmare users

PATCH In review Mark Brown 3 participants 7 messages Oct 13, 2008 – Oct 14, 2008

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 ASoC: Hide TLV320AIC26 configuration option for non-OpenFirwmare users

Since Kconfig ignores dependencies on select and other users should select SND_SOC_TLV320AIC26 we can add a dependency on the OpenFirmware helper to avoid exposing the menu entry to users who can't benefit from it.

Thanks to Takashi for the suggestion.

---
 sound/soc/codecs/Kconfig |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
sound/soc/codecs/Kconfig +3 -0
index 4975d85..9242889 100644
@@ -70,6 +70,9 @@ config SND_SOC_TLV320AIC23
 config SND_SOC_TLV320AIC26
 	tristate "TI TLV320AIC26 Codec support"
 	depends on SPI
+	# Note the Kconfig doesn't enforce dependencies - this just
+	# prevents non-OF users seeing the tristate in menus.
+	depends on SND_SOC_OF_SIMPLE
 
 config SND_SOC_TLV320AIC3X
 	tristate
Signature · 1 line
1.5.6.5
#1 lore raw

At Mon, 13 Oct 2008 17:38:34 +0100,

Quoted 5 lines · Mark Brown

Since Kconfig ignores dependencies on select and other users should select SND_SOC_TLV320AIC26 we can add a dependency on the OpenFirmware helper to avoid exposing the menu entry to users who can't benefit from it.

Hmm, I'm afraid this may disable CONFIG_SND_SOC_TLV320AIC26 when CONFIG_SND_SOC_OF_SIMPLE=n automatically, no?

Quoted 1 line

Thanks to Takashi for the suggestion.

Actually I proposed a wrong solution. What I meant was the form using "if" instead of "depends on":

config SND_SOC_TLV320AIC26
tristate "TI TLV320AIC26 Codec support" if SND_SOC_OF_SIMPLE

	...

In this way, the selectable item appears only when CONFIG_SND_SOC_OF_SIMPLE is set. The other dependencies remain as they are.

Takashi

Quoted 22 lines
---
 sound/soc/codecs/Kconfig |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
sound/soc/codecs/Kconfig +3 -0
index 4975d85..9242889 100644
@@ -70,6 +70,9 @@ config SND_SOC_TLV320AIC23
 config SND_SOC_TLV320AIC26
 	tristate "TI TLV320AIC26 Codec support"
 	depends on SPI
+	# Note the Kconfig doesn't enforce dependencies - this just
+	# prevents non-OF users seeing the tristate in menus.
+	depends on SND_SOC_OF_SIMPLE
 
 config SND_SOC_TLV320AIC3X
 	tristate
Signature · 1 line
1.5.6.5
author
#2 lore raw
Quoted 2 lines · Takashi Iwai

Hmm, I'm afraid this may disable CONFIG_SND_SOC_TLV320AIC26 when CONFIG_SND_SOC_OF_SIMPLE=n automatically, no?

Yes, I'd feared that too but it doesn't do that, at least not in my testing - the dependencies are just completely ignored.

Quoted 5 lines
Quoted 1 line

Thanks to Takashi for the suggestion.

Actually I proposed a wrong solution. What I meant was the form using "if" instead of "depends on":

Quoted 7 lines

config SND_SOC_TLV320AIC26
tristate "TI TLV320AIC26 Codec support" if SND_SOC_OF_SIMPLE

	...

In this way, the selectable item appears only when CONFIG_SND_SOC_OF_SIMPLE is set. The other dependencies remain as they are.

Ah, yes. That seems to work too and is a bit neater, though still a bit nasty since it looks like the tristate is conditional on the OpenFirmware support now so it's still not entirely clear that the right thing will happen. Updated patch coming in a moment.

author
#3 lore raw

PATCH 1/1 ASoC: Hide TLV320AIC26 configuration option for non-OpenFirwmare users

Make the visibility of the tristate conditional on having the OpenFirmware helper code enabed so that users who can't use it don't see the visible option. Kconfig ignores dependencies for select so other users are unaffected.

Thanks to Takashi for the suggestion.

---
 sound/soc/codecs/Kconfig |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
sound/soc/codecs/Kconfig +1 -1
index 4975d85..38a0e3b 100644
@@ -68,7 +68,7 @@ config SND_SOC_TLV320AIC23
 	depends on I2C
 
 config SND_SOC_TLV320AIC26
-	tristate "TI TLV320AIC26 Codec support"
+	tristate "TI TLV320AIC26 Codec support" if SND_SOC_OF_SIMPLE
 	depends on SPI
 
 config SND_SOC_TLV320AIC3X
Signature · 1 line
1.5.4.3
#4 lore raw

At Mon, 13 Oct 2008 19:16:14 +0100,

Quoted 9 lines · Mark Brown

Make the visibility of the tristate conditional on having the OpenFirmware helper code enabed so that users who can't use it don't see the visible option. Kconfig ignores dependencies for select so other users are unaffected.

Thanks to Takashi for the suggestion.

Applied now. Thanks.

Takashi

Quoted 20 lines
---
 sound/soc/codecs/Kconfig |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
sound/soc/codecs/Kconfig +1 -1
index 4975d85..38a0e3b 100644
@@ -68,7 +68,7 @@ config SND_SOC_TLV320AIC23
 	depends on I2C
 
 config SND_SOC_TLV320AIC26
-	tristate "TI TLV320AIC26 Codec support"
+	tristate "TI TLV320AIC26 Codec support" if SND_SOC_OF_SIMPLE
 	depends on SPI
 
 config SND_SOC_TLV320AIC3X
Signature · 1 line
1.5.4.3
#5 lore raw
In reply to Mark Brown

At Mon, 13 Oct 2008 19:14:58 +0100,

Quoted 18 lines · Mark Brown
Quoted 2 lines · Takashi Iwai

Hmm, I'm afraid this may disable CONFIG_SND_SOC_TLV320AIC26 when CONFIG_SND_SOC_OF_SIMPLE=n automatically, no?

Yes, I'd feared that too but it doesn't do that, at least not in my testing - the dependencies are just completely ignored.

Quoted 8 lines
Quoted 1 line

Thanks to Takashi for the suggestion.

Actually I proposed a wrong solution. What I meant was the form using "if" instead of "depends on":

config SND_SOC_TLV320AIC26
tristate "TI TLV320AIC26 Codec support" if SND_SOC_OF_SIMPLE

	...
Quoted 8 lines
Quoted 3 lines

In this way, the selectable item appears only when CONFIG_SND_SOC_OF_SIMPLE is set. The other dependencies remain as they are.

Ah, yes. That seems to work too and is a bit neater, though still a bit nasty since it looks like the tristate is conditional on the OpenFirmware support now so it's still not entirely clear that the right thing will happen.

Well, this is a standard technique. You can find "if EMBEDDED" in many Kconfig items, too.

Takashi

#6 lore raw
Quoted 2 lines · Takashi Iwai

Well, this is a standard technique. You can find "if EMBEDDED" in many Kconfig items, too.

Yeah, though the cases I remembered noticing were for things were the entry should be both hidden and disabled.