From patchwork Sun Sep 17 11:14:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 9954761 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CBB9B603F2 for ; Sun, 17 Sep 2017 11:15:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C13D828B47 for ; Sun, 17 Sep 2017 11:15:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B62EC28B4D; Sun, 17 Sep 2017 11:15:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8DC9C28B50 for ; Sun, 17 Sep 2017 11:15:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751239AbdIQLPK (ORCPT ); Sun, 17 Sep 2017 07:15:10 -0400 Received: from mail-lf0-f44.google.com ([209.85.215.44]:54136 "EHLO mail-lf0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750885AbdIQLPJ (ORCPT ); Sun, 17 Sep 2017 07:15:09 -0400 Received: by mail-lf0-f44.google.com with SMTP id k9so5652128lfe.10 for ; Sun, 17 Sep 2017 04:15:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hO17tlTOQ1LOlKKn/CQjeqz+oGeGllO7H1HElcrN9gc=; b=ji0WLULFyHunFe9yBnidbBxTBTpAkicnxZ+sJ4qSC6tob4hxqXXdUmzXofKlhOsytQ Skjx1lxI7Z8ZGJf9tJlA0Ad0t3CBax5MFc3fDTKiEiJeL53nMM79sUP3xbEmNfrq12aG xyS8RA0DjZiPdAikS+yaP4AIbGdTXHFrgf5L0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=hO17tlTOQ1LOlKKn/CQjeqz+oGeGllO7H1HElcrN9gc=; b=NAR+JwT6vDVggPVRPSEgCgGqhOh7483XlqrZ2QeLCYEKaxEAssCHQSHuzlSDphCg7P pNwYHJjst/Sy1qW1B+DGS6i+G2nHk8X/mlhnG8bxQ+9jtpP2zpQdvOi1xFM8wHGsrTfi /3z548tzzeu+9QaKGnabbiyMyz5ZjyH9mQUhyXxynIGePVQZHvLozFRJKlqZJH8SFCht 4LPD/VAqz0JIKlhksoYu8bB92oCTlOpKaZVRjIbeY3w7Xsva5zML0QPKG2TB/CDV7LxD okSk2goKRcHcp9HSn1WqkYAdKHRuT7gWog7SABZXTF8MzYR79JygB9Ayb7YcokW/AIKZ /Akg== X-Gm-Message-State: AHPjjUhwF/HsQ4tA/KJv0BuDRyfOb9UtlAGYQDem8ohrJ7duIRViy1GX uvObzyy46ToqFqPa X-Google-Smtp-Source: AOwi7QBZx1TC6LeaGaF13JeJk+3zEynLj8OmGKoTg+yj1fyQU16jyOM/8YFZJ1AGdPjzSCVi8CkuSw== X-Received: by 10.46.2.139 with SMTP id y11mr6665871lje.183.1505646908376; Sun, 17 Sep 2017 04:15:08 -0700 (PDT) Received: from fabina.bredbandsbolaget.se (c-2209e055.014-348-6c756e10.cust.bredbandsbolaget.se. [85.224.9.34]) by smtp.gmail.com with ESMTPSA id h83sm1007069lfi.16.2017.09.17.04.15.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 17 Sep 2017 04:15:07 -0700 (PDT) From: Linus Walleij To: Dmitry Torokhov , linux-input@vger.kernel.org, Hans-Christian Noren Egtvedt Cc: Linus Walleij Subject: [PATCH 5/5] input: mouse: Add device tree probing to GPIO mouse Date: Sun, 17 Sep 2017 13:14:45 +0200 Message-Id: <20170917111445.30880-6-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170917111445.30880-1-linus.walleij@linaro.org> References: <20170917111445.30880-1-linus.walleij@linaro.org> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This makes the GPIO mouse probe nicely from the device tree if found in a tree. As the driver uses device properties it can easily be amended to also probe from ACPI devices. Signed-off-by: Linus Walleij --- drivers/input/mouse/gpio_mouse.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/input/mouse/gpio_mouse.c b/drivers/input/mouse/gpio_mouse.c index 7bd2a8ac6e6e..bf748efb270a 100644 --- a/drivers/input/mouse/gpio_mouse.c +++ b/drivers/input/mouse/gpio_mouse.c @@ -14,6 +14,7 @@ #include #include #include +#include /** * struct gpio_mouse @@ -160,11 +161,18 @@ static int gpio_mouse_remove(struct platform_device *pdev) return 0; } +static const struct of_device_id gpio_mouse_of_match[] = { + { .compatible = "gpio-mouse", }, + { }, +}; +MODULE_DEVICE_TABLE(of, gpio_mouse_of_match); + static struct platform_driver gpio_mouse_device_driver = { .probe = gpio_mouse_probe, .remove = gpio_mouse_remove, .driver = { .name = "gpio_mouse", + .of_match_table = gpio_mouse_of_match, } }; module_platform_driver(gpio_mouse_device_driver); @@ -173,4 +181,3 @@ MODULE_AUTHOR("Hans-Christian Egtvedt "); MODULE_DESCRIPTION("GPIO mouse driver"); MODULE_LICENSE("GPL"); MODULE_ALIAS("platform:gpio_mouse"); /* work with hotplug and coldplug */ -