Received: by 10.223.164.202 with SMTP id h10csp2011213wrb; Sat, 11 Nov 2017 22:46:44 -0800 (PST) X-Google-Smtp-Source: AGs4zMZnvJDEvqYYzsOHjwpJo38I2p7ZVBsI67c6ofV1k8gPi+lSIb06ak2J2zpoTZYE+eNDs9SI X-Received: by 10.84.138.131 with SMTP id 3mr5345880plp.238.1510469204346; Sat, 11 Nov 2017 22:46:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510469204; cv=none; d=google.com; s=arc-20160816; b=BXg51stn0x5c2A/xSw5XlVob4SFHzj86UWU7Eo0r/9A7bctkSmkAFvvWZ1QZu0aX9+ NwIPYXuOm70jgI3bcM7xxfN/bZIawPfSr/pDOBsTJXaS6rvUbNlpJomeCCBMVGnOVUDp tBSi1twxYP5qFRzNNpvA9TLRQS1d3aitvLmt9Z2wJs+ozD+5KczUzRDtrN6gO5N624jZ gVeKUr5APpu2HupsfRYtRKaIQudqhg5+W32bk3QN1/BqMh0eCkRwfJq8bI70ByvmVU2c k/7vjr8H6uf+V5Q1DyFT5A4RILhEHo1wlKMe966jkfjrmTC8iih4Unf7iQXtf/gMGdfB AWkQ== 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=uGonCiff3obAsU//+GriYfJlaKB//dL+X8iBlx5SFwA=; b=v6QxY9aji0X4ax0BESIc1waKH9v35R4qnM0cG8tx09c7PvFdTgR8PNXV6vFjVT/eEx aHvpTCz4d+2W80lhghhQp0ryN3P2pMGnINzmRpkNnJR6is/cGRaAXs4GBTbdpooovgdo wOFMXWQ6Bz6PZaII0z9qqxZRQSbhK+lbUc6YBMxSwGDbSClrrW92H3pK5JBo+T++/63A bbbhmG8vPcuq+/2fJKzOWUHT5EtdRyqDL1gbbAOoH1BOUqaD+6RvA1wo1iF3RWINDmqE 7fNHMH9RRTyRtyH+BNLeoIfy8nWudxB0QezViyDVdy7V8EbKvXkqTXOf0tsqi0klu4kH CYIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@flygoat.com header.s=mail header.b=PbxJ+M6e; dkim=pass header.i=@flygoat.com header.s=mail header.b=PbxJ+M6e; 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 t19si11636758plo.269.2017.11.11.22.46.32; Sat, 11 Nov 2017 22:46:44 -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=PbxJ+M6e; dkim=pass header.i=@flygoat.com header.s=mail header.b=PbxJ+M6e; 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 S1753065AbdKLGpW (ORCPT + 87 others); Sun, 12 Nov 2017 01:45:22 -0500 Received: from forward101j.mail.yandex.net ([5.45.198.241]:55431 "EHLO forward101j.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750862AbdKLGpU (ORCPT ); Sun, 12 Nov 2017 01:45:20 -0500 Received: from mxback10g.mail.yandex.net (mxback10g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:171]) by forward101j.mail.yandex.net (Yandex) with ESMTP id B111B12436ED; Sun, 12 Nov 2017 09:37:04 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback10g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id UzWTLKuelQ-b4xOWSdu; Sun, 12 Nov 2017 09:37:04 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; s=mail; t=1510468624; bh=uGonCiff3obAsU//+GriYfJlaKB//dL+X8iBlx5SFwA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=PbxJ+M6eXNoxq3rkfYy83s0Vy+7t2Hm4LhHDIkEV9rt3SVirHN3NW6O8+dS6Qggzl cn+UVH8ki3gN4pCIQniyIy6bPUA8Yzn3ryjuEHq2Pty7PxYtOcYb3OzzPxqcbAYZkD PVKZchhqqk+6d9CqUrbm16eN7P16jiBqv6xuwrYk= Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 0pMwdlaAMA-b1ZuO4gG; Sun, 12 Nov 2017 09:37:03 +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=1510468624; bh=uGonCiff3obAsU//+GriYfJlaKB//dL+X8iBlx5SFwA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=PbxJ+M6eXNoxq3rkfYy83s0Vy+7t2Hm4LhHDIkEV9rt3SVirHN3NW6O8+dS6Qggzl cn+UVH8ki3gN4pCIQniyIy6bPUA8Yzn3ryjuEHq2Pty7PxYtOcYb3OzzPxqcbAYZkD PVKZchhqqk+6d9CqUrbm16eN7P16jiBqv6xuwrYk= Authentication-Results: smtp1p.mail.yandex.net; dkim=pass header.i=@flygoat.com From: jiaxun.yang@flygoat.com To: ralf@linux-mips.org Cc: linux-mips@linux-mips.org, linux-kernel@vger.kernel.org, Jiaxun Yang Subject: [PATCH 4/4] MIPS: Loongson64: Load platform device during boot This patch just add pdev during boot to load the platform driver Date: Sun, 12 Nov 2017 14:36:17 +0800 Message-Id: <20171112063617.26546-4-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171112063617.26546-1-jiaxun.yang@flygoat.com> References: <20171112063617.26546-1-jiaxun.yang@flygoat.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jiaxun Yang 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 1584063615028563900@xxx Tue Nov 14 17:33:05 +0000 2017 X-GM-THRID: 1584063615028563900 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread