]> git.karo-electronics.de Git - linux-beck.git/commitdiff
cpufreq: cpu0: rename driver and internals to 'cpufreq_dt'
authorViresh Kumar <viresh.kumar@linaro.org>
Tue, 9 Sep 2014 14:28:03 +0000 (19:58 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 3 Oct 2014 13:37:54 +0000 (15:37 +0200)
The naming convention of this driver was always under the scanner, people
complained that it should have a more generic name than cpu0, as it manages all
CPUs that are sharing clock lines.

Also, in future it will be modified to support any number of clusters with
separate clock/voltage lines.

Lets rename it to 'cpufreq_dt' from 'cpufreq_cpu0'.

Tested-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
19 files changed:
Documentation/devicetree/bindings/cpufreq/cpufreq-dt.txt [moved from Documentation/devicetree/bindings/cpufreq/cpufreq-cpu0.txt with 85% similarity]
arch/arm/configs/mvebu_v7_defconfig
arch/arm/mach-imx/imx27-dt.c
arch/arm/mach-imx/mach-imx51.c
arch/arm/mach-mvebu/pmsu.c
arch/arm/mach-omap2/pm.c
arch/arm/mach-shmobile/board-ape6evm-reference.c
arch/arm/mach-shmobile/cpufreq.c
arch/arm/mach-shmobile/setup-sh73a0.c
arch/arm/mach-zynq/common.c
drivers/cpufreq/Kconfig
drivers/cpufreq/Kconfig.arm
drivers/cpufreq/Makefile
drivers/cpufreq/cpufreq-dt.c [moved from drivers/cpufreq/cpufreq-cpu0.c with 90% similarity]
drivers/cpufreq/exynos4210-cpufreq.c
drivers/cpufreq/exynos4x12-cpufreq.c
drivers/cpufreq/exynos5250-cpufreq.c
drivers/cpufreq/highbank-cpufreq.c
drivers/cpufreq/s5pv210-cpufreq.c

similarity index 85%
rename from Documentation/devicetree/bindings/cpufreq/cpufreq-cpu0.txt
rename to Documentation/devicetree/bindings/cpufreq/cpufreq-dt.txt
index 366690cb86a3065768b74dbf8136a9c560f94155..e41c98ffbccb2a53e408e83b9886ec6e56713557 100644 (file)
@@ -1,8 +1,8 @@
-Generic CPU0 cpufreq driver
+Generic cpufreq driver
 
-It is a generic cpufreq driver for CPU0 frequency management.  It
-supports both uniprocessor (UP) and symmetric multiprocessor (SMP)
-systems which share clock and voltage across all CPUs.
+It is a generic DT based cpufreq driver for frequency management.  It supports
+both uniprocessor (UP) and symmetric multiprocessor (SMP) systems which share
+clock and voltage across all CPUs.
 
 Both required and optional properties listed below must be defined
 under node /cpus/cpu@0.
index fdfda1fa95212cfb9e594f06ceb49381502db78e..7309988b0f1fe1aa808ba75bdef74531b847b561 100644 (file)
@@ -32,7 +32,7 @@ CONFIG_ARM_ATAG_DTB_COMPAT=y
 CONFIG_CPU_IDLE=y
 CONFIG_ARM_MVEBU_V7_CPUIDLE=y
 CONFIG_CPU_FREQ=y
-CONFIG_CPUFREQ_GENERIC=y
+CONFIG_CPUFREQ_DT=y
 CONFIG_VFP=y
 CONFIG_NET=y
 CONFIG_INET=y
index 080e66c6a1d02722022f12a7991cf0b0b566f72e..dc8f1a6f45f20a9551045105400a30587d00b1a1 100644 (file)
@@ -20,7 +20,7 @@
 
 static void __init imx27_dt_init(void)
 {
-       struct platform_device_info devinfo = { .name = "cpufreq-cpu0", };
+       struct platform_device_info devinfo = { .name = "cpufreq-dt", };
 
        mxc_arch_reset_init_dt();
 
index c77deb3f08939f50304797ea5ac1c1b17983fef7..2c5fcaf8675b96bfdd4ee391871c1602eba5ae08 100644 (file)
@@ -51,7 +51,7 @@ static void __init imx51_ipu_mipi_setup(void)
 
 static void __init imx51_dt_init(void)
 {
-       struct platform_device_info devinfo = { .name = "cpufreq-cpu0", };
+       struct platform_device_info devinfo = { .name = "cpufreq-dt", };
 
        mxc_arch_reset_init_dt();
        imx51_ipu_mipi_setup();
index 8a70a51533fd4507e02f10cb576667500cfbf575..bbd8664d1bacb2732ec58072d630e70d963904de 100644 (file)
@@ -644,7 +644,7 @@ static int __init armada_xp_pmsu_cpufreq_init(void)
                }
        }
 
-       platform_device_register_simple("cpufreq-generic", -1, NULL, 0);
+       platform_device_register_simple("cpufreq-dt", -1, NULL, 0);
        return 0;
 }
 
index 828aee9ea6a8b4146cff3b90ae1c1e909e0bc217..58920bc8807bce963536296bc7914db421c2b6aa 100644 (file)
@@ -282,7 +282,7 @@ static inline void omap_init_cpufreq(void)
        if (!of_have_populated_dt())
                devinfo.name = "omap-cpufreq";
        else
-               devinfo.name = "cpufreq-cpu0";
+               devinfo.name = "cpufreq-dt";
        platform_device_register_full(&devinfo);
 }
 
index 2f7723e5fe91ba1f7adb5e10d38e342277a9fd10..0110751da511c2e33373481af8fbb37105d5f46d 100644 (file)
@@ -50,7 +50,7 @@ static void __init ape6evm_add_standard_devices(void)
 
        r8a73a4_add_dt_devices();
        of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
-       platform_device_register_simple("cpufreq-cpu0", -1, NULL, 0);
+       platform_device_register_simple("cpufreq-dt", -1, NULL, 0);
 }
 
 static const char *ape6evm_boards_compat_dt[] __initdata = {
index 8a24b2be46ae34165a7c613b1d483097ce67a861..57fbff024dcd5dd6ccf23afb94e09d6b0ae47796 100644 (file)
@@ -12,6 +12,6 @@
 
 int __init shmobile_cpufreq_init(void)
 {
-       platform_device_register_simple("cpufreq-cpu0", -1, NULL, 0);
+       platform_device_register_simple("cpufreq-dt", -1, NULL, 0);
        return 0;
 }
index 2c802ae9b241332f11d120b2dd188e6c21fc1e92..15b990cd8c70bc571175ed98483923abda858d09 100644 (file)
@@ -775,7 +775,7 @@ void __init sh73a0_add_early_devices(void)
 
 void __init sh73a0_add_standard_devices_dt(void)
 {
-       struct platform_device_info devinfo = { .name = "cpufreq-cpu0", .id = -1, };
+       struct platform_device_info devinfo = { .name = "cpufreq-dt", .id = -1, };
 
        /* clocks are setup late during boot in the case of DT */
        sh73a0_clock_init();
@@ -784,7 +784,7 @@ void __init sh73a0_add_standard_devices_dt(void)
                             ARRAY_SIZE(sh73a0_devices_dt));
        of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 
-       /* Instantiate cpufreq-cpu0 */
+       /* Instantiate cpufreq-dt */
        platform_device_register_full(&devinfo);
 }
 
index 31a6fa40ba37ef0b37da4d9439258ba3e2b8726b..ec03ec40e9c6fea3c107704bb85c5498ca0d8b77 100644 (file)
@@ -104,7 +104,7 @@ static int __init zynq_get_revision(void)
  */
 static void __init zynq_init_machine(void)
 {
-       struct platform_device_info devinfo = { .name = "cpufreq-cpu0", };
+       struct platform_device_info devinfo = { .name = "cpufreq-dt", };
        struct soc_device_attribute *soc_dev_attr;
        struct soc_device *soc_dev;
        struct device *parent = NULL;
index ffe350f86bca570e879177c63395efff5de6587d..3489f8f5fadabee1b8db494c7b5dbd996bd70e33 100644 (file)
@@ -183,14 +183,14 @@ config CPU_FREQ_GOV_CONSERVATIVE
 
          If in doubt, say N.
 
-config GENERIC_CPUFREQ_CPU0
-       tristate "Generic CPU0 cpufreq driver"
+config CPUFREQ_DT
+       tristate "Generic DT based cpufreq driver"
        depends on HAVE_CLK && OF
-       # if CPU_THERMAL is on and THERMAL=m, CPU0 cannot be =y:
+       # if CPU_THERMAL is on and THERMAL=m, CPUFREQ_DT cannot be =y:
        depends on !CPU_THERMAL || THERMAL
        select PM_OPP
        help
-         This adds a generic cpufreq driver for CPU0 frequency management.
+         This adds a generic DT based cpufreq driver for frequency management.
          It supports both uniprocessor (UP) and symmetric multiprocessor (SMP)
          systems which share clock and voltage across all CPUs.
 
index 7364a538e0562a82b855c95305f983d8a63eb2be..48ed28b789f7605e0d9c241fa70fce4f40332a83 100644 (file)
@@ -92,7 +92,7 @@ config ARM_EXYNOS_CPU_FREQ_BOOST_SW
 
 config ARM_HIGHBANK_CPUFREQ
        tristate "Calxeda Highbank-based"
-       depends on ARCH_HIGHBANK && GENERIC_CPUFREQ_CPU0 && REGULATOR
+       depends on ARCH_HIGHBANK && CPUFREQ_DT && REGULATOR
        default m
        help
          This adds the CPUFreq driver for Calxeda Highbank SoC
index db6d9a2fea4d534f135af08880f229d511633c91..40c53dc1937ec6a4fc22e61f497939ba2ada54bd 100644 (file)
@@ -13,7 +13,7 @@ obj-$(CONFIG_CPU_FREQ_GOV_ONDEMAND)   += cpufreq_ondemand.o
 obj-$(CONFIG_CPU_FREQ_GOV_CONSERVATIVE)        += cpufreq_conservative.o
 obj-$(CONFIG_CPU_FREQ_GOV_COMMON)              += cpufreq_governor.o
 
-obj-$(CONFIG_GENERIC_CPUFREQ_CPU0)     += cpufreq-cpu0.o
+obj-$(CONFIG_CPUFREQ_DT)               += cpufreq-dt.o
 
 ##################################################################################
 # x86 drivers.
similarity index 90%
rename from drivers/cpufreq/cpufreq-cpu0.c
rename to drivers/cpufreq/cpufreq-dt.c
index a5f8c5f5f4f450ffe63698743e78b8f6561b522d..e00265066a758e76d4051742526b8ffc3a278a9e 100644 (file)
@@ -4,7 +4,7 @@
  * Copyright (C) 2014 Linaro.
  * Viresh Kumar <viresh.kumar@linaro.org>
  *
- * The OPP code in function cpu0_set_target() is reused from
+ * The OPP code in function set_target() is reused from
  * drivers/cpufreq/omap-cpufreq.c
  *
  * This program is free software; you can redistribute it and/or modify
@@ -35,7 +35,7 @@ struct private_data {
        unsigned int voltage_tolerance; /* in percentage */
 };
 
-static int cpu0_set_target(struct cpufreq_policy *policy, unsigned int index)
+static int set_target(struct cpufreq_policy *policy, unsigned int index)
 {
        struct dev_pm_opp *opp;
        struct cpufreq_frequency_table *freq_table = policy->freq_table;
@@ -176,7 +176,7 @@ try_again:
        return ret;
 }
 
-static int cpu0_cpufreq_init(struct cpufreq_policy *policy)
+static int cpufreq_init(struct cpufreq_policy *policy)
 {
        struct cpufreq_frequency_table *freq_table;
        struct thermal_cooling_device *cdev;
@@ -287,7 +287,7 @@ out_put_reg_clk:
        return ret;
 }
 
-static int cpu0_cpufreq_exit(struct cpufreq_policy *policy)
+static int cpufreq_exit(struct cpufreq_policy *policy)
 {
        struct private_data *priv = policy->driver_data;
 
@@ -301,18 +301,18 @@ static int cpu0_cpufreq_exit(struct cpufreq_policy *policy)
        return 0;
 }
 
-static struct cpufreq_driver cpu0_cpufreq_driver = {
+static struct cpufreq_driver dt_cpufreq_driver = {
        .flags = CPUFREQ_STICKY | CPUFREQ_NEED_INITIAL_FREQ_CHECK,
        .verify = cpufreq_generic_frequency_table_verify,
-       .target_index = cpu0_set_target,
+       .target_index = set_target,
        .get = cpufreq_generic_get,
-       .init = cpu0_cpufreq_init,
-       .exit = cpu0_cpufreq_exit,
-       .name = "generic_cpu0",
+       .init = cpufreq_init,
+       .exit = cpufreq_exit,
+       .name = "cpufreq-dt",
        .attr = cpufreq_generic_attr,
 };
 
-static int cpu0_cpufreq_probe(struct platform_device *pdev)
+static int dt_cpufreq_probe(struct platform_device *pdev)
 {
        struct device *cpu_dev;
        struct regulator *cpu_reg;
@@ -334,30 +334,30 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev)
        if (!IS_ERR(cpu_reg))
                regulator_put(cpu_reg);
 
-       ret = cpufreq_register_driver(&cpu0_cpufreq_driver);
+       ret = cpufreq_register_driver(&dt_cpufreq_driver);
        if (ret)
                dev_err(cpu_dev, "failed register driver: %d\n", ret);
 
        return ret;
 }
 
-static int cpu0_cpufreq_remove(struct platform_device *pdev)
+static int dt_cpufreq_remove(struct platform_device *pdev)
 {
-       cpufreq_unregister_driver(&cpu0_cpufreq_driver);
+       cpufreq_unregister_driver(&dt_cpufreq_driver);
        return 0;
 }
 
-static struct platform_driver cpu0_cpufreq_platdrv = {
+static struct platform_driver dt_cpufreq_platdrv = {
        .driver = {
-               .name   = "cpufreq-cpu0",
+               .name   = "cpufreq-dt",
                .owner  = THIS_MODULE,
        },
-       .probe          = cpu0_cpufreq_probe,
-       .remove         = cpu0_cpufreq_remove,
+       .probe          = dt_cpufreq_probe,
+       .remove         = dt_cpufreq_remove,
 };
-module_platform_driver(cpu0_cpufreq_platdrv);
+module_platform_driver(dt_cpufreq_platdrv);
 
 MODULE_AUTHOR("Viresh Kumar <viresh.kumar@linaro.org>");
 MODULE_AUTHOR("Shawn Guo <shawn.guo@linaro.org>");
-MODULE_DESCRIPTION("Generic CPU0 cpufreq driver");
+MODULE_DESCRIPTION("Generic cpufreq driver");
 MODULE_LICENSE("GPL");
index 61a54310a1b9df6923a1fbfbb3ab6e1872c914eb..843ec824fd91051db1af8751d155018261d9043c 100644 (file)
@@ -127,7 +127,7 @@ int exynos4210_cpufreq_init(struct exynos_dvfs_info *info)
         * dependencies on platform headers. It is necessary to enable
         * Exynos multi-platform support and will be removed together with
         * this whole driver as soon as Exynos gets migrated to use
-        * cpufreq-cpu0 driver.
+        * cpufreq-dt driver.
         */
        np = of_find_compatible_node(NULL, NULL, "samsung,exynos4210-clock");
        if (!np) {
index 351a2074cfea784c8a522b3fa6080a67c59e7180..9e78a850e29f4dc967fceb422f22cdc6a571355c 100644 (file)
@@ -174,7 +174,7 @@ int exynos4x12_cpufreq_init(struct exynos_dvfs_info *info)
         * dependencies on platform headers. It is necessary to enable
         * Exynos multi-platform support and will be removed together with
         * this whole driver as soon as Exynos gets migrated to use
-        * cpufreq-cpu0 driver.
+        * cpufreq-dt driver.
         */
        np = of_find_compatible_node(NULL, NULL, "samsung,exynos4412-clock");
        if (!np) {
index c91ce69dc63101d3a1f866b906acaf780c20070a..3eafdc7ba7877f4eedc2484fa7208c32f5cf49eb 100644 (file)
@@ -153,7 +153,7 @@ int exynos5250_cpufreq_init(struct exynos_dvfs_info *info)
         * dependencies on platform headers. It is necessary to enable
         * Exynos multi-platform support and will be removed together with
         * this whole driver as soon as Exynos gets migrated to use
-        * cpufreq-cpu0 driver.
+        * cpufreq-dt driver.
         */
        np = of_find_compatible_node(NULL, NULL, "samsung,exynos5250-clock");
        if (!np) {
index bf8902a0866dd4d767cdab4ba45d84ca397033fe..ec399ad2f059379891a4d384e5b24dc3b9c3ab59 100644 (file)
@@ -6,7 +6,7 @@
  * published by the Free Software Foundation.
  *
  * This driver provides the clk notifier callbacks that are used when
- * the cpufreq-cpu0 driver changes to frequency to alert the highbank
+ * the cpufreq-dt driver changes to frequency to alert the highbank
  * EnergyCore Management Engine (ECME) about the need to change
  * voltage. The ECME interfaces with the actual voltage regulators.
  */
@@ -60,7 +60,7 @@ static struct notifier_block hb_cpufreq_clk_nb = {
 
 static int hb_cpufreq_driver_init(void)
 {
-       struct platform_device_info devinfo = { .name = "cpufreq-cpu0", };
+       struct platform_device_info devinfo = { .name = "cpufreq-dt", };
        struct device *cpu_dev;
        struct clk *cpu_clk;
        struct device_node *np;
@@ -95,7 +95,7 @@ static int hb_cpufreq_driver_init(void)
                goto out_put_node;
        }
 
-       /* Instantiate cpufreq-cpu0 */
+       /* Instantiate cpufreq-dt */
        platform_device_register_full(&devinfo);
 
 out_put_node:
index 3f9791f07b8ea05f745a2bcbce6b738379443087..567caa6313fffa447f19992d7af5df940c4d0068 100644 (file)
@@ -597,7 +597,7 @@ static int s5pv210_cpufreq_probe(struct platform_device *pdev)
         * and dependencies on platform headers. It is necessary to enable
         * S5PV210 multi-platform support and will be removed together with
         * this whole driver as soon as S5PV210 gets migrated to use
-        * cpufreq-cpu0 driver.
+        * cpufreq-dt driver.
         */
        np = of_find_compatible_node(NULL, NULL, "samsung,s5pv210-clock");
        if (!np) {