From patchwork Thu Apr 8 13:11:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 417439 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp560716jai; Thu, 8 Apr 2021 06:12:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZ0Ff8FD6BZBFiTVG110S6wn2HznDHyUcAB9jL7dwOwhtvby1CT+A4ucE110smFv/Je8Nc X-Received: by 2002:a5d:58e4:: with SMTP id f4mr9807593wrd.130.1617887543307; Thu, 08 Apr 2021 06:12:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617887543; cv=none; d=google.com; s=arc-20160816; b=x93YzTa/OTVZlHVkkhTLSZbt3gPHiNErnveWHkmlLIKcagfDneLvmk/qHv0XruT0CO qT8e5/kao0xUNtf3+at9jL4/iM13Gk+37UgDnhf+CjfIbBJqVjNEKBlIiQudR6Bm5akC X96gT3pUwBlCUvDHFWPnE2+I/rllLZ1TQQn/+PHKuTzcWp74zeFzv8J/ad37YBfs0OGw StL+I57BsvfDWj9M+RY0vdv+JnfwNh3g66vzqBn0gVMAJAA97I9KJlipXpNVEK5QPFf5 BUSnOuHAL/aAgl84i+9A+cIVbKqCq2ok6wLS+FiKFncVTTZd72jZdMEa6WUsh9tQjP4k q2pQ== 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=PKYnqJnp68WP1Kj7L4dIOxVEYx067uC0uEvN3KDQkUM=; b=E1xqkSFQ2YXt/o7JkDGcef3oLCqZG2xkZgcZgK5/4dU90NeoNvjbFxXPw5ex98+5BA oqozdCT6WDTRJ1WSKWWbEEY9jxYxQrG0uOdcBS2vPeXKlaYHxCG6nsoTjZihhrmjJn8V N1hJ5NixuxP+jUheEGg20o6PRFTPlwq/VT4KMSl9yGAae5fjCbCnz9PpF0rbBv3hpz/0 mHWHh4GaSEYfBphPddx4g5rvfaVxIp5iVUS4W0tzM4EnPVfCeqrArNT6bhwTxRyje+sG F0WQrbfsc/be2hznq6J4cS3AtDkAk7V1CJSskz4fbOQaF5g+Ukwzd3SLSR1QcCUwH+AB 3SZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SMJseBma; 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 du13si21747631ejc.690.2021.04.08.06.12.23; Thu, 08 Apr 2021 06:12:23 -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=SMJseBma; 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 S231424AbhDHNMc (ORCPT + 1 other); Thu, 8 Apr 2021 09:12:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229741AbhDHNMc (ORCPT ); Thu, 8 Apr 2021 09:12:32 -0400 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9ABE7C061761 for ; Thu, 8 Apr 2021 06:12:20 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id n138so3957411lfa.3 for ; Thu, 08 Apr 2021 06:12:20 -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=PKYnqJnp68WP1Kj7L4dIOxVEYx067uC0uEvN3KDQkUM=; b=SMJseBmaf3lnlUZnrmX06kRdFCspaK2zz9JZCMJ+EHEO+/BDzpvG/PndnIpsW9ERuT VJWNDGLHmLe2VOBXl9Lpav4iIXx8IdQFW3dK2FeJM2kEh2JctqlW7YKmBmweStcf6/RV tmfX/HCqqTe9ObzrNtoLQZHYco7XmdA7Zm3S231NMN7b8iJRvBY9U/IKk3nMrM+Q9yXJ 5NpjWgZn/45+kGIzDofVajyW3haN1WfjeTbyGUQHbZJs1hDr+Ft5K0cGuoTU6/Hiy/NT X5b/qszeduANR7R3Mv6IyI9z6B3X7mlSoCTGVvYHpk2yTwKhsW4AZisf8x9b/lVsAehG +Aow== 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=PKYnqJnp68WP1Kj7L4dIOxVEYx067uC0uEvN3KDQkUM=; b=kkr9OKxyvqI/mhktNASo0unAPHw+yiO523bFH8047dZnshxy1ezwSa4x+ovFDMim3I e/3vfKaIdeUM7o0gQPKg2HGkLHFw11Oq56kSs/1CVAUgjJbbKvAl238NZCKfRMwHGgwm rbsO1hJrh1FQu2FE/C4XnRRo+UcmxOUYUKyY5Z9Omu57Ff0k+05JPGOtlDcjrcy4ILkV +3ajAp7DeTxQZucU/542wGl/VHAF0JiHmM6pYgK8a5K2vauiuJY+FGs3M25NZiE1QQBZ GXKCFXCeWiXerjGB51Si0Y7ndXWaszH3b8g1i7Lqv4/YnoiMLU9I3cmT6/LmGd8FYgyO gDSg== X-Gm-Message-State: AOAM532nrNpOPErssE7ckwJ1M50+s1NZ7TA35+zUolSqMhvYfz9UXzo0 DBUzBoPn+EdgKa22jRzDpOy4J1Y3dudx+/wc X-Received: by 2002:a19:24d4:: with SMTP id k203mr5804278lfk.249.1617887538596; Thu, 08 Apr 2021 06:12:18 -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 z7sm126936ljm.102.2021.04.08.06.12.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Apr 2021 06:12:18 -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 2/8 v3] Input: cyttsp - Probe from compatibles Date: Thu, 8 Apr 2021 15:11:47 +0200 Message-Id: <20210408131153.3446138-3-linus.walleij@linaro.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210408131153.3446138-1-linus.walleij@linaro.org> References: <20210408131153.3446138-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. Reviewed-by: Javier Martinez Canillas Signed-off-by: Linus Walleij --- ChangeLog v1->v3: - Add MODULE_DEVICE_TABLE() for both sets of compatible strings. - Collect Javiers review tag. --- drivers/input/touchscreen/cyttsp_i2c.c | 8 ++++++++ drivers/input/touchscreen/cyttsp_spi.c | 8 ++++++++ 2 files changed, 16 insertions(+) -- 2.29.2 diff --git a/drivers/input/touchscreen/cyttsp_i2c.c b/drivers/input/touchscreen/cyttsp_i2c.c index 061debf64a2b..0a09f07bc23a 100644 --- a/drivers/input/touchscreen/cyttsp_i2c.c +++ b/drivers/input/touchscreen/cyttsp_i2c.c @@ -52,10 +52,18 @@ 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 */ } +}; +MODULE_DEVICE_TABLE(of, cyttsp_of_i2c_match); + 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..8715e5354d79 100644 --- a/drivers/input/touchscreen/cyttsp_spi.c +++ b/drivers/input/touchscreen/cyttsp_spi.c @@ -160,10 +160,18 @@ 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 */ } +}; +MODULE_DEVICE_TABLE(of, cyttsp_of_spi_match); + 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, };