To: | James Hogan <james.hogan@mips.com> |
---|---|
Subject: | [PATCH RESEND v3 4/4] MIPS: Loongson64: Load platform device during boot |
From: | Jiaxun Yang <jiaxun.yang@flygoat.com> |
Date: | Mon, 4 Dec 2017 17:23:12 +0800 |
Authentication-results: | smtp3p.mail.yandex.net; dkim=pass header.i=@flygoat.com |
Cc: | Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org, linux-kernel@vger.kernel.org, Jiaxun Yang <jiaxun.yang@flygoat.com> |
Dkim-signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; s=mail; t=1512379427; bh=JffbL3OKsZ5EgD+y4JOXLvIEr8/hCd/M1itAcWjj/vg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=kW+As9oxENULhn6SBLcwXmu4usYsNTlU5wAP6bi1awW51EnITm8LmggllTwoq3rjT JjLfPJcyupCN5iVhbxWL3woWVDhd93bde1s1r4n0wqo5xO5CHp0fCyxyBWjJ/Kbc5a D2vFe9wwt3EB21PcF8xG6LAeFb95JC2Bl2et+hSg= |
Dkim-signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; s=mail; t=1512379426; bh=JffbL3OKsZ5EgD+y4JOXLvIEr8/hCd/M1itAcWjj/vg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=lF0CT0n1QaBPiKvl8Saag6I7yhpTrWhdXGiGB/yMswkLEsFgtbIKvJ6JwqwIHaIkk bx2jHYprfVRlvuYU2ZXuDfOA1n/PrdEDxITEq907FspyIMQXq/9Z2rvt7vKFtBoN6H M38zjjGDW7wPj8Kll2npDOh1kxiFlxT7De04G0V4= |
In-reply-to: | <20171204092312.11256-1-jiaxun.yang@flygoat.com> |
List-archive: | <http://www.linux-mips.org/archives/linux-mips/> |
List-help: | <mailto:ecartis@linux-mips.org?Subject=help> |
List-id: | linux-mips <linux-mips.eddie.linux-mips.org> |
List-owner: | <mailto:ralf@linux-mips.org> |
List-post: | <mailto:linux-mips@linux-mips.org> |
List-software: | Ecartis version 1.0.0 |
List-subscribe: | <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips> |
List-unsubscribe: | <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips> |
Original-recipient: | rfc822;linux-mips@linux-mips.org |
References: | <20171204092312.11256-1-jiaxun.yang@flygoat.com> |
Sender: | linux-mips-bounce@linux-mips.org |
This patch just add pdev during boot to load the platform driver Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> --- arch/mips/loongson64/lemote-2f/Makefile | 2 +- arch/mips/loongson64/lemote-2f/platform.c | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 arch/mips/loongson64/lemote-2f/platform.c diff --git a/arch/mips/loongson64/lemote-2f/Makefile b/arch/mips/loongson64/lemote-2f/Makefile index 08b8abcbfef5..31c90737b98c 100644 --- a/arch/mips/loongson64/lemote-2f/Makefile +++ b/arch/mips/loongson64/lemote-2f/Makefile @@ -2,7 +2,7 @@ # Makefile for lemote loongson2f family machines # -obj-y += clock.o machtype.o irq.o reset.o ec_kb3310b.o +obj-y += clock.o machtype.o irq.o reset.o ec_kb3310b.o platform.o # # Suspend Support diff --git a/arch/mips/loongson64/lemote-2f/platform.c b/arch/mips/loongson64/lemote-2f/platform.c new file mode 100644 index 000000000000..46922f730a64 --- /dev/null +++ b/arch/mips/loongson64/lemote-2f/platform.c @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2017 Jiaxun Yang. + * Author: Jiaxun Yang, jiaxun.yang@flygoat.com + + * Copyright (C) 2009 Lemote Inc. + * Author: Wu Zhangjin, wuzhangjin@gmail.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/platform_device.h> + +#include <asm/bootinfo.h> + +static int __init lemote2f_platform_init(void) +{ + if (mips_machtype != MACH_LEMOTE_YL2F89) + return -ENODEV; + + return platform_device_register_simple("yeeloong_laptop", -1, NULL, 0); +} + +arch_initcall(lemote2f_platform_init); \ No newline at end of file -- 2.15.0 |
<Prev in Thread] | Current Thread | [Next in Thread> |
---|---|---|
|
Previous by Date: | [PATCH RESEND v3 3/4] MIPS: Loongson64: Yeeloong add platform driver, Jiaxun Yang |
---|---|
Next by Date: | [PATCH v3 00/16] Move vcpu_load and vcpu_put calls to arch code, Christoffer Dall |
Previous by Thread: | [PATCH RESEND v3 3/4] MIPS: Loongson64: Yeeloong add platform driver, Jiaxun Yang |
Next by Thread: | Re: [PATCH RESEND v3 4/4] MIPS: Loongson64: Load platform device during boot, kbuild test robot |
Indexes: | [Date] [Thread] [Top] [All Lists] |