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: 112838 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp2564706qgf; Sun, 17 Sep 2017 04:15:11 -0700 (PDT) X-Received: by 10.84.230.229 with SMTP id e92mr33557215plk.259.1505646910945; Sun, 17 Sep 2017 04:15:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505646910; cv=none; d=google.com; s=arc-20160816; b=mDu1hHJ1qz8PvTVnMcE+IV/gcVxYwMyuB5IWFMG8Mb1K+o/ZZNnvbJrdKKYabAgZQv MmUyyMKcaAtiy4cZN7XBAouu0cqcPr2r25KI5F4msg5wqcW7maegbbSkFMLFbWz1jJrh 0tdIolrikztyNkkBxvRRe+9R6Naj/Cz/YcWRwidAyo138LivOFo2iKMT8SdLzumRUTOg uG/Fei9WRuSsKyiDXxhdLWx1GrK8vx+3r+sC6vui0Q4jmjjrlSRIK15NXIsIACXVXaOy 6nzIWGBwnNoKDQIaU/O/utXBdGp8Ftcf0dC9931DVkl126NdFRBrSlHh+f6OR5aUgIou +Izg== 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:arc-authentication-results; bh=xwo31OF/JuUhI2g/0AIDC3Zhxh+XJM2gpihzSwXbxP0=; b=s9dtKwOIRSryTlB9WwPTjVNTlcmkA5uRBYFhPyGGmwxgctUZTyVa/q3gHGc6yYvXfv LO73iIx8G0B/B2w07ZsazKi3Hl+SERtFFMtnjt83l8XQuAJf2qjsqQ+T1W/ombhsh/vj Sp9TUlOcNXmy8/0XBhjHnkAbvSm6SaO6a60uh833Gwfnnh7VAvyI7EINMhi77iiT8tcQ 2mHSdu7vjAA6FO7Iy+mIdFZR0f0+jSMVPBGVSHaen1dFzTNYGW5NHTuo0whLHeMtPyKn AdLnl9mqI7mBfSAyVd3T2JEvMQysym2efJ/RgI5xr5f0GuMD6fDBqbby/4oM05oy7kAW o04Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=ji0WLULF; spf=pass (google.com: best guess record for domain of linux-input-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-input-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s18si1203814plp.783.2017.09.17.04.15.10 for ; Sun, 17 Sep 2017 04:15:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-input-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=ji0WLULF; spf=pass (google.com: best guess record for domain of linux-input-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-input-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 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(-) -- 2.13.5 -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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 */ -