diff options
| author | Ulf Hansson <ulf.hansson@linaro.org> | 2012-12-10 10:25:40 -0500 |
|---|---|---|
| committer | Linus Walleij <linus.walleij@linaro.org> | 2013-01-07 10:03:20 -0500 |
| commit | 3e27996ca876a4cf38b4821140819e962104f82c (patch) | |
| tree | 948fa9bab2d0b1253df452ca28c3a9bbc8f91989 | |
| parent | 84c7c20f608f9d6d315b5b8c7935fa2a9a57fa51 (diff) | |
cpufreq: dbx500: Move clk_get to probe
The armss clock shall only be fetched at probe thus move this here.
Same thing goes for the printing of the available frequencies.
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Jonas Aaberg <jonas.aberg@stericsson.com>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
| -rw-r--r-- | drivers/cpufreq/dbx500-cpufreq.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/drivers/cpufreq/dbx500-cpufreq.c b/drivers/cpufreq/dbx500-cpufreq.c index 0a411b54972a..d974a8e32d85 100644 --- a/drivers/cpufreq/dbx500-cpufreq.c +++ b/drivers/cpufreq/dbx500-cpufreq.c | |||
| @@ -90,28 +90,14 @@ static unsigned int dbx500_cpufreq_getspeed(unsigned int cpu) | |||
| 90 | 90 | ||
| 91 | static int __cpuinit dbx500_cpufreq_init(struct cpufreq_policy *policy) | 91 | static int __cpuinit dbx500_cpufreq_init(struct cpufreq_policy *policy) |
| 92 | { | 92 | { |
| 93 | int i = 0; | ||
| 94 | int res; | 93 | int res; |
| 95 | 94 | ||
| 96 | armss_clk = clk_get(NULL, "armss"); | ||
| 97 | if (IS_ERR(armss_clk)) { | ||
| 98 | pr_err("dbx500-cpufreq : Failed to get armss clk\n"); | ||
| 99 | return PTR_ERR(armss_clk); | ||
| 100 | } | ||
| 101 | |||
| 102 | pr_info("dbx500-cpufreq : Available frequencies:\n"); | ||
| 103 | while (freq_table[i].frequency != CPUFREQ_TABLE_END) { | ||
| 104 | pr_info(" %d Mhz\n", freq_table[i].frequency/1000); | ||
| 105 | i++; | ||
| 106 | } | ||
| 107 | |||
| 108 | /* get policy fields based on the table */ | 95 | /* get policy fields based on the table */ |
| 109 | res = cpufreq_frequency_table_cpuinfo(policy, freq_table); | 96 | res = cpufreq_frequency_table_cpuinfo(policy, freq_table); |
| 110 | if (!res) | 97 | if (!res) |
| 111 | cpufreq_frequency_table_get_attr(freq_table, policy->cpu); | 98 | cpufreq_frequency_table_get_attr(freq_table, policy->cpu); |
| 112 | else { | 99 | else { |
| 113 | pr_err("dbx500-cpufreq : Failed to read policy table\n"); | 100 | pr_err("dbx500-cpufreq : Failed to read policy table\n"); |
| 114 | clk_put(armss_clk); | ||
| 115 | return res; | 101 | return res; |
| 116 | } | 102 | } |
| 117 | 103 | ||
| @@ -147,13 +133,26 @@ static struct cpufreq_driver dbx500_cpufreq_driver = { | |||
| 147 | 133 | ||
| 148 | static int dbx500_cpufreq_probe(struct platform_device *pdev) | 134 | static int dbx500_cpufreq_probe(struct platform_device *pdev) |
| 149 | { | 135 | { |
| 150 | freq_table = dev_get_platdata(&pdev->dev); | 136 | int i = 0; |
| 151 | 137 | ||
| 138 | freq_table = dev_get_platdata(&pdev->dev); | ||
| 152 | if (!freq_table) { | 139 | if (!freq_table) { |
| 153 | pr_err("dbx500-cpufreq: Failed to fetch cpufreq table\n"); | 140 | pr_err("dbx500-cpufreq: Failed to fetch cpufreq table\n"); |
| 154 | return -ENODEV; | 141 | return -ENODEV; |
| 155 | } | 142 | } |
| 156 | 143 | ||
| 144 | armss_clk = clk_get(&pdev->dev, "armss"); | ||
| 145 | if (IS_ERR(armss_clk)) { | ||
| 146 | pr_err("dbx500-cpufreq : Failed to get armss clk\n"); | ||
| 147 | return PTR_ERR(armss_clk); | ||
| 148 | } | ||
| 149 | |||
| 150 | pr_info("dbx500-cpufreq : Available frequencies:\n"); | ||
| 151 | while (freq_table[i].frequency != CPUFREQ_TABLE_END) { | ||
| 152 | pr_info(" %d Mhz\n", freq_table[i].frequency/1000); | ||
| 153 | i++; | ||
| 154 | } | ||
| 155 | |||
| 157 | return cpufreq_register_driver(&dbx500_cpufreq_driver); | 156 | return cpufreq_register_driver(&dbx500_cpufreq_driver); |
| 158 | } | 157 | } |
| 159 | 158 | ||
