blob: d2b5f062a07b31c4dbb4fec299fb310a675cc640 [file] [log] [blame]
Thomas Gleixnerd2912cb2019-06-04 10:11:33 +02001// SPDX-License-Identifier: GPL-2.0-only
Shawn Guo95ceafd2012-09-06 07:09:11 +00002/*
3 * Copyright (C) 2012 Freescale Semiconductor, Inc.
4 *
Viresh Kumar748c8762014-08-28 11:22:24 +05305 * Copyright (C) 2014 Linaro.
6 * Viresh Kumar <viresh.kumar@linaro.org>
Shawn Guo95ceafd2012-09-06 07:09:11 +00007 */
8
9#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
10
11#include <linux/clk.h>
Sudeep KarkadaNageshae1825b22013-09-10 18:59:46 +010012#include <linux/cpu.h>
Shawn Guo95ceafd2012-09-06 07:09:11 +000013#include <linux/cpufreq.h>
Eduardo Valentin77cff592013-07-15 09:09:14 -040014#include <linux/cpumask.h>
Shawn Guo95ceafd2012-09-06 07:09:11 +000015#include <linux/err.h>
16#include <linux/module.h>
17#include <linux/of.h>
Nishanth Menone4db1c72013-09-19 16:03:52 -050018#include <linux/pm_opp.h>
Shawn Guo5553f9e2013-01-30 14:27:49 +000019#include <linux/platform_device.h>
Shawn Guo95ceafd2012-09-06 07:09:11 +000020#include <linux/regulator/consumer.h>
21#include <linux/slab.h>
Eduardo Valentin77cff592013-07-15 09:09:14 -040022#include <linux/thermal.h>
Shawn Guo95ceafd2012-09-06 07:09:11 +000023
Viresh Kumar297a6622016-09-09 16:48:08 +053024#include "cpufreq-dt.h"
25
Viresh Kumard2f31f12014-08-28 11:22:28 +053026struct private_data {
Stephen Boyd91291d92016-11-30 16:21:25 +053027 struct opp_table *opp_table;
Viresh Kumard2f31f12014-08-28 11:22:28 +053028 struct device *cpu_dev;
Viresh Kumar050794a2016-02-09 10:30:43 +053029 const char *reg_name;
Viresh Kumar51c99dd2018-10-03 15:35:21 +053030 bool have_static_opps;
Viresh Kumard2f31f12014-08-28 11:22:28 +053031};
Shawn Guo95ceafd2012-09-06 07:09:11 +000032
Bartlomiej Zolnierkiewicz21c36d32015-08-07 13:59:16 +020033static struct freq_attr *cpufreq_dt_attr[] = {
34 &cpufreq_freq_attr_scaling_available_freqs,
35 NULL, /* Extra space for boost-attr if required */
36 NULL,
37};
38
Viresh Kumarbbcf0712014-09-09 19:58:03 +053039static int set_target(struct cpufreq_policy *policy, unsigned int index)
Shawn Guo95ceafd2012-09-06 07:09:11 +000040{
Viresh Kumard2f31f12014-08-28 11:22:28 +053041 struct private_data *priv = policy->driver_data;
Dietmar Eggemann400ec742017-09-26 17:41:09 +010042 unsigned long freq = policy->freq_table[index].frequency;
43 int ret;
Shawn Guo95ceafd2012-09-06 07:09:11 +000044
Dietmar Eggemann400ec742017-09-26 17:41:09 +010045 ret = dev_pm_opp_set_rate(priv->cpu_dev, freq * 1000);
46
47 if (!ret) {
48 arch_set_freq_scale(policy->related_cpus, freq,
49 policy->cpuinfo.max_freq);
50 }
51
52 return ret;
Shawn Guo95ceafd2012-09-06 07:09:11 +000053}
54
Viresh Kumar050794a2016-02-09 10:30:43 +053055/*
56 * An earlier version of opp-v1 bindings used to name the regulator
57 * "cpu0-supply", we still need to handle that for backwards compatibility.
58 */
Viresh Kumardf2c8ec2016-02-09 10:30:47 +053059static const char *find_supply_name(struct device *dev)
Viresh Kumar050794a2016-02-09 10:30:43 +053060{
Viresh Kumardf2c8ec2016-02-09 10:30:47 +053061 struct device_node *np;
Viresh Kumar050794a2016-02-09 10:30:43 +053062 struct property *pp;
63 int cpu = dev->id;
Viresh Kumardf2c8ec2016-02-09 10:30:47 +053064 const char *name = NULL;
65
66 np = of_node_get(dev->of_node);
67
68 /* This must be valid for sure */
69 if (WARN_ON(!np))
70 return NULL;
Viresh Kumar050794a2016-02-09 10:30:43 +053071
72 /* Try "cpu0" for older DTs */
73 if (!cpu) {
74 pp = of_find_property(np, "cpu0-supply", NULL);
Viresh Kumardf2c8ec2016-02-09 10:30:47 +053075 if (pp) {
76 name = "cpu0";
77 goto node_put;
78 }
Viresh Kumar050794a2016-02-09 10:30:43 +053079 }
80
81 pp = of_find_property(np, "cpu-supply", NULL);
Viresh Kumardf2c8ec2016-02-09 10:30:47 +053082 if (pp) {
83 name = "cpu";
84 goto node_put;
85 }
Viresh Kumar050794a2016-02-09 10:30:43 +053086
87 dev_dbg(dev, "no regulator for cpu%d\n", cpu);
Viresh Kumardf2c8ec2016-02-09 10:30:47 +053088node_put:
89 of_node_put(np);
90 return name;
Viresh Kumar050794a2016-02-09 10:30:43 +053091}
92
Viresh Kumardd02a3d2016-02-09 10:30:48 +053093static int resources_available(void)
Shawn Guo95ceafd2012-09-06 07:09:11 +000094{
Viresh Kumard2f31f12014-08-28 11:22:28 +053095 struct device *cpu_dev;
96 struct regulator *cpu_reg;
97 struct clk *cpu_clk;
98 int ret = 0;
Viresh Kumardd02a3d2016-02-09 10:30:48 +053099 const char *name;
Shawn Guo95ceafd2012-09-06 07:09:11 +0000100
Viresh Kumardd02a3d2016-02-09 10:30:48 +0530101 cpu_dev = get_cpu_device(0);
Sudeep KarkadaNageshae1825b22013-09-10 18:59:46 +0100102 if (!cpu_dev) {
Viresh Kumardd02a3d2016-02-09 10:30:48 +0530103 pr_err("failed to get cpu0 device\n");
Sudeep KarkadaNageshae1825b22013-09-10 18:59:46 +0100104 return -ENODEV;
105 }
Paolo Pisatif5c3ef22013-03-28 09:24:29 +0000106
Viresh Kumardd02a3d2016-02-09 10:30:48 +0530107 cpu_clk = clk_get(cpu_dev, NULL);
108 ret = PTR_ERR_OR_ZERO(cpu_clk);
109 if (ret) {
110 /*
111 * If cpu's clk node is present, but clock is not yet
112 * registered, we should try defering probe.
113 */
114 if (ret == -EPROBE_DEFER)
115 dev_dbg(cpu_dev, "clock not ready, retry\n");
116 else
117 dev_err(cpu_dev, "failed to get clock: %d\n", ret);
Viresh Kumar2d2c5e02014-08-28 11:22:29 +0530118
Viresh Kumardd02a3d2016-02-09 10:30:48 +0530119 return ret;
120 }
121
122 clk_put(cpu_clk);
123
124 name = find_supply_name(cpu_dev);
125 /* Platform doesn't require regulator */
126 if (!name)
127 return 0;
128
129 cpu_reg = regulator_get_optional(cpu_dev, name);
Arnd Bergmannb331bc22016-01-25 16:45:48 +0100130 ret = PTR_ERR_OR_ZERO(cpu_reg);
131 if (ret) {
Nishanth Menonfc31d6f2013-05-01 13:38:12 +0000132 /*
Viresh Kumar95b61052014-08-28 11:22:30 +0530133 * If cpu's regulator supply node is present, but regulator is
Nishanth Menonfc31d6f2013-05-01 13:38:12 +0000134 * not yet registered, we should try defering probe.
135 */
Viresh Kumar48a86242014-08-28 11:22:26 +0530136 if (ret == -EPROBE_DEFER)
Viresh Kumardd02a3d2016-02-09 10:30:48 +0530137 dev_dbg(cpu_dev, "cpu0 regulator not ready, retry\n");
Viresh Kumar48a86242014-08-28 11:22:26 +0530138 else
Viresh Kumardd02a3d2016-02-09 10:30:48 +0530139 dev_dbg(cpu_dev, "no regulator for cpu0: %d\n", ret);
140
141 return ret;
Viresh Kumard2f31f12014-08-28 11:22:28 +0530142 }
Viresh Kumar48a86242014-08-28 11:22:26 +0530143
Viresh Kumardd02a3d2016-02-09 10:30:48 +0530144 regulator_put(cpu_reg);
145 return 0;
Viresh Kumard2f31f12014-08-28 11:22:28 +0530146}
147
Viresh Kumarbbcf0712014-09-09 19:58:03 +0530148static int cpufreq_init(struct cpufreq_policy *policy)
Viresh Kumard2f31f12014-08-28 11:22:28 +0530149{
150 struct cpufreq_frequency_table *freq_table;
Stephen Boyd91291d92016-11-30 16:21:25 +0530151 struct opp_table *opp_table = NULL;
Viresh Kumard2f31f12014-08-28 11:22:28 +0530152 struct private_data *priv;
153 struct device *cpu_dev;
Viresh Kumard2f31f12014-08-28 11:22:28 +0530154 struct clk *cpu_clk;
155 unsigned int transition_latency;
Viresh Kumar1530b992016-04-27 08:52:24 +0530156 bool fallback = false;
Viresh Kumar050794a2016-02-09 10:30:43 +0530157 const char *name;
Viresh Kumard2f31f12014-08-28 11:22:28 +0530158 int ret;
159
Viresh Kumardd02a3d2016-02-09 10:30:48 +0530160 cpu_dev = get_cpu_device(policy->cpu);
161 if (!cpu_dev) {
162 pr_err("failed to get cpu%d device\n", policy->cpu);
163 return -ENODEV;
164 }
165
166 cpu_clk = clk_get(cpu_dev, NULL);
167 if (IS_ERR(cpu_clk)) {
168 ret = PTR_ERR(cpu_clk);
169 dev_err(cpu_dev, "%s: failed to get clk: %d\n", __func__, ret);
Viresh Kumard2f31f12014-08-28 11:22:28 +0530170 return ret;
171 }
172
Viresh Kumar2e02d872015-07-29 16:23:10 +0530173 /* Get OPP-sharing information from "operating-points-v2" bindings */
Viresh Kumar8f8d37b2015-09-04 13:47:24 +0530174 ret = dev_pm_opp_of_get_sharing_cpus(cpu_dev, policy->cpus);
Viresh Kumar2e02d872015-07-29 16:23:10 +0530175 if (ret) {
Viresh Kumar1530b992016-04-27 08:52:24 +0530176 if (ret != -ENOENT)
177 goto out_put_clk;
178
Viresh Kumar2e02d872015-07-29 16:23:10 +0530179 /*
180 * operating-points-v2 not supported, fallback to old method of
Viresh Kumar1530b992016-04-27 08:52:24 +0530181 * finding shared-OPPs for backward compatibility if the
182 * platform hasn't set sharing CPUs.
Viresh Kumar2e02d872015-07-29 16:23:10 +0530183 */
Viresh Kumar1530b992016-04-27 08:52:24 +0530184 if (dev_pm_opp_get_sharing_cpus(cpu_dev, policy->cpus))
185 fallback = true;
Viresh Kumar2e02d872015-07-29 16:23:10 +0530186 }
187
188 /*
Viresh Kumar050794a2016-02-09 10:30:43 +0530189 * OPP layer will be taking care of regulators now, but it needs to know
190 * the name of the regulator first.
191 */
Viresh Kumardf2c8ec2016-02-09 10:30:47 +0530192 name = find_supply_name(cpu_dev);
Viresh Kumar050794a2016-02-09 10:30:43 +0530193 if (name) {
Viresh Kumardfbe4672016-12-01 16:28:19 +0530194 opp_table = dev_pm_opp_set_regulators(cpu_dev, &name, 1);
Stephen Boyd91291d92016-11-30 16:21:25 +0530195 if (IS_ERR(opp_table)) {
196 ret = PTR_ERR(opp_table);
Viresh Kumar050794a2016-02-09 10:30:43 +0530197 dev_err(cpu_dev, "Failed to set regulator for cpu%d: %d\n",
198 policy->cpu, ret);
Viresh Kumardd02a3d2016-02-09 10:30:48 +0530199 goto out_put_clk;
Viresh Kumar050794a2016-02-09 10:30:43 +0530200 }
201 }
202
Viresh Kumar51c99dd2018-10-03 15:35:21 +0530203 priv = kzalloc(sizeof(*priv), GFP_KERNEL);
204 if (!priv) {
205 ret = -ENOMEM;
206 goto out_put_regulator;
207 }
208
209 priv->reg_name = name;
210 priv->opp_table = opp_table;
211
Viresh Kumar050794a2016-02-09 10:30:43 +0530212 /*
Viresh Kumar2e02d872015-07-29 16:23:10 +0530213 * Initialize OPP tables for all policy->cpus. They will be shared by
214 * all CPUs which have marked their CPUs shared with OPP bindings.
215 *
216 * For platforms not using operating-points-v2 bindings, we do this
217 * before updating policy->cpus. Otherwise, we will end up creating
218 * duplicate OPPs for policy->cpus.
219 *
220 * OPPs might be populated at runtime, don't check for error here
221 */
Viresh Kumar51c99dd2018-10-03 15:35:21 +0530222 if (!dev_pm_opp_of_cpumask_add_table(policy->cpus))
223 priv->have_static_opps = true;
Viresh Kumar2e02d872015-07-29 16:23:10 +0530224
Viresh Kumar7d5d0c82015-09-02 14:36:48 +0530225 /*
226 * But we need OPP table to function so if it is not there let's
227 * give platform code chance to provide it for us.
228 */
229 ret = dev_pm_opp_get_opp_count(cpu_dev);
230 if (ret <= 0) {
Viresh Kumar896d6a42016-02-09 10:30:40 +0530231 dev_dbg(cpu_dev, "OPP table is not ready, deferring probe\n");
Viresh Kumar7d5d0c82015-09-02 14:36:48 +0530232 ret = -EPROBE_DEFER;
233 goto out_free_opp;
234 }
235
Viresh Kumar1530b992016-04-27 08:52:24 +0530236 if (fallback) {
Viresh Kumareb969242016-04-27 08:52:26 +0530237 cpumask_setall(policy->cpus);
Viresh Kumar2e02d872015-07-29 16:23:10 +0530238
239 /*
240 * OPP tables are initialized only for policy->cpu, do it for
241 * others as well.
242 */
Viresh Kumar8f8d37b2015-09-04 13:47:24 +0530243 ret = dev_pm_opp_set_sharing_cpus(cpu_dev, policy->cpus);
Viresh Kumar8bc86282015-09-02 14:36:49 +0530244 if (ret)
245 dev_err(cpu_dev, "%s: failed to mark OPPs as shared: %d\n",
246 __func__, ret);
Viresh Kumar2e02d872015-07-29 16:23:10 +0530247 }
Shawn Guo95ceafd2012-09-06 07:09:11 +0000248
Lucas Stach045ee452014-10-24 15:05:55 +0200249 ret = dev_pm_opp_init_cpufreq_table(cpu_dev, &freq_table);
250 if (ret) {
Viresh Kumar896d6a42016-02-09 10:30:40 +0530251 dev_err(cpu_dev, "failed to init cpufreq table: %d\n", ret);
Viresh Kumar51c99dd2018-10-03 15:35:21 +0530252 goto out_free_opp;
Lucas Stach045ee452014-10-24 15:05:55 +0200253 }
254
Viresh Kumard2f31f12014-08-28 11:22:28 +0530255 priv->cpu_dev = cpu_dev;
Viresh Kumard2f31f12014-08-28 11:22:28 +0530256 policy->driver_data = priv;
Viresh Kumard2f31f12014-08-28 11:22:28 +0530257 policy->clk = cpu_clk;
Viresh Kumar29aa18a2018-02-26 10:38:50 +0530258 policy->freq_table = freq_table;
Bartlomiej Zolnierkiewicz953ba9f2015-09-08 18:41:03 +0200259
Viresh Kumar3aa26a32017-01-02 14:41:02 +0530260 policy->suspend_freq = dev_pm_opp_get_suspend_opp_freq(cpu_dev) / 1000;
Bartlomiej Zolnierkiewicz953ba9f2015-09-08 18:41:03 +0200261
Viresh Kumard15fa862015-07-29 16:23:11 +0530262 /* Support turbo/boost mode */
263 if (policy_has_boost_freq(policy)) {
264 /* This gets disabled by core on driver unregister */
265 ret = cpufreq_enable_boost_support();
266 if (ret)
267 goto out_free_cpufreq_table;
Bartlomiej Zolnierkiewicz21c36d32015-08-07 13:59:16 +0200268 cpufreq_dt_attr[1] = &cpufreq_freq_attr_scaling_boost_freqs;
Viresh Kumard15fa862015-07-29 16:23:11 +0530269 }
270
Viresh Kumar755b8882016-02-09 10:30:45 +0530271 transition_latency = dev_pm_opp_get_max_transition_latency(cpu_dev);
272 if (!transition_latency)
273 transition_latency = CPUFREQ_ETERNAL;
274
Thomas Petazzoni34e5a522014-10-19 11:30:28 +0200275 policy->cpuinfo.transition_latency = transition_latency;
Viresh Kumar99d14d02017-07-28 12:16:39 +0530276 policy->dvfs_possible_from_any_cpu = true;
Thomas Petazzoni34e5a522014-10-19 11:30:28 +0200277
Quentin Perret76d004b2019-02-04 11:09:49 +0000278 dev_pm_opp_of_register_em(policy->cpus);
279
Shawn Guo95ceafd2012-09-06 07:09:11 +0000280 return 0;
281
Viresh Kumar9a004422014-11-27 06:07:52 +0530282out_free_cpufreq_table:
Nishanth Menon5d4879c2013-09-19 16:03:50 -0500283 dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table);
Viresh Kumar2f0f6092014-11-25 16:04:21 +0530284out_free_opp:
Viresh Kumar51c99dd2018-10-03 15:35:21 +0530285 if (priv->have_static_opps)
286 dev_pm_opp_of_cpumask_remove_table(policy->cpus);
287 kfree(priv);
288out_put_regulator:
Viresh Kumar050794a2016-02-09 10:30:43 +0530289 if (name)
Viresh Kumardfbe4672016-12-01 16:28:19 +0530290 dev_pm_opp_put_regulators(opp_table);
Viresh Kumardd02a3d2016-02-09 10:30:48 +0530291out_put_clk:
Viresh Kumard2f31f12014-08-28 11:22:28 +0530292 clk_put(cpu_clk);
Viresh Kumard2f31f12014-08-28 11:22:28 +0530293
294 return ret;
295}
296
Viresh Kumar263abfe2019-02-12 12:36:47 +0530297static int cpufreq_online(struct cpufreq_policy *policy)
298{
299 /* We did light-weight tear down earlier, nothing to do here */
300 return 0;
301}
302
303static int cpufreq_offline(struct cpufreq_policy *policy)
304{
305 /*
306 * Preserve policy->driver_data and don't free resources on light-weight
307 * tear down.
308 */
309 return 0;
310}
311
Viresh Kumarbbcf0712014-09-09 19:58:03 +0530312static int cpufreq_exit(struct cpufreq_policy *policy)
Viresh Kumard2f31f12014-08-28 11:22:28 +0530313{
314 struct private_data *priv = policy->driver_data;
315
Viresh Kumard2f31f12014-08-28 11:22:28 +0530316 dev_pm_opp_free_cpufreq_table(priv->cpu_dev, &policy->freq_table);
Viresh Kumar51c99dd2018-10-03 15:35:21 +0530317 if (priv->have_static_opps)
318 dev_pm_opp_of_cpumask_remove_table(policy->related_cpus);
Viresh Kumar050794a2016-02-09 10:30:43 +0530319 if (priv->reg_name)
Viresh Kumardfbe4672016-12-01 16:28:19 +0530320 dev_pm_opp_put_regulators(priv->opp_table);
Viresh Kumar050794a2016-02-09 10:30:43 +0530321
Viresh Kumard2f31f12014-08-28 11:22:28 +0530322 clk_put(policy->clk);
Viresh Kumard2f31f12014-08-28 11:22:28 +0530323 kfree(priv);
324
325 return 0;
326}
327
Viresh Kumarbbcf0712014-09-09 19:58:03 +0530328static struct cpufreq_driver dt_cpufreq_driver = {
Amit Kucheriae248d8d2019-01-29 10:25:11 +0530329 .flags = CPUFREQ_STICKY | CPUFREQ_NEED_INITIAL_FREQ_CHECK |
330 CPUFREQ_IS_COOLING_DEV,
Viresh Kumard2f31f12014-08-28 11:22:28 +0530331 .verify = cpufreq_generic_frequency_table_verify,
Viresh Kumarbbcf0712014-09-09 19:58:03 +0530332 .target_index = set_target,
Viresh Kumard2f31f12014-08-28 11:22:28 +0530333 .get = cpufreq_generic_get,
Viresh Kumarbbcf0712014-09-09 19:58:03 +0530334 .init = cpufreq_init,
335 .exit = cpufreq_exit,
Viresh Kumar263abfe2019-02-12 12:36:47 +0530336 .online = cpufreq_online,
337 .offline = cpufreq_offline,
Viresh Kumarbbcf0712014-09-09 19:58:03 +0530338 .name = "cpufreq-dt",
Bartlomiej Zolnierkiewicz21c36d32015-08-07 13:59:16 +0200339 .attr = cpufreq_dt_attr,
Bartlomiej Zolnierkiewicz953ba9f2015-09-08 18:41:03 +0200340 .suspend = cpufreq_generic_suspend,
Viresh Kumard2f31f12014-08-28 11:22:28 +0530341};
342
Viresh Kumarbbcf0712014-09-09 19:58:03 +0530343static int dt_cpufreq_probe(struct platform_device *pdev)
Viresh Kumard2f31f12014-08-28 11:22:28 +0530344{
Viresh Kumar297a6622016-09-09 16:48:08 +0530345 struct cpufreq_dt_platform_data *data = dev_get_platdata(&pdev->dev);
Viresh Kumard2f31f12014-08-28 11:22:28 +0530346 int ret;
347
348 /*
349 * All per-cluster (CPUs sharing clock/voltages) initialization is done
350 * from ->init(). In probe(), we just need to make sure that clk and
351 * regulators are available. Else defer probe and retry.
352 *
353 * FIXME: Is checking this only for CPU0 sufficient ?
354 */
Viresh Kumardd02a3d2016-02-09 10:30:48 +0530355 ret = resources_available();
Viresh Kumard2f31f12014-08-28 11:22:28 +0530356 if (ret)
357 return ret;
358
Viresh Kumar67782702018-04-24 15:09:45 +0530359 if (data) {
360 if (data->have_governor_per_policy)
361 dt_cpufreq_driver.flags |= CPUFREQ_HAVE_GOVERNOR_PER_POLICY;
362
363 dt_cpufreq_driver.resume = data->resume;
364 if (data->suspend)
365 dt_cpufreq_driver.suspend = data->suspend;
366 }
Viresh Kumar297a6622016-09-09 16:48:08 +0530367
Viresh Kumarbbcf0712014-09-09 19:58:03 +0530368 ret = cpufreq_register_driver(&dt_cpufreq_driver);
Viresh Kumard2f31f12014-08-28 11:22:28 +0530369 if (ret)
Viresh Kumardd02a3d2016-02-09 10:30:48 +0530370 dev_err(&pdev->dev, "failed register driver: %d\n", ret);
Viresh Kumard2f31f12014-08-28 11:22:28 +0530371
Shawn Guo95ceafd2012-09-06 07:09:11 +0000372 return ret;
373}
Shawn Guo5553f9e2013-01-30 14:27:49 +0000374
Viresh Kumarbbcf0712014-09-09 19:58:03 +0530375static int dt_cpufreq_remove(struct platform_device *pdev)
Shawn Guo5553f9e2013-01-30 14:27:49 +0000376{
Viresh Kumarbbcf0712014-09-09 19:58:03 +0530377 cpufreq_unregister_driver(&dt_cpufreq_driver);
Shawn Guo5553f9e2013-01-30 14:27:49 +0000378 return 0;
379}
380
Viresh Kumarbbcf0712014-09-09 19:58:03 +0530381static struct platform_driver dt_cpufreq_platdrv = {
Shawn Guo5553f9e2013-01-30 14:27:49 +0000382 .driver = {
Viresh Kumarbbcf0712014-09-09 19:58:03 +0530383 .name = "cpufreq-dt",
Shawn Guo5553f9e2013-01-30 14:27:49 +0000384 },
Viresh Kumarbbcf0712014-09-09 19:58:03 +0530385 .probe = dt_cpufreq_probe,
386 .remove = dt_cpufreq_remove,
Shawn Guo5553f9e2013-01-30 14:27:49 +0000387};
Viresh Kumarbbcf0712014-09-09 19:58:03 +0530388module_platform_driver(dt_cpufreq_platdrv);
Shawn Guo95ceafd2012-09-06 07:09:11 +0000389
Felipe Balbi07949bf2015-05-08 14:57:30 -0500390MODULE_ALIAS("platform:cpufreq-dt");
Viresh Kumar748c8762014-08-28 11:22:24 +0530391MODULE_AUTHOR("Viresh Kumar <viresh.kumar@linaro.org>");
Shawn Guo95ceafd2012-09-06 07:09:11 +0000392MODULE_AUTHOR("Shawn Guo <shawn.guo@linaro.org>");
Viresh Kumarbbcf0712014-09-09 19:58:03 +0530393MODULE_DESCRIPTION("Generic cpufreq driver");
Shawn Guo95ceafd2012-09-06 07:09:11 +0000394MODULE_LICENSE("GPL");