Skip to contentSkip to conversation

Use menuconfig for CONFIG_CPU_FREQ

PATCH Superseded Alessandro Guido 3 participants 10 messages Feb 13, 2008 – Feb 14, 2008

Subsystems (6)
Arm (32-bit) x86 PowerPC SuperH +2 more subsystems
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Use menuconfig for CONFIG_CPU_FREQ

---

 arch/arm/Kconfig                    |    4 ----
 arch/avr32/Kconfig                  |    4 ----
 arch/blackfin/Kconfig               |   12 ++----------
 arch/powerpc/platforms/Kconfig      |    5 ++---
 arch/sh/Kconfig                     |    4 ----
 arch/x86/kernel/cpu/cpufreq/Kconfig |    4 ----
 drivers/cpufreq/Kconfig             |    2 +-
 7 files changed, 5 insertions(+), 30 deletions(-)
arch/arm/Kconfig +0 -4
index 9619c43..2e21703 100644
@@ -948,8 +948,6 @@ endmenu
 
 if (ARCH_SA1100 || ARCH_INTEGRATOR || ARCH_OMAP || ARCH_IMX || ARCH_PXA)
 
-menu "CPU Frequency scaling"
-
 source "drivers/cpufreq/Kconfig"
 
 config CPU_FREQ_SA1100
@@ -988,8 +986,6 @@ config CPU_FREQ_PXA
 	default y
 	select CPU_FREQ_DEFAULT_GOV_USERSPACE
 
-endmenu
-
 endif
 
 menu "Floating point emulation"
arch/avr32/Kconfig +0 -4
index c75d708..2274523 100644
@@ -197,8 +197,6 @@ endmenu
 
 menu "Power management options"
 
-menu "CPU Frequency scaling"
-
 source "drivers/cpufreq/Kconfig"
 
 config CPU_FREQ_AT32AP
@@ -214,8 +212,6 @@ config CPU_FREQ_AT32AP
 
 endmenu
 
-endmenu
-
 menu "Bus options"
 
 config PCI
arch/blackfin/Kconfig +2 -10
index 589c6ac..c565d7c 100644
@@ -964,18 +964,10 @@ endmenu
 
 if (BF537 || BF533 || BF54x)
 
-menu "CPU Frequency scaling"
-
 source "drivers/cpufreq/Kconfig"
 
-config CPU_FREQ
-	bool
-	default n
-	help
-	  If you want to enable this option, you should select the
-	  DPMC driver from Character Devices.
-endmenu
-
+comment "You should select the DPMC driver from Character Devices for this to work"
+	depends on CPU_FREQ
 endif
 
 source "net/Kconfig"
arch/powerpc/platforms/Kconfig +2 -3
index fcedbec..f00f8d4 100644
@@ -180,8 +180,7 @@ config GENERIC_IOMAP
 
 source "drivers/cpufreq/Kconfig"
 
-menu "CPU Frequency drivers"
-	depends on CPU_FREQ
+if CPU_FREQ
 
 config CPU_FREQ_PMAC
 	bool "Support for Apple PowerBooks"
@@ -209,7 +208,7 @@ config PPC_PASEMI_CPUFREQ
 	  This adds the support for frequency switching on PA Semi
 	  PWRficient processors.
 
-endmenu
+endif # CPU_FREQ
 
 config PPC601_SYNC_FIX
 	bool "Workarounds for PPC601 bugs"
arch/sh/Kconfig +0 -4
index d87d4bf..a6a128c 100644
@@ -599,8 +599,6 @@ source "kernel/time/Kconfig"
 
 endmenu
 
-menu "CPU Frequency scaling"
-
 source "drivers/cpufreq/Kconfig"
 
 config SH_CPU_FREQ
@@ -615,8 +613,6 @@ config SH_CPU_FREQ
 
 	  If unsure, say N.
 
-endmenu
-
 source "arch/sh/drivers/Kconfig"
 
 endmenu
arch/x86/kernel/cpu/cpufreq/Kconfig +0 -4
index cb7a571..fc5254d 100644
@@ -2,8 +2,6 @@
 # CPU Frequency scaling
 #
 
-menu "CPU Frequency scaling"
-
 source "drivers/cpufreq/Kconfig"
 
 if CPU_FREQ
@@ -271,5 +269,3 @@ config X86_SPEEDSTEP_RELAXED_CAP_CHECK
 	  parameter "relaxed_check=1" is passed to the module.
 
 endif	# CPU_FREQ
-
-endmenu
drivers/cpufreq/Kconfig +1 -1
index c159ae6..ef80bd0 100644
@@ -1,4 +1,4 @@
-config CPU_FREQ
+menuconfig CPU_FREQ
 	bool "CPU Frequency scaling"
 	help
 	  CPU Frequency scaling allows you to change the clock speed of 
#1 lore raw
Quoted 15 lines · Alessandro Guido
arch/arm/Kconfig +0 -2
index 9619c43..2e21703 100644
@@ -948,8 +948,6 @@ endmenu
 
 if (ARCH_SA1100 || ARCH_INTEGRATOR || ARCH_OMAP || ARCH_IMX || ARCH_PXA)
 
-menu "CPU Frequency scaling"
-
 source "drivers/cpufreq/Kconfig"
 
 config CPU_FREQ_SA1100

arch/arm/Kconfig config CPU_FREQ_PXA · line 992

Quoted 5 lines
arch/arm/Kconfig +0 -2
@@ -988,8 +986,6 @@ config CPU_FREQ_PXA
 	default y
 	select CPU_FREQ_DEFAULT_GOV_USERSPACE
 
-endmenu
-

Doesn't this cause these CPUFREQ options to appear outside of the CPUFREQ menu?

Signature · 3 lines
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:
#2 lore raw
Quoted 3 lines

Doesn't this cause these CPUFREQ options to appear outside of the CPUFREQ menu?

No because they all depend on CPU_FREQ and as far as I understand Kconfig automagically puts them under the same menu.

#3 lore raw
Quoted 6 lines · Alessandro Guido
Quoted 3 lines

Doesn't this cause these CPUFREQ options to appear outside of the CPUFREQ menu?

No because they all depend on CPU_FREQ and as far as I understand Kconfig automagically puts them under the same menu.

Hmm, that's not documented behaviour. If we're starting to rely on that maybe it should be documented as being the expected behaviour?

(here's the cut down patch for Roman's reference)

arch/arm/Kconfig +0 -4
index 9619c43..2e21703 100644
@@ -948,8 +948,6 @@ endmenu
 
 if (ARCH_SA1100 || ARCH_INTEGRATOR || ARCH_OMAP || ARCH_IMX || ARCH_PXA)
 
-menu "CPU Frequency scaling"
-
 source "drivers/cpufreq/Kconfig"
 
 config CPU_FREQ_SA1100
@@ -988,8 +986,6 @@ config CPU_FREQ_PXA
 	default y
 	select CPU_FREQ_DEFAULT_GOV_USERSPACE
 
-endmenu
-
 endif
 
 menu "Floating point emulation"
drivers/cpufreq/Kconfig +1 -1
index c159ae6..ef80bd0 100644
@@ -1,4 +1,4 @@
-config CPU_FREQ
+menuconfig CPU_FREQ
 	bool "CPU Frequency scaling"
 	help
 	  CPU Frequency scaling allows you to change the clock speed of 
Signature · 3 lines
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:
#4 lore raw

Hi,

Quoted 5 lines · Russell King
Quoted 2 lines

No because they all depend on CPU_FREQ and as far as I understand Kconfig automagically puts them under the same menu.

Hmm, that's not documented behaviour. If we're starting to rely on that maybe it should be documented as being the expected behaviour?

It is. :)
Look for "Menu structure" in kconfig-language.txt.

bye, Roman

#5 lore raw
Quoted 11 lines · Roman Zippel

Hi,

Quoted 5 lines · Russell King
Quoted 2 lines

No because they all depend on CPU_FREQ and as far as I understand Kconfig automagically puts them under the same menu.

Hmm, that's not documented behaviour. If we're starting to rely on that maybe it should be documented as being the expected behaviour?

It is. :)

I disagree.

Quoted 1 line

Look for "Menu structure" in kconfig-language.txt.

Yes, I read that and didn't get the answer to the question above. It's unclear how:

config CPU_FREQ_INTEGRATOR
tristate "CPUfreq driver for ARM Integrator CPUs" depends on ARCH_INTEGRATOR && CPU_FREQ

being under CPU_FREQ rather than ARCH_INTEGRATOR

Signature · 3 lines
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:
#6 lore raw

PATCH v2 1/1 Use menuconfig for CONFIG_CPU_FREQ

Use menuconfig for CONFIG_CPU_FREQ.
This version tries to be more explicit about dependencies on the CPU_FREQ symbol in the arch specific Kconfigs.

---

 arch/arm/Kconfig                    |   16 ++++++++--------
 arch/avr32/Kconfig                  |    8 ++++----
 arch/blackfin/Kconfig               |   14 +++++---------
 arch/powerpc/platforms/Kconfig      |    5 ++---
 arch/sh/Kconfig                     |    7 +++----
 arch/x86/kernel/cpu/cpufreq/Kconfig |    4 ----
 drivers/cpufreq/Kconfig             |    2 +-
 7 files changed, 23 insertions(+), 33 deletions(-)
arch/arm/Kconfig +8 -8
index 9619c43..9f174df 100644
@@ -948,23 +948,23 @@ endmenu
 
 if (ARCH_SA1100 || ARCH_INTEGRATOR || ARCH_OMAP || ARCH_IMX || ARCH_PXA)
 
-menu "CPU Frequency scaling"
-
 source "drivers/cpufreq/Kconfig"
 
+if CPU_FREQ
+
 config CPU_FREQ_SA1100
 	bool
-	depends on CPU_FREQ && (SA1100_H3100 || SA1100_H3600 || SA1100_H3800 || SA1100_LART || SA1100_PLEB || SA1100_BADGE4 || SA1100_HACKKIT)
+	depends on SA1100_H3100 || SA1100_H3600 || SA1100_H3800 || SA1100_LART || SA1100_PLEB || SA1100_BADGE4 || SA1100_HACKKIT
 	default y
 
 config CPU_FREQ_SA1110
 	bool
-	depends on CPU_FREQ && (SA1100_ASSABET || SA1100_CERF || SA1100_PT_SYSTEM3)
+	depends on SA1100_ASSABET || SA1100_CERF || SA1100_PT_SYSTEM3
 	default y
 
 config CPU_FREQ_INTEGRATOR
 	tristate "CPUfreq driver for ARM Integrator CPUs"
-	depends on ARCH_INTEGRATOR && CPU_FREQ
+	depends on ARCH_INTEGRATOR
 	default y
 	help
 	  This enables the CPUfreq driver for ARM Integrator CPUs.
@@ -975,7 +975,7 @@ config CPU_FREQ_INTEGRATOR
 
 config CPU_FREQ_IMX
 	tristate "CPUfreq driver for i.MX CPUs"
-	depends on ARCH_IMX && CPU_FREQ
+	depends on ARCH_IMX
 	default n
 	help
 	  This enables the CPUfreq driver for i.MX CPUs.
@@ -984,11 +984,11 @@ config CPU_FREQ_IMX
 
 config CPU_FREQ_PXA
 	bool
-	depends on CPU_FREQ && ARCH_PXA && PXA25x
+	depends on ARCH_PXA && PXA25x
 	default y
 	select CPU_FREQ_DEFAULT_GOV_USERSPACE
 
-endmenu
+endif # CPU_FREQ
 
 endif
 
arch/avr32/Kconfig +4 -4
index c75d708..c76b1df 100644
@@ -197,13 +197,13 @@ endmenu
 
 menu "Power management options"
 
-menu "CPU Frequency scaling"
-
 source "drivers/cpufreq/Kconfig"
 
+if CPU_FREQ
+
 config CPU_FREQ_AT32AP
 	bool "CPU frequency driver for AT32AP"
-	depends on CPU_FREQ && PLATFORM_AT32AP
+	depends on PLATFORM_AT32AP
 	default n
 	help
 	  This enables the CPU frequency driver for AT32AP processors.
@@ -214,7 +214,7 @@ config CPU_FREQ_AT32AP
 
 endmenu
 
-endmenu
+endif # CPU_FREQ
 
 menu "Bus options"
 
arch/blackfin/Kconfig +5 -9
index 589c6ac..5914e4b 100644
@@ -964,17 +964,13 @@ endmenu
 
 if (BF537 || BF533 || BF54x)
 
-menu "CPU Frequency scaling"
-
 source "drivers/cpufreq/Kconfig"
 
-config CPU_FREQ
-	bool
-	default n
-	help
-	  If you want to enable this option, you should select the
-	  DPMC driver from Character Devices.
-endmenu
+if CPU_FREQ
+
+comment "You should select the DPMC driver from Character Devices for this to work"
+
+endif # CPU_FREQ
 
 endif
 
arch/powerpc/platforms/Kconfig +2 -3
index fcedbec..f00f8d4 100644
@@ -180,8 +180,7 @@ config GENERIC_IOMAP
 
 source "drivers/cpufreq/Kconfig"
 
-menu "CPU Frequency drivers"
-	depends on CPU_FREQ
+if CPU_FREQ
 
 config CPU_FREQ_PMAC
 	bool "Support for Apple PowerBooks"
@@ -209,7 +208,7 @@ config PPC_PASEMI_CPUFREQ
 	  This adds the support for frequency switching on PA Semi
 	  PWRficient processors.
 
-endmenu
+endif # CPU_FREQ
 
 config PPC601_SYNC_FIX
 	bool "Workarounds for PPC601 bugs"
arch/sh/Kconfig +3 -4
index d87d4bf..ee4cd7c 100644
@@ -599,13 +599,12 @@ source "kernel/time/Kconfig"
 
 endmenu
 
-menu "CPU Frequency scaling"
-
 source "drivers/cpufreq/Kconfig"
 
+if CPU_FREQ
+
 config SH_CPU_FREQ
 	tristate "SuperH CPU Frequency driver"
-	depends on CPU_FREQ
 	select CPU_FREQ_TABLE
 	help
 	  This adds the cpufreq driver for SuperH. At present, only
@@ -615,7 +614,7 @@ config SH_CPU_FREQ
 
 	  If unsure, say N.
 
-endmenu
+endif # CPU_FREQ
 
 source "arch/sh/drivers/Kconfig"
 
arch/x86/kernel/cpu/cpufreq/Kconfig +0 -4
index cb7a571..fc5254d 100644
@@ -2,8 +2,6 @@
 # CPU Frequency scaling
 #
 
-menu "CPU Frequency scaling"
-
 source "drivers/cpufreq/Kconfig"
 
 if CPU_FREQ
@@ -271,5 +269,3 @@ config X86_SPEEDSTEP_RELAXED_CAP_CHECK
 	  parameter "relaxed_check=1" is passed to the module.
 
 endif	# CPU_FREQ
-
-endmenu
drivers/cpufreq/Kconfig +1 -1
index c159ae6..ef80bd0 100644
@@ -1,4 +1,4 @@
-config CPU_FREQ
+menuconfig CPU_FREQ
 	bool "CPU Frequency scaling"
 	help
 	  CPU Frequency scaling allows you to change the clock speed of 
#7 lore raw
In reply to Russell King

Hi,

Quoted 8 lines · Russell King

Yes, I read that and didn't get the answer to the question above. It's unclear how:

config CPU_FREQ_INTEGRATOR
tristate "CPUfreq driver for ARM Integrator CPUs" depends on ARCH_INTEGRATOR && CPU_FREQ

being under CPU_FREQ rather than ARCH_INTEGRATOR

The doc says it looks at "the previous entry" and ARCH_INTEGRATOR isn't exactly the previous entry.
For me it was kind of obvious that kconfig wouldn't arbitrarily reorder the menu entries. Only the indentation of an entry is changed not the whole order. Any contributions to clarify this are more than welcome.

bye, Roman

#8 lore raw
Quoted 7 lines · Roman Zippel

Hi,

Quoted 3 lines · Russell King

Yes, I read that and didn't get the answer to the question above. It's unclear how:

Quoted 8 lines
Quoted 5 lines

config CPU_FREQ_INTEGRATOR
tristate "CPUfreq driver for ARM Integrator CPUs" depends on ARCH_INTEGRATOR && CPU_FREQ

being under CPU_FREQ rather than ARCH_INTEGRATOR

The doc says it looks at "the previous entry" and ARCH_INTEGRATOR isn't exactly the previous entry.

Neither is CPU_FREQ "the previous entry". The documentation is unclear.

Quoted 2 lines

For me it was kind of obvious that kconfig wouldn't arbitrarily reorder the menu entries.

It's always obvious for the person who wrote the code. It isn't for those who haven't.

Quoted 2 lines

Only the indentation of an entry is changed not the
whole order. Any contributions to clarify this are more than welcome.

Well, I still don't have the necessary understanding to work out how CPU_FREQ is preferred over ARCH_INTEGRATOR, even with your statements that "it is the case". So I'm not in a position to improve the documentation except by adding a sentence to suggest people ask you about it.

Signature · 3 lines
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:
#9 lore raw

Hi,

Quoted 12 lines · Russell King
Quoted 11 lines
Quoted 8 lines

Yes, I read that and didn't get the answer to the question above. It's unclear how:

config CPU_FREQ_INTEGRATOR
tristate "CPUfreq driver for ARM Integrator CPUs" depends on ARCH_INTEGRATOR && CPU_FREQ

being under CPU_FREQ rather than ARCH_INTEGRATOR

The doc says it looks at "the previous entry" and ARCH_INTEGRATOR isn't exactly the previous entry.

Quoted 7 lines

Neither is CPU_FREQ "the previous entry". The documentation is unclear. [..]
Well, I still don't have the necessary understanding to work out how CPU_FREQ is preferred over ARCH_INTEGRATOR, even with your statements that "it is the case". So I'm not in a position to improve the documentation except by adding a sentence to suggest people ask you about it.

The best thing right now in such cases is to use menuconfig/xconfig and actually look at it. xconfig can even show the hidden entries, so it's also easier to answer why some entry isn't becoming a child entry. I can provide a technical explanation of what's happening, but it's likely to be even more confusing, I really have no good idea on how to translate what is quite easily visible in xconfig to actual written documentation.

bye, Roman