From patchwork Fri Nov 6 07:12:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yalin wang X-Patchwork-Id: 7567191 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4A644C05C6 for ; Fri, 6 Nov 2015 07:13:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 356D92076C for ; Fri, 6 Nov 2015 07:13:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F2B5220690 for ; Fri, 6 Nov 2015 07:13:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032310AbbKFHMy (ORCPT ); Fri, 6 Nov 2015 02:12:54 -0500 Received: from mail-pa0-f66.google.com ([209.85.220.66]:35703 "EHLO mail-pa0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1032281AbbKFHMx (ORCPT ); Fri, 6 Nov 2015 02:12:53 -0500 Received: by pacrf6 with SMTP id rf6so13901046pac.2; Thu, 05 Nov 2015 23:12:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=VDKJ60LGX6cbbDlAlDcCLfTAtDkymhqr3zJFoazK2X0=; b=GIcV+IkDxAbfkeBky3yAi2j8Z9jxmOhmGCBvNS47mbkFsl38lDUxPfQiJJqAqLkh0G NoBDOEiFMZYg5ofULa3PfOmuobQBwfhdt6LKDkq15rrDQ1cCfKMFgfLJwpZlnOk+Nowd jjTDM1+LrX5FCoRizKf6KE8q6L7CLQprXWVJ+leE7qjFRKj+HLEpW9614Xdwi1R5asFD 7kE4JCv31Qe8lJY0M9bySGFX94dwc9jYPQDxjl1TDF+SWkwRKkWNau3GA38hTZso+fI3 UClB/PGAIvTwo+BFEdWDGBcnJaWKYQbarp4D8iDpSJzMO1xJ4ZmYyrKjlqeFInWnw46Q qH1g== X-Received: by 10.68.143.5 with SMTP id sa5mr15569463pbb.14.1446793972497; Thu, 05 Nov 2015 23:12:52 -0800 (PST) Received: from ubuntu.localdomain ([17.87.20.218]) by smtp.googlemail.com with ESMTPSA id n1sm11933460pap.7.2015.11.05.23.12.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 Nov 2015 23:12:51 -0800 (PST) From: yalin wang To: dmitry.torokhov@gmail.com, sre@kernel.org, dbaryshkov@gmail.com, dwmw2@infradead.org, gregkh@linuxfoundation.org, jslaby@suse.com, plagnioj@jcrosoft.com, tomi.valkeinen@ti.com, yalin.wang2010@gmail.com, peter.senna@gmail.com, dan.carpenter@oracle.com, joe@perches.com, alan@linux.intel.com, somyaanand214@gmail.com, ricardo.ribalda@gmail.com, mahfouz.saif.elyazal@gmail.com, ravi2j@gmail.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, devel@driverdev.osuosl.org, linux-fbdev@vger.kernel.org Subject: [PATCH V2] goldfish: add goldfish match node for dt driver probe Date: Fri, 6 Nov 2015 15:12:40 +0800 Message-Id: <1446793960-31946-1-git-send-email-yalin.wang2010@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP qemu use device tree to bootup linux kernel, we need add device node match table to plaftorm driver, so that can probe the goldfish driver correctly. test by this qemu: git clone https://android.googlesource.com/platform/external/qemu Signed-off-by: yalin wang --- drivers/input/keyboard/goldfish_events.c | 9 +++++++++ drivers/platform/goldfish/goldfish_pipe.c | 11 ++++++++++- drivers/power/goldfish_battery.c | 11 ++++++++++- drivers/staging/goldfish/goldfish_audio.c | 11 ++++++++++- drivers/staging/goldfish/goldfish_nand.c | 11 ++++++++++- drivers/tty/goldfish.c | 11 ++++++++++- drivers/video/fbdev/goldfishfb.c | 10 +++++++++- 7 files changed, 68 insertions(+), 6 deletions(-) diff --git a/drivers/input/keyboard/goldfish_events.c b/drivers/input/keyboard/goldfish_events.c index 907e4e2..7b99ab8 100644 --- a/drivers/input/keyboard/goldfish_events.c +++ b/drivers/input/keyboard/goldfish_events.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -178,10 +179,18 @@ static int events_probe(struct platform_device *pdev) return 0; } +#ifdef CONFIG_OF +static const struct of_device_id goldfish_events_match[] = { + { .compatible = "generic,goldfish-events-keypad" }, + { }, +}; +#endif + static struct platform_driver events_driver = { .probe = events_probe, .driver = { .name = "goldfish_events", + .of_match_table = of_match_ptr(goldfish_events_match), }, }; diff --git a/drivers/platform/goldfish/goldfish_pipe.c b/drivers/platform/goldfish/goldfish_pipe.c index e7a29e2..55b6d7c 100644 --- a/drivers/platform/goldfish/goldfish_pipe.c +++ b/drivers/platform/goldfish/goldfish_pipe.c @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -615,11 +616,19 @@ static int goldfish_pipe_remove(struct platform_device *pdev) return 0; } +#ifdef CONFIG_OF +static const struct of_device_id goldfish_pipe_match[] = { + { .compatible = "generic,android-pipe" }, + { }, +}; +#endif + static struct platform_driver goldfish_pipe = { .probe = goldfish_pipe_probe, .remove = goldfish_pipe_remove, .driver = { - .name = "goldfish_pipe" + .name = "goldfish_pipe", + .of_match_table = of_match_ptr(goldfish_pipe_match), } }; diff --git a/drivers/power/goldfish_battery.c b/drivers/power/goldfish_battery.c index a50bb98..48b057d 100644 --- a/drivers/power/goldfish_battery.c +++ b/drivers/power/goldfish_battery.c @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -227,11 +228,19 @@ static int goldfish_battery_remove(struct platform_device *pdev) return 0; } +#ifdef CONFIG_OF +static const struct of_device_id goldfish_battery_match[] = { + { .compatible = "generic,goldfish-battery" }, + { }, +}; +#endif + static struct platform_driver goldfish_battery_device = { .probe = goldfish_battery_probe, .remove = goldfish_battery_remove, .driver = { - .name = "goldfish-battery" + .name = "goldfish-battery", + .of_match_table = of_match_ptr(goldfish_battery_match), } }; module_platform_driver(goldfish_battery_device); diff --git a/drivers/staging/goldfish/goldfish_audio.c b/drivers/staging/goldfish/goldfish_audio.c index b0927e4..f0c5118 100644 --- a/drivers/staging/goldfish/goldfish_audio.c +++ b/drivers/staging/goldfish/goldfish_audio.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -344,11 +345,19 @@ static int goldfish_audio_remove(struct platform_device *pdev) return 0; } +#ifdef CONFIG_OF +static const struct of_device_id goldfish_audio_match[] = { + { .compatible = "generic,goldfish-audio" }, + { }, +}; +#endif + static struct platform_driver goldfish_audio_driver = { .probe = goldfish_audio_probe, .remove = goldfish_audio_remove, .driver = { - .name = "goldfish_audio" + .name = "goldfish_audio", + .of_match_table = of_match_ptr(goldfish_audio_match), } }; diff --git a/drivers/staging/goldfish/goldfish_nand.c b/drivers/staging/goldfish/goldfish_nand.c index 623353db5..d4c4285 100644 --- a/drivers/staging/goldfish/goldfish_nand.c +++ b/drivers/staging/goldfish/goldfish_nand.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -430,11 +431,19 @@ static int goldfish_nand_remove(struct platform_device *pdev) return 0; } +#ifdef CONFIG_OF +static const struct of_device_id goldfish_nand_match[] = { + { .compatible = "generic,goldfish-nand" }, + { }, +}; +#endif + static struct platform_driver goldfish_nand_driver = { .probe = goldfish_nand_probe, .remove = goldfish_nand_remove, .driver = { - .name = "goldfish_nand" + .name = "goldfish_nand", + .of_match_table = of_match_ptr(goldfish_nand_match), } }; diff --git a/drivers/tty/goldfish.c b/drivers/tty/goldfish.c index 0f82c0b..a49f4a2 100644 --- a/drivers/tty/goldfish.c +++ b/drivers/tty/goldfish.c @@ -15,6 +15,7 @@ #include #include +#include #include #include #include @@ -324,11 +325,19 @@ static int goldfish_tty_remove(struct platform_device *pdev) return 0; } +#ifdef CONFIG_OF +static const struct of_device_id goldfish_tty_match[] = { + { .compatible = "generic,goldfish-tty" }, + { }, +}; +#endif + static struct platform_driver goldfish_tty_platform_driver = { .probe = goldfish_tty_probe, .remove = goldfish_tty_remove, .driver = { - .name = "goldfish_tty" + .name = "goldfish_tty", + .of_match_table = of_match_ptr(goldfish_tty_match), } }; diff --git a/drivers/video/fbdev/goldfishfb.c b/drivers/video/fbdev/goldfishfb.c index 7f6c9e6..809c502 100644 --- a/drivers/video/fbdev/goldfishfb.c +++ b/drivers/video/fbdev/goldfishfb.c @@ -25,6 +25,7 @@ #include #include #include +#include #include enum { @@ -304,12 +305,19 @@ static int goldfish_fb_remove(struct platform_device *pdev) return 0; } +#ifdef CONFIG_OF +static const struct of_device_id goldfish_fb_match[] = { + { .compatible = "generic,goldfish-fb" }, + { }, +}; +#endif static struct platform_driver goldfish_fb_driver = { .probe = goldfish_fb_probe, .remove = goldfish_fb_remove, .driver = { - .name = "goldfish_fb" + .name = "goldfish_fb", + .of_match_table = of_match_ptr(goldfish_fb_match), } };