Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-or-later
0002 /*
0003  * Copyright (C) 2009 Lemote Inc.
0004  * Author: Wu Zhangjin, wuzhangjin@gmail.com
0005  */
0006 
0007 #include <linux/err.h>
0008 #include <linux/smp.h>
0009 #include <linux/platform_device.h>
0010 
0011 static struct platform_device loongson2_cpufreq_device = {
0012     .name = "loongson2_cpufreq",
0013     .id = -1,
0014 };
0015 
0016 static int __init loongson2_cpufreq_init(void)
0017 {
0018     struct cpuinfo_mips *c = &current_cpu_data;
0019 
0020     /* Only 2F revision and it's successors support CPUFreq */
0021     if ((c->processor_id & PRID_REV_MASK) >= PRID_REV_LOONGSON2F)
0022         return platform_device_register(&loongson2_cpufreq_device);
0023 
0024     return -ENODEV;
0025 }
0026 
0027 arch_initcall(loongson2_cpufreq_init);