Squashed backup commit (no shallow-clone history issues) of xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2 branch, upstream commit 9eece662e) plus all fixes applied to get everpal_defconfig building clean against a modern (GCC 15.2.0) toolchain -- see the previous commit message on the lineage-23.2 branch (also in this repo history is not available here since this is a squashed snapshot; full incremental history lives in the local DL380 checkout and the upstream GitHub remote). Upstream: https://github.com/xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2)
47 lines
1.2 KiB
C
47 lines
1.2 KiB
C
/*
|
|
* Copyright (C) 2009 Lemote Inc.
|
|
* Author: Wu Zhangjin, wuzhangjin@gmail.com
|
|
* Xiang Yu, xiangy@lemote.com
|
|
* Chen Huacai, chenhc@lemote.com
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
* under the terms of the GNU General Public License as published by the
|
|
* Free Software Foundation; either version 2 of the License, or (at your
|
|
* option) any later version.
|
|
*/
|
|
|
|
#include <linux/err.h>
|
|
#include <linux/slab.h>
|
|
#include <linux/platform_device.h>
|
|
#include <asm/bootinfo.h>
|
|
#include <boot_param.h>
|
|
#include <loongson_hwmon.h>
|
|
#include <workarounds.h>
|
|
|
|
static int __init loongson3_platform_init(void)
|
|
{
|
|
int i;
|
|
struct platform_device *pdev;
|
|
|
|
if (loongson_sysconf.ecname[0] != '\0')
|
|
platform_device_register_simple(loongson_sysconf.ecname, -1, NULL, 0);
|
|
|
|
for (i = 0; i < loongson_sysconf.nr_sensors; i++) {
|
|
if (loongson_sysconf.sensors[i].type > SENSOR_FAN)
|
|
continue;
|
|
|
|
pdev = kzalloc(sizeof(struct platform_device), GFP_KERNEL);
|
|
if (!pdev)
|
|
return -ENOMEM;
|
|
|
|
pdev->name = loongson_sysconf.sensors[i].name;
|
|
pdev->id = loongson_sysconf.sensors[i].id;
|
|
pdev->dev.platform_data = &loongson_sysconf.sensors[i];
|
|
platform_device_register(pdev);
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
arch_initcall(loongson3_platform_init);
|