Skip to contentSkip to conversation

cpufreq: move frequency table helpers to extra file

PATCH Superseded Dominik Brodowski 1 participant 1 message Feb 6, 2003 CPU frequency scaling framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpufreq: move frequency table helpers to extra file

The CPU frequency table helpers can easily be modularized -- especially as they are not needed on all architectures, or for all drivers.

 arch/i386/Kconfig            |   20 +++-
 arch/sparc64/Kconfig         |    7 +
 drivers/cpufreq/Makefile     |    3
 drivers/cpufreq/freq_table.c |  201 +++++++++++++++++++++++++++++++++++++++++++
 include/linux/cpufreq.h      |    3
 kernel/cpufreq.c             |  188 ----------------------------------------
 6 files changed, 228 insertions(+), 194 deletions(-)
arch/i386/Kconfig +15 -5
diff -ruN linux-original/arch/i386/Kconfig linux/arch/i386/Kconfig
@@ -983,9 +983,19 @@
 
 	  If in doubt, say N.
 
+config CPU_FREQ_TABLE
+       tristate "CPU frequency table helpers"
+       depends on CPU_FREQ
+       default y
+       help
+         Many CPUFreq drivers use these helpers, so only say N here if
+	 the CPUFreq driver of your choice doesn't need these helpers.
+
+	 If in doubt, say Y.
+
 config X86_ACPI_CPUFREQ
 	tristate "ACPI Processor P-States driver"
-	depends on CPU_FREQ && ACPI_PROCESSOR
+	depends on CPU_FREQ && ACPI_PROCESSOR && CPU_FREQ_TABLE
 	help
 	  This driver adds a CPUFreq driver which utilizes the ACPI
 	  Processor Performance States.
@@ -996,7 +1006,7 @@
 
 config X86_POWERNOW_K6
 	tristate "AMD Mobile K6-2/K6-3 PowerNow!"
-	depends on CPU_FREQ
+	depends on CPU_FREQ && CPU_FREQ_TABLE
 	help
 	  This adds the CPUFreq driver for mobile AMD K6-2+ and mobile
 	  AMD K6-3+ processors.
@@ -1007,7 +1017,7 @@
 
 config ELAN_CPUFREQ
 	tristate "AMD Elan"
-	depends on CPU_FREQ && MELAN
+	depends on CPU_FREQ && MELAN && CPU_FREQ_TABLE
 	---help---
 	  This adds the CPUFreq driver for AMD Elan SC400 and SC410
 	  processors.
@@ -1034,7 +1044,7 @@
 
 config X86_SPEEDSTEP
 	tristate "Intel Speedstep"
-	depends on CPU_FREQ
+	depends on CPU_FREQ && CPU_FREQ_TABLE
 	help
 	  This adds the CPUFreq driver for certain mobile Intel Pentium III
 	  (Coppermine), all mobile Intel Pentium III-M (Tulatin) and all
@@ -1046,7 +1056,7 @@
 
 config X86_P4_CLOCKMOD
 	tristate "Intel Pentium 4 clock modulation"
-	depends on CPU_FREQ
+	depends on CPU_FREQ && CPU_FREQ_TABLE
 	help
 	  This adds the CPUFreq driver for Intel Pentium 4 / XEON
 	  processors.
arch/sparc64/Kconfig +6 -1
diff -ruN linux-original/arch/sparc64/Kconfig linux/arch/sparc64/Kconfig
@@ -162,9 +162,14 @@
 	  
 	  If in doubt, say N.
 
+config CPU_FREQ_TABLE
+       tristate
+       default y
+
+
 config US3_FREQ
 	tristate "UltraSPARC-III CPU Frequency driver"
-	depends on CPU_FREQ
+	depends on CPU_FREQ && CPU_FREQ_TABLE
 	help
 	  This adds the CPUFreq driver for UltraSPARC-III processors.
 
drivers/Makefile +1 -0
diff -ruN linux-original/drivers/Makefile linux/drivers/Makefile
@@ -45,3 +45,4 @@
 obj-$(CONFIG_ISDN_BOOL)		+= isdn/
 obj-$(CONFIG_MCA)		+= mca/
 obj-$(CONFIG_EISA)		+= eisa/
+obj-$(CONFIG_CPU_FREQ)		+= cpufreq/
drivers/cpufreq/Makefile +4 -0
diff -ruN linux-original/drivers/cpufreq/Makefile linux/drivers/cpufreq/Makefile
@@ -0,0 +1,4 @@
+#CPUfreq governors and cross-arch helpers
+obj-$(CONFIG_CPU_FREQ_TABLE)		+= freq_table.o
+
+export-objs	+= freq_table.o
drivers/cpufreq/freq_table.c +201 -0

201 lines not on this page · raw message

include/linux/cpufreq.h +3 -0
diff -ruN linux-original/include/linux/cpufreq.h linux/include/linux/cpufreq.h
@@ -297,6 +297,7 @@
 
 #endif /* CONFIG_CPU_FREQ_24_API */
 
+#if defined(CONFIG_CPU_FREQ_TABLE) || defined(CONFIG_CPU_FREQ_TABLE_MODULE)
 /*********************************************************************
  *                     FREQUENCY TABLE HELPERS                       *
  *********************************************************************/
@@ -326,4 +327,6 @@
 				   unsigned int relation,
 				   unsigned int *index);
 
+#endif /* CONFIG_CPU_FREQ_TABLE */
+
 #endif /* _LINUX_CPUFREQ_H */
kernel/cpufreq.c +0 -188

191 lines not on this page · raw message