Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
torvalds
GitHub Repository: torvalds/linux
Path: blob/master/arch/mips/loongson2ef/common/platform.c
26481 views
1
// SPDX-License-Identifier: GPL-2.0-or-later
2
/*
3
* Copyright (C) 2009 Lemote Inc.
4
* Author: Wu Zhangjin, [email protected]
5
*/
6
7
#include <linux/err.h>
8
#include <linux/smp.h>
9
#include <linux/platform_device.h>
10
11
static struct platform_device loongson2_cpufreq_device = {
12
.name = "loongson2_cpufreq",
13
.id = -1,
14
};
15
16
static int __init loongson2_cpufreq_init(void)
17
{
18
struct cpuinfo_mips *c = &current_cpu_data;
19
20
/* Only 2F revision and its successors support CPUFreq */
21
if ((c->processor_id & PRID_REV_MASK) >= PRID_REV_LOONGSON2F)
22
return platform_device_register(&loongson2_cpufreq_device);
23
24
return -ENODEV;
25
}
26
27
arch_initcall(loongson2_cpufreq_init);
28
29