Received: by 10.223.164.202 with SMTP id h10csp234043wrb; Mon, 13 Nov 2017 17:28:46 -0800 (PST) X-Google-Smtp-Source: AGs4zMbrTuCx+2j2eOe9wUa+kXSVinOnJYGSKEEnBjy0b8pwVzBqLTgNUYZzTLjatm7oPmLSsZmQ X-Received: by 10.98.186.11 with SMTP id k11mr11651035pff.141.1510622926710; Mon, 13 Nov 2017 17:28:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510622926; cv=none; d=google.com; s=arc-20160816; b=wXRdjklLu+tC8x9hKJgfTYjUU16pzzq1sQaTr+MWWlKeXR/uA7Py7vnNGQF2BcOxjW EHW8nlZxEGl/TC4OIdyvOsxzNfDHmy9LrWTLmlKhLnI5Uizv2nPw7wjhzNK/JZo3e/uv 3al1XMwp+nMJ+EDoeI5IyS/UdpY8ndqm1WAP9pkWzkW0P40paZKTHbcvJ/213+qWz11L ePwPeWTuNJAGgKvQsXQok7qmI7N+9TqdhRXgjOc2mc+w/Gxf2nihJ/OtUHZz1e/d+607 08Ek4A+RGTUAjkKHNI21j+FqESJ67QSHZWZjo6SiFPhLc9S5m/EVjcN4xL2ijwb4+tKy RiVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-signature :arc-authentication-results; bh=kSArB5RwVrVE0eWZKFqvfrGVxCjShAZRswKa/+N+q3Q=; b=fA+cKK3r4QhfcG8PVZynH3LGnbsmV7yR6MGSgGUI+zf4uaa0Ng9+JBiH/K8n5yrmGN kn4BtRE/GbJrD7XmPaQDCqjVvkZtewHslHdYT40HM89YJ/T5Do8wfbPQO2xyOXgilPX+ 2n5H3JX8tY+0gC/3MhxfpUlEsReUl0emMFCMIa+GbC03RhQVA5QUxwx03MKz+IfFj7S9 C311Q79ObRbA4vcz/WZ+4TP1A/1HeuSnYEGJuB9CTB2NwBZR0oTMHJ9fZ70oNFmfzzHW Qw+eZyDbvhyD7e+fc0Dr6+4fsO1rIZ9kR686qyjLvY5JeEFw4veRzFQuSfp2c4bsaISZ OCtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@flygoat.com header.s=mail header.b=E81DVs9y; dkim=pass header.i=@flygoat.com header.s=mail header.b=E81DVs9y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i13si14768862pgp.62.2017.11.13.17.28.34; Mon, 13 Nov 2017 17:28:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@flygoat.com header.s=mail header.b=E81DVs9y; dkim=pass header.i=@flygoat.com header.s=mail header.b=E81DVs9y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751642AbdKNB1y (ORCPT + 89 others); Mon, 13 Nov 2017 20:27:54 -0500 Received: from forward105p.mail.yandex.net ([77.88.28.108]:34084 "EHLO forward105p.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751292AbdKNB1w (ORCPT ); Mon, 13 Nov 2017 20:27:52 -0500 Received: from mxback10o.mail.yandex.net (mxback10o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::24]) by forward105p.mail.yandex.net (Yandex) with ESMTP id EF6FF4081E22; Tue, 14 Nov 2017 04:27:49 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback10o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id OzAI0f1goB-Rn2ikAdc; Tue, 14 Nov 2017 04:27:49 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; s=mail; t=1510622869; bh=kSArB5RwVrVE0eWZKFqvfrGVxCjShAZRswKa/+N+q3Q=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=E81DVs9ycsV9drnpxlZ359B9DYTn+E5RTV2f+rrKFK8nSEBIIgKG5Ot7SM7rOckAz hd947apzcex79e9NoMxlY2+Y0wAtTHnCQRXd1K42/UtwaQET0uATDIhSPQ87vIMtLY aVqZRRIf8/hKv2smJK958naK47EqOXVxesLQeJdo= Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 7l823DlZ0a-RjhqqLeI; Tue, 14 Nov 2017 04:27:48 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; s=mail; t=1510622869; bh=kSArB5RwVrVE0eWZKFqvfrGVxCjShAZRswKa/+N+q3Q=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=E81DVs9ycsV9drnpxlZ359B9DYTn+E5RTV2f+rrKFK8nSEBIIgKG5Ot7SM7rOckAz hd947apzcex79e9NoMxlY2+Y0wAtTHnCQRXd1K42/UtwaQET0uATDIhSPQ87vIMtLY aVqZRRIf8/hKv2smJK958naK47EqOXVxesLQeJdo= Authentication-Results: smtp4j.mail.yandex.net; dkim=pass header.i=@flygoat.com From: Jiaxun Yang To: Ralf Baechle Cc: linux-mips@linux-mips.org, linux-kernel@vger.kernel.org, Jiaxun Yang Subject: [PATCH v2 4/4] MIPS: Loongson64: Load platform device during boot Date: Tue, 14 Nov 2017 09:26:49 +0800 Message-Id: <20171114012649.29625-4-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171114012649.29625-1-jiaxun.yang@flygoat.com> References: <20171114012649.29625-1-jiaxun.yang@flygoat.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch just add pdev during boot to load the platform driver Signed-off-by: Jiaxun Yang --- arch/mips/loongson64/lemote-2f/Makefile | 2 +- arch/mips/loongson64/lemote-2f/platform.c | 45 +++++++++++++++++++++++++++++++ 2 files changed, 46 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..c36efcccb9a9 --- /dev/null +++ b/arch/mips/loongson64/lemote-2f/platform.c @@ -0,0 +1,45 @@ +/* + * 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 +#include + +#include + +static struct platform_device yeeloong_pdev = { + .name = "yeeloong_laptop", + .id = -1, +}; + + +static int __init lemote2f_platform_init(void) +{ + struct platform_device *pdev = NULL; + + switch (mips_machtype) { + case MACH_LEMOTE_YL2F89: + pdev = &yeeloong_pdev; + break; + + default: + break; + + } + + if (pdev != NULL) + return platform_device_register(pdev); + + return -ENODEV; +} + +arch_initcall(lemote2f_platform_init); -- 2.14.1 From 1583956814557054796@xxx Mon Nov 13 13:15:32 +0000 2017 X-GM-THRID: 1583956126666045134 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread