2 * Copyright (C) 2009 Lemote Inc.
3 * Author: Wu Zhangjin, wuzhangjin@gmail.com
4 * Xiang Yu, xiangy@lemote.com
5 * Chen Huacai, chenhc@lemote.com
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
13 #include <linux/err.h>
14 #include <linux/slab.h>
15 #include <linux/platform_device.h>
16 #include <asm/bootinfo.h>
17 #include <boot_param.h>
18 #include <loongson_hwmon.h>
19 #include <workarounds.h>
21 static int __init
loongson3_platform_init(void)
24 struct platform_device
*pdev
;
26 if (loongson_sysconf
.ecname
[0] != '\0')
27 platform_device_register_simple(loongson_sysconf
.ecname
, -1, NULL
, 0);
29 for (i
= 0; i
< loongson_sysconf
.nr_sensors
; i
++) {
30 if (loongson_sysconf
.sensors
[i
].type
> SENSOR_FAN
)
33 pdev
= kzalloc(sizeof(struct platform_device
), GFP_KERNEL
);
34 pdev
->name
= loongson_sysconf
.sensors
[i
].name
;
35 pdev
->id
= loongson_sysconf
.sensors
[i
].id
;
36 pdev
->dev
.platform_data
= &loongson_sysconf
.sensors
[i
];
37 platform_device_register(pdev
);
43 arch_initcall(loongson3_platform_init
);