From patchwork Sun May 9 22:34:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 432879 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp2335738jao; Sun, 9 May 2021 15:34:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSGzJhUstgMOeqjV8N6oWxEfR80oxLVB2F52yZLUscHEnWP2B17oWtOyqLiluXbzB9sxoP X-Received: by 2002:a17:906:fac9:: with SMTP id lu9mr23172858ejb.29.1620599676563; Sun, 09 May 2021 15:34:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620599676; cv=none; d=google.com; s=arc-20160816; b=b6tpT5RrOTheCEvxZQiHtOOXCjJdEZWCtG7ll38NCkUSkjUIOwEodNE6MYquvZ6XAE VzTtEHrow1DLCHfwYTl5JlVec6OqoLQc/RmpMq2FkZ+/jgj325Hr4sf0SePAZcF2r1Ht BNIw5/SlGF7kCA9fiZQZvT0YGfkT9boqRD/2uwL0768maB10ClPuQumcPtgVBvWGR48v I4m6yNB9yNhK2HwOAh6GxHo0ne2V7UT95GuRWzgaZMsE+JIpmjqXL2QdkB2kCh0hdLJK XaZwnobOtmU5/a99qTZUDXoW3hJfp1QIAxQA55PzjswMpXJ+/6Go8mPflrImbr3k9ruC QZgw== 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=Ar6y7hws/LzmglxytevCO91fs4jxRRoR8GPk0J3Q6Ac=; b=cj2+f3C1ixkJipjsOIw1x5u63Vrb8VHtHYFJnOMPGdlefb6tpyjcRGj5QKAD5NZeMF Z5nU4gxGjkINH/hVUNJq1z8kUqHRJ6l3etZl3du8PljItjMSMFEY796OJsfkB5iimlvf 5cwI9KWmd6VxH1aI3YBe1oTyL/nezHqlyxW0LtX/ZQncoqssBJUCMrLwhdgz4VsxIK7I Xi5zX5W+o/CYa/8+XfrwFHOph9KXlECwyfm3PaD90vs4l2C6HeXH9HZ6Dc01milBcazM t4NtqaxhtVDTqXNgBo85JkdV7DLzjk7q7V12QSpbYPBjdlx1VqllLrxntGu90NEfqNc3 daAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=B2ePBmDE; 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 n2si8741324eda.470.2021.05.09.15.34.36; Sun, 09 May 2021 15:34:36 -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=B2ePBmDE; 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 S229876AbhEIWfh (ORCPT + 1 other); Sun, 9 May 2021 18:35:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229847AbhEIWfg (ORCPT ); Sun, 9 May 2021 18:35:36 -0400 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0124C061574 for ; Sun, 9 May 2021 15:34:31 -0700 (PDT) Received: by mail-lj1-x22e.google.com with SMTP id v5so18458604ljg.12 for ; Sun, 09 May 2021 15:34:31 -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=Ar6y7hws/LzmglxytevCO91fs4jxRRoR8GPk0J3Q6Ac=; b=B2ePBmDEqXYd1ZSE44p4Adatv2UF08L/P1xZs+SElkXnTBiLN1wstcyjuJaoOOPXf4 it9m/N6jTlMhOyA4UJ1Cw2DErkIMGmej0Ryh3AhaTR+bo+m2e2BFdHeQMFrMzDfGvXC7 v+8mYYEc65TzxTnKnduCJ20/SjZt7zbkB/DxRj4M/tflYfJIMyeNbWM+VMcNuaQKyeYW pCCksg7JWSA+NnEvQVILV8ZNo+Tr8khRwH8AayBtqedOxYsh0MuR66lvc4hc7X6hvOYc tlCOhm5/K4h46jwkgCvmBxzgu9nmRUQ7pRNUDMjKWTHcAzWk1hX1rKTX0KTNT9AW2kvI FSjw== 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=Ar6y7hws/LzmglxytevCO91fs4jxRRoR8GPk0J3Q6Ac=; b=JUSGvVtfiBpTWGyCvZ7O7xsSwim+N9N9eHBzhuln62sfP6m8/k2eQWUwX2paJ2rrPT C7gQm1ikVqQGsIdheyB95tH3PA+USQb453lLvoe5bDJgM+Mc2IQ2FQcW1ABXL8n530tG ppPTyOFtXMT4E1fWjt+AnxIk/wwSNHXeppEw0imfdxmIiAoBvBI7M1nTtNvAwIV7qDFW 6Qd0d1WrduG5j1dV5y37qjJcNg2adgYqZp3YQ9XgtXl36pctp965mgvspaTUhvQxf2oT jeK5ROFDgOiYMcX8fIMalZ7XHksSHGvaiPDcKwba3ID32TqXzErQuz1Km2Hsds2J+z3L B52A== X-Gm-Message-State: AOAM5336qTQ+JOAPmo2PtmanesPN+EPEkUTp1o/IQ9kZ4FD9lQecmIv2 oAGWR3XTKutqOXlVKyX2k4a8Zw== X-Received: by 2002:a2e:9ad9:: with SMTP id p25mr17858683ljj.127.1620599670507; Sun, 09 May 2021 15:34:30 -0700 (PDT) Received: from localhost.localdomain (c-fdcc225c.014-348-6c756e10.bbcust.telenor.se. [92.34.204.253]) by smtp.gmail.com with ESMTPSA id a16sm2022257lfl.51.2021.05.09.15.34.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 May 2021 15:34:30 -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/3 v5] Input: cyttsp - Probe from compatibles Date: Mon, 10 May 2021 00:34:15 +0200 Message-Id: <20210509223416.346104-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210509223416.346104-1-linus.walleij@linaro.org> References: <20210509223416.346104-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 v3->v5: - Rebase on v5.13-rc1 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.30.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, };