diff options
Diffstat (limited to 'arch/mips/loongson/common/platform.c')
-rw-r--r-- | arch/mips/loongson/common/platform.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/mips/loongson/common/platform.c b/arch/mips/loongson/common/platform.c new file mode 100644 index 000000000000..be81777eb94d --- /dev/null +++ b/arch/mips/loongson/common/platform.c | |||
@@ -0,0 +1,30 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009 Lemote Inc. | ||
3 | * Author: Wu Zhangjin, wuzj@lemote.com | ||
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> | ||
12 | #include <linux/platform_device.h> | ||
13 | |||
14 | static struct platform_device loongson2_cpufreq_device = { | ||
15 | .name = "loongson2_cpufreq", | ||
16 | .id = -1, | ||
17 | }; | ||
18 | |||
19 | static int __init loongson2_cpufreq_init(void) | ||
20 | { | ||
21 | struct cpuinfo_mips *c = ¤t_cpu_data; | ||
22 | |||
23 | /* Only 2F revision and it's successors support CPUFreq */ | ||
24 | if ((c->processor_id & PRID_REV_MASK) >= PRID_REV_LOONGSON2F) | ||
25 | return platform_device_register(&loongson2_cpufreq_device); | ||
26 | |||
27 | return -ENODEV; | ||
28 | } | ||
29 | |||
30 | arch_initcall(loongson2_cpufreq_init); | ||