diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2012-10-10 11:42:24 (GMT) |
---|---|---|
committer | Mike Turquette <mturquette@ti.com> | 2012-11-10 00:47:00 (GMT) |
commit | b46894447170963d7a29050b79fe532deab0966f (patch) | |
tree | c9c59fa747bf5c9ae5dd998a6b5023a1d94aa390 /drivers/cpufreq | |
parent | c280f45fb84bf49731c2b5122c997a9669e763ce (diff) | |
download | linux-b46894447170963d7a29050b79fe532deab0966f.tar.xz |
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')
-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 74b830b..7d61a6c 100644 --- a/drivers/cpufreq/db8500-cpufreq.c +++ b/drivers/cpufreq/db8500-cpufreq.c @@ -8,10 +8,12 @@ * Author: Jonas Aaberg <jonas.aberg@stericsson.com> * */ +#include <linux/module.h> #include <linux/kernel.h> #include <linux/cpufreq.h> #include <linux/delay.h> #include <linux/slab.h> +#include <linux/platform_device.h> #include <linux/mfd/dbx500-prcmu.h> #include <mach/id.h> @@ -159,12 +161,28 @@ static struct cpufreq_driver db8500_cpufreq_driver = { .attr = db8500_cpufreq_attr, }; +static int db8500_cpufreq_probe(struct platform_device *pdev) +{ + return cpufreq_register_driver(&db8500_cpufreq_driver); +} + +static struct platform_driver db8500_cpufreq_plat_driver = { + .driver = { + .name = "cpufreq-u8500", + .owner = THIS_MODULE, + }, + .probe = db8500_cpufreq_probe, +}; + static int __init db8500_cpufreq_register(void) { if (!cpu_is_u8500_family()) return -ENODEV; pr_info("cpufreq for DB8500 started\n"); - return cpufreq_register_driver(&db8500_cpufreq_driver); + return platform_driver_register(&db8500_cpufreq_plat_driver); } device_initcall(db8500_cpufreq_register); + +MODULE_LICENSE("GPL v2"); +MODULE_DESCRIPTION("cpufreq driver for DB8500"); |