From patchwork Tue Mar 30 08:54:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 411683 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp4279227jai; Tue, 30 Mar 2021 01:55:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzE6bi8bMaSVsA733g/ygjTqrtbOw0ro2u498JPIbubdIGeLobCMl3wZvW7Jy4x56i7cBI X-Received: by 2002:a50:bb47:: with SMTP id y65mr33302400ede.305.1617094522511; Tue, 30 Mar 2021 01:55:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617094522; cv=none; d=google.com; s=arc-20160816; b=0tzb/sGiKLCRJUJi5ECGUjMVIGjmszLg0lmhvvUFdc02Lxv8stOl0FNFnVn5kAHbQe giJGwqw+B2zlXyVOefgspNyavqToRTfeTt1XrQAVWTaBtEsycoQBWy5td9pZZHCM135p KirU1EspEfBE99gCch/hqg+GX9BQTJbDON26Y5AvRoOPwtV3iSG0dln5fmOtPmUZE876 MBzuKWzCfjMjRzA0ZB3fJ16UCM8ILG8haoaRNq2/et8+/ejrD03EFKp7hwV0EOgwLjYv xdp2qACFyG68EJZBHzgjP7GWUeWxlwVrQ26Zsovp56rWba3FFgn9pC5RS5mCI0MsA1tM dx4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/7GlKvi87M8Si6285ApZgfbAtLyH/k4agACd8QLYqS0=; b=m45cY7bfyRgWUsrK1nXDwu8kmIL7nvrQHzy+eRDVT/vSLaSsYvzwbmCOKzxWWMpIXa bEaE5cFYxN8BSWfDFulZO2dJIh4ThuloMIrjR5qvJ8+ixF1wfsZ5wE2XtZAPx/v9W8Ax THD2bk5nOP51OdSfsHSk+MEbChc6TS1JJEBDHz8iS5R+7d5ZA9mGnXRr6pZCRzyCiJQP l/Gw7nvvavepU579SaQ0+PKWdDRjHu4nhjw85tV2RQWO2ub5n2HHPaCUv8P6d2rLwMXd aIPp+MpMFMg9l7uSQpBxLVcQHzqtOnoCYh7TwO8/HsZAS+nyvbq0nSlsNX7JsWAZJrzg riPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Z8cg/k86"; spf=pass (google.com: domain of linux-input-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-input-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a22si14273072edv.24.2021.03.30.01.55.22; Tue, 30 Mar 2021 01:55:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-input-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Z8cg/k86"; spf=pass (google.com: domain of linux-input-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-input-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230303AbhC3Iyu (ORCPT + 1 other); Tue, 30 Mar 2021 04:54:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230415AbhC3Iy3 (ORCPT ); Tue, 30 Mar 2021 04:54:29 -0400 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 680DCC061762 for ; Tue, 30 Mar 2021 01:54:29 -0700 (PDT) Received: by mail-lf1-x12c.google.com with SMTP id n138so22653253lfa.3 for ; Tue, 30 Mar 2021 01:54:29 -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 :mime-version:content-transfer-encoding; bh=/7GlKvi87M8Si6285ApZgfbAtLyH/k4agACd8QLYqS0=; b=Z8cg/k86hy9BFJPEW6HeuQ4b6sKNo2fusttZ+SIdMiMPBViTUr6P8C1eiZu8iImEob i/eU2/obmck14J5enLSSGjP1Mfs1Bi3nuuoAWJw70N2zMfOB5oaNbUHIe1kmO9cgpIZU 99ixmkYOtWRY+DU2NgdiPoM5uEy5MClrFs28sZONVpJWFSMTAxDaMuPXNYjcNwjFnI5X Q0HEKTfayoVEifhnUirzLtib0i0PjFYilyelA/TUd5eku5GD4w4xNvjfR95uOWuDZB8p //eJm6F6TaUbDDn9+OvG4v5vJRb8m6shqVwCwTm7kaiWFH/MrIySCHsMa5OauC0LXyqq 3d+Q== 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:mime-version:content-transfer-encoding; bh=/7GlKvi87M8Si6285ApZgfbAtLyH/k4agACd8QLYqS0=; b=B6YB4IEJ13qUfUp/Nsr925KdwEpbS4Do8zD9XHgsxbcN/00gFU4f1TFwXVyc/ayg6v Wxyiw0vTPJ15j+wNB4WMBaoufCV5AYUk/yNzPi3MYXG/1AournnwgUAZbYKGOx709FuQ Bjd73T6t6UhI/cGgnJlbQv9OVPZBmPQ+hmwmGOdbbt8zBZ7T++1bMkEjXfQCCpH4pbAM 3t1v5y2KEHdfqhOwKgYvk5F4DSflPItTVrCuegRuWnFjg7ItcANUwtUvbgce8jtNq64h 27VIBvOL0mkkeVIXVz0k5LvyaXJd4rUil7vr0m9iekAgwi8NEEZ33jJoHSFDU1QFQd6F gfNQ== X-Gm-Message-State: AOAM530P4kLsOUxHSNaF7i3qUK8NmPZH9dXZvhJ5JAAPXp4tC5vC1QWN /l0fMjqM1Hr3FayuB9YYjMw/8Q== X-Received: by 2002:a19:ae07:: with SMTP id f7mr19301555lfc.551.1617094467954; Tue, 30 Mar 2021 01:54:27 -0700 (PDT) Received: from localhost.localdomain (c-14cb225c.014-348-6c756e10.bbcust.telenor.se. [92.34.203.20]) by smtp.gmail.com with ESMTPSA id 201sm2104238lfm.108.2021.03.30.01.54.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Mar 2021 01:54:27 -0700 (PDT) From: Linus Walleij To: Ferruh Yigit , Dmitry Torokhov , Javier Martinez Canillas Cc: Henrik Rydberg , linux-input@vger.kernel.org, Linus Walleij Subject: [PATCH 1/7] Input: cyttsp - Probe from compatibles Date: Tue, 30 Mar 2021 10:54:18 +0200 Message-Id: <20210330085424.2244653-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210330085424.2244653-1-linus.walleij@linaro.org> References: <20210330085424.2244653-1-linus.walleij@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The driver (both SPI and I2C interface) should probe from the compatible strings, cypress,cy8ctma340 etc when using device tree, not as now, where it is probing implicitly from the I2C/SPI node name "cypress,cyttsp-i2c" etc. Signed-off-by: Linus Walleij --- drivers/input/touchscreen/cyttsp_i2c.c | 7 +++++++ drivers/input/touchscreen/cyttsp_spi.c | 7 +++++++ 2 files changed, 14 insertions(+) -- 2.29.2 Reviewed-by: Javier Martinez Canillas diff --git a/drivers/input/touchscreen/cyttsp_i2c.c b/drivers/input/touchscreen/cyttsp_i2c.c index 061debf64a2b..0f097f34832a 100644 --- a/drivers/input/touchscreen/cyttsp_i2c.c +++ b/drivers/input/touchscreen/cyttsp_i2c.c @@ -52,10 +52,17 @@ static const struct i2c_device_id cyttsp_i2c_id[] = { }; MODULE_DEVICE_TABLE(i2c, cyttsp_i2c_id); +static const struct of_device_id cyttsp_of_i2c_match[] = { + { .compatible = "cypress,cy8ctma340", }, + { .compatible = "cypress,cy8ctst341", }, + { /* sentinel */ } +}; + static struct i2c_driver cyttsp_i2c_driver = { .driver = { .name = CY_I2C_NAME, .pm = &cyttsp_pm_ops, + .of_match_table = cyttsp_of_i2c_match, }, .probe = cyttsp_i2c_probe, .id_table = cyttsp_i2c_id, diff --git a/drivers/input/touchscreen/cyttsp_spi.c b/drivers/input/touchscreen/cyttsp_spi.c index 54e410921d53..ad8b3c6c4d3e 100644 --- a/drivers/input/touchscreen/cyttsp_spi.c +++ b/drivers/input/touchscreen/cyttsp_spi.c @@ -160,10 +160,17 @@ static int cyttsp_spi_probe(struct spi_device *spi) return 0; } +static const struct of_device_id cyttsp_of_spi_match[] = { + { .compatible = "cypress,cy8ctma340", }, + { .compatible = "cypress,cy8ctst341", }, + { /* sentinel */ } +}; + static struct spi_driver cyttsp_spi_driver = { .driver = { .name = CY_SPI_NAME, .pm = &cyttsp_pm_ops, + .of_match_table = cyttsp_of_spi_match, }, .probe = cyttsp_spi_probe, };