From patchwork Mon Sep 25 16:34:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 114178 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp2803890qgf; Mon, 25 Sep 2017 09:34:51 -0700 (PDT) X-Received: by 10.84.130.67 with SMTP id 61mr8334250plc.131.1506357291566; Mon, 25 Sep 2017 09:34:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506357291; cv=none; d=google.com; s=arc-20160816; b=LwsyB/kz32Fi13e1ymrGVsEg+yPfRfiJ+QZDEASVtkDfd2HEGYI/nBcGVABQAHWI1a i5GSY4/cwc/+y+xytd2OYwysE+FAr6ae/Maj9kltVyGaYJPwu01k1dcp4a1ireV30IsA RaHqvniAaHFPD6sJLFbOaY3j+Te4EzwkZaFZQNbRtaEbOGqQLidqtL7nPNqJIi9IdkCb Hw5V5o7LRFm4C04Q0xc+TuKiSEx+DpKTlyoJulkvFmVkUNN0htIiiacFn2UpeEr9OtbN NBHIDJxemt920UHl0cUmhfLtzXLVY3mwRB3k2Ej/RhLjkwh1KhWk1nLzxTnRYMo9Hk1x yb2g== 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=reUsx2YhdOTP5n11a5CbLFdPIdfmJFwg9M6sPddDqok=; b=Hm3ZityVA0fDYugYLszM+R6IM5yqoduGwzjt4DA8Ng+2D+dulMLD4hwI6i8CQmOWjW SO1KCdfAq/f5+CmFiUOcQ/Odcwq8Zf+8tZ/jFfq7Y7YXHgSw07Sx6ifCcG8bn3DtKb5C Le12wojnCHFtRzrsjUaxS94qcD+/6f2wts67fiHHGt5esosY2A6DAVRtwQ5JCrpzc9XQ De299rqaqD8cSQuE5zE8MRvjj4fhkqA6a0sC3hiMhLeQLvVzO3+KxxLwYAB1yA3KSRIu pQ9jWfi9YrsfBpklP3aOhIPjra3MK1DybIo5kzWZRCdu8RRWVP50a/g5BsncindNjh73 0c+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=HjDh7Cbs; 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 y11si3806375pfi.187.2017.09.25.09.34.51 for ; Mon, 25 Sep 2017 09:34:51 -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=HjDh7Cbs; 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 S965231AbdIYQeu (ORCPT ); Mon, 25 Sep 2017 12:34:50 -0400 Received: from mail-pf0-f169.google.com ([209.85.192.169]:50369 "EHLO mail-pf0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965206AbdIYQet (ORCPT ); Mon, 25 Sep 2017 12:34:49 -0400 Received: by mail-pf0-f169.google.com with SMTP id m63so4054076pfk.7 for ; Mon, 25 Sep 2017 09:34:49 -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=CqHt+crU/CQj4wtAR52OG9Vzb/KE8OHN58XPAOZNeJo=; b=HjDh7CbsGIGWCbxW7rOYqcwI9mx1X06tJGxf2ydPsM//x3Ixf33TFSNwkbQwiLkDon IM5Ficju45G4IanUpCTdcw0GtpQfV8Z/ry3JhVzoOlVWMje2lR52Q2QFdno0Tp2gYq6R LeFRdjcERi0fGD3v96JteXB1EGJnxNCZjLSc0= 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=CqHt+crU/CQj4wtAR52OG9Vzb/KE8OHN58XPAOZNeJo=; b=on2wbbzYVyigVe4p0i5p3T0ZwWvjWZJxffu4L4dVQmHJNpQjMKlDU3LXVtd68cqBXn DrYdyvdVqbt2fOaTRbrc76uPOb534CWkO2kuM9h6NSprGz+OTEDDacIaaQGwsMaFYys6 Kci/OqcA93xMu0J23i4d5XVwq+6C2Io3JYDp8P1JlY/vkVrPoSlN0ZMnJ87Ge5GHq9l3 lBatM81wTOCZHBS43HbKVArmUNQvGlEjvN5qL9ZoFfKmhC7q4Q4SGl9MKEx/OMMnQEwY TsrceJncCPtSY/CyL+Sef4EW/qjyrEP87XePCoAvIBsDWjntIHw12T5ciJoQBdKHPI4j 9AMQ== X-Gm-Message-State: AHPjjUiu/pUqB5PSSKk48qx2KZjTm3UVzUiEPMctibOQ40ZLZpibPL45 1wKd5TIb5Qm6/8z8RW3g2un1vg== X-Google-Smtp-Source: AOwi7QDHkJ8eBJ4C8Nkd/i4jY5ywVj+d8jbF36UV5PsLS2f36yargdJcMouCH8soT/3GfybMxdrd2Q== X-Received: by 10.99.114.29 with SMTP id n29mr8238344pgc.218.1506357288816; Mon, 25 Sep 2017 09:34:48 -0700 (PDT) Received: from localhost.localdomain ([70.35.39.2]) by smtp.gmail.com with ESMTPSA id j1sm12004413pfc.169.2017.09.25.09.34.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Sep 2017 09:34:48 -0700 (PDT) From: Linus Walleij To: Dmitry Torokhov , linux-input@vger.kernel.org Cc: Hans-Christian Noren Egtvedt , Linus Walleij Subject: [PATCH 5/5 v2] input: mouse: Add device tree probing to GPIO mouse Date: Mon, 25 Sep 2017 18:34:30 +0200 Message-Id: <20170925163430.22397-5-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170925163430.22397-1-linus.walleij@linaro.org> References: <20170925163430.22397-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. Acked-by: Hans-Christian Noren Egtvedt Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Collect Hans-Christian's ACK - Rebase on the other changes. --- drivers/input/mouse/gpio_mouse.c | 8 ++++++++ 1 file changed, 8 insertions(+) -- 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 4f3c9ca7b821..deefe0df56b4 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 @@ -158,10 +159,17 @@ static int gpio_mouse_probe(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, .driver = { .name = "gpio_mouse", + .of_match_table = gpio_mouse_of_match, } }; module_platform_driver(gpio_mouse_device_driver);