diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2012-10-10 07:42:24 -0400 |
---|---|---|
committer | Mike Turquette <mturquette@ti.com> | 2012-11-09 19:47:00 -0500 |
commit | b46894447170963d7a29050b79fe532deab0966f (patch) | |
tree | c9c59fa747bf5c9ae5dd998a6b5023a1d94aa390 /drivers/cpufreq/db8500-cpufreq.c | |
parent | c280f45fb84bf49731c2b5122c997a9669e763ce (diff) |
cpufreq: db8500: Register as a platform driver
To fetch the mfd child device we register the cpufreq driver
as a platform driver.
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Jonas Aaberg <jonas.aberg@stericsson.com>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'drivers/cpufreq/db8500-cpufreq.c')
-rw-r--r-- | drivers/cpufreq/db8500-cpufreq.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/cpufreq/db8500-cpufreq.c b/drivers/cpufreq/db8500-cpufreq.c index 74b830b635a6..7d61a6c3e707 100644 --- a/drivers/cpufreq/db8500-cpufreq.c +++ b/drivers/cpufreq/db8500-cpufreq.c | |||
@@ -8,10 +8,12 @@ | |||
8 | * Author: Jonas Aaberg <jonas.aberg@stericsson.com> | 8 | * Author: Jonas Aaberg <jonas.aberg@stericsson.com> |
9 | * | 9 | * |
10 | */ | 10 | */ |
11 | #include <linux/module.h> | ||
11 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
12 | #include <linux/cpufreq.h> | 13 | #include <linux/cpufreq.h> |
13 | #include <linux/delay.h> | 14 | #include <linux/delay.h> |
14 | #include <linux/slab.h> | 15 | #include <linux/slab.h> |
16 | #include <linux/platform_device.h> | ||
15 | #include <linux/mfd/dbx500-prcmu.h> | 17 | #include <linux/mfd/dbx500-prcmu.h> |
16 | #include <mach/id.h> | 18 | #include <mach/id.h> |
17 | 19 | ||
@@ -159,12 +161,28 @@ static struct cpufreq_driver db8500_cpufreq_driver = { | |||
159 | .attr = db8500_cpufreq_attr, | 161 | .attr = db8500_cpufreq_attr, |
160 | }; | 162 | }; |
161 | 163 | ||
164 | static int db8500_cpufreq_probe(struct platform_device *pdev) | ||
165 | { | ||
166 | return cpufreq_register_driver(&db8500_cpufreq_driver); | ||
167 | } | ||
168 | |||
169 | static struct platform_driver db8500_cpufreq_plat_driver = { | ||
170 | .driver = { | ||
171 | .name = "cpufreq-u8500", | ||
172 | .owner = THIS_MODULE, | ||
173 | }, | ||
174 | .probe = db8500_cpufreq_probe, | ||
175 | }; | ||
176 | |||
162 | static int __init db8500_cpufreq_register(void) | 177 | static int __init db8500_cpufreq_register(void) |
163 | { | 178 | { |
164 | if (!cpu_is_u8500_family()) | 179 | if (!cpu_is_u8500_family()) |
165 | return -ENODEV; | 180 | return -ENODEV; |
166 | 181 | ||
167 | pr_info("cpufreq for DB8500 started\n"); | 182 | pr_info("cpufreq for DB8500 started\n"); |
168 | return cpufreq_register_driver(&db8500_cpufreq_driver); | 183 | return platform_driver_register(&db8500_cpufreq_plat_driver); |
169 | } | 184 | } |
170 | device_initcall(db8500_cpufreq_register); | 185 | device_initcall(db8500_cpufreq_register); |
186 | |||
187 | MODULE_LICENSE("GPL v2"); | ||
188 | MODULE_DESCRIPTION("cpufreq driver for DB8500"); | ||