Wu Zhangjin | f8ede0f | 2009-11-17 01:32:59 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2009 Lemote Inc. |
Wu Zhangjin | f7a904d | 2010-01-04 17:16:51 +0800 | [diff] [blame] | 3 | * Author: Wu Zhangjin, wuzhangjin@gmail.com |
Wu Zhangjin | f8ede0f | 2009-11-17 01:32:59 +0800 | [diff] [blame] | 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify it |
| 6 | * under the terms of the GNU General Public License as published by the |
| 7 | * Free Software Foundation; either version 2 of the License, or (at your |
| 8 | * option) any later version. |
| 9 | */ |
| 10 | |
| 11 | #include <linux/err.h> |
Paul Gortmaker | c72f4d6 | 2011-07-28 19:39:02 -0400 | [diff] [blame] | 12 | #include <linux/smp.h> |
Wu Zhangjin | f8ede0f | 2009-11-17 01:32:59 +0800 | [diff] [blame] | 13 | #include <linux/platform_device.h> |
| 14 | |
| 15 | static struct platform_device loongson2_cpufreq_device = { |
| 16 | .name = "loongson2_cpufreq", |
| 17 | .id = -1, |
| 18 | }; |
| 19 | |
| 20 | static int __init loongson2_cpufreq_init(void) |
| 21 | { |
| 22 | struct cpuinfo_mips *c = ¤t_cpu_data; |
| 23 | |
| 24 | /* Only 2F revision and it's successors support CPUFreq */ |
| 25 | if ((c->processor_id & PRID_REV_MASK) >= PRID_REV_LOONGSON2F) |
| 26 | return platform_device_register(&loongson2_cpufreq_device); |
| 27 | |
| 28 | return -ENODEV; |
| 29 | } |
| 30 | |
| 31 | arch_initcall(loongson2_cpufreq_init); |