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: 12172043 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A91CC433E0 for ; Tue, 30 Mar 2021 08:55:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 23E976195D for ; Tue, 30 Mar 2021 08:55:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230303AbhC3Iyu (ORCPT ); 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-Google-Smtp-Source: ABdhPJyyiyo+HTF0JO2YDBJFqErSKy/JB/cJeH1vsIN+s5vtD18CpIL7Q5QPVw7qHteiJbtaXBvKCA== 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 Reviewed-by: Javier Martinez Canillas --- drivers/input/touchscreen/cyttsp_i2c.c | 7 +++++++ drivers/input/touchscreen/cyttsp_spi.c | 7 +++++++ 2 files changed, 14 insertions(+) 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, }; From patchwork Tue Mar 30 08:54:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 12172041 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4AFDAC433C1 for ; Tue, 30 Mar 2021 08:55:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EFBBC61959 for ; Tue, 30 Mar 2021 08:55:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230415AbhC3Iyu (ORCPT ); Tue, 30 Mar 2021 04:54:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231124AbhC3Iyb (ORCPT ); Tue, 30 Mar 2021 04:54:31 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 048D4C061762 for ; Tue, 30 Mar 2021 01:54:31 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id 12so12240810lfq.13 for ; Tue, 30 Mar 2021 01:54:30 -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=m07c7y4tYH8unWOnb0Pzb8s2m7otaYJx80OAF9fD+f0=; b=Fg3QDwtcUyKXxHPTnQ9okrcd3c7vQXlhG96RXgde/r/libmG9B9dTRqxqYW5vVLSLQ V7SgqADrcFvxfLFgKo/JdF8Y7svn43VvERvMhllPTyIpbf6CzC6lxNcypRndZTs+cdWB EBCcHQTQPz3zOvlv4O89G9cvkyM/bMHG4CZBhhPtdgd4ZvE2Lhd3/oUc3pU+rSgOBpVP /E95ZHjBQ+PLBGEGMv0+C9HI8RV+34vtJHWSlWWstEyR9cnM0efvIOjWENZ2keJmJEwi 4aF1HXCswy4ayTJNb3dDxTyz8dzeJyoO749AFZqHadgJg5Xkdh8+a7uLgUtAdNdkv0pa F3ZQ== 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=m07c7y4tYH8unWOnb0Pzb8s2m7otaYJx80OAF9fD+f0=; b=Auq0CQU9LhLH0JMT1ZAve0+JIQul351lGZuInZZsnwbO2DCYLrRQURcVyadfduGmeh 35ZUVI/ro2XG3kG7n0K9/1V4I+a3d8FZGVvsU0ofchJ2ciGBU2HqmoHrkzjdVRm9bCih t/8++JR3J5C8ab+MAKNKWqAmfryDX6h5SSkeuE56Du8WjK6Z90DSs+bMzY9WTE0YFhW9 xctkH6c5oD9LAIgU0RzCmvgzDC5EYy5d4XKOa02XMeXR1Yaiz8GxzQ/6eXFMltQuGAsZ iV8lnd1A8SsPl9bztlUgTfV/iudThifY+vzZerdPytlBSaVOvAuyn5cTo4EArs7DKYkq T+Ag== X-Gm-Message-State: AOAM533qO65ntP/rG3nWoz2AOoXN60i/+cu90+abXWrqspktEB4uhAHL YYc4Q5IblFczIXjoL2Nga3bqMqv1GuSjMYS0 X-Google-Smtp-Source: ABdhPJwslOtl3CjuzuFsJi9+tNgZCWmonHL1QpnGU+TjPA+okPoNV+qYv6kNv5KRcC6qByl1uUrdmw== X-Received: by 2002:ac2:5519:: with SMTP id j25mr19976516lfk.220.1617094469544; Tue, 30 Mar 2021 01:54:29 -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.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Mar 2021 01:54:29 -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/7] Input: cyttsp - Obtain regulators Date: Tue, 30 Mar 2021 10:54:19 +0200 Message-Id: <20210330085424.2244653-3-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 CYTTSP TMA340 chips have two supplies: VCPIN and VDD for analog and digital voltage respectively. Add some minimal code to obtain and enable these regulators if need be. Signed-off-by: Linus Walleij Reviewed-by: Javier Martinez Canillas --- drivers/input/touchscreen/cyttsp_core.c | 30 +++++++++++++++++++++++-- drivers/input/touchscreen/cyttsp_core.h | 2 ++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/cyttsp_core.c b/drivers/input/touchscreen/cyttsp_core.c index b9772192b5ea..a19d7cce95ca 100644 --- a/drivers/input/touchscreen/cyttsp_core.c +++ b/drivers/input/touchscreen/cyttsp_core.c @@ -22,6 +22,7 @@ #include #include #include +#include #include "cyttsp_core.h" @@ -621,6 +622,19 @@ struct cyttsp *cyttsp_probe(const struct cyttsp_bus_ops *bus_ops, ts->bus_ops = bus_ops; ts->irq = irq; + /* + * VCPIN is the analog voltage supply + * VDD is the digital voltage supply + */ + ts->regulators[0].supply = "vcpin"; + ts->regulators[1].supply = "vdd"; + error = devm_regulator_bulk_get(dev, ARRAY_SIZE(ts->regulators), + ts->regulators); + if (error) { + dev_err(dev, "Failed to get regulators: %d\n", error); + return ERR_PTR(error); + } + ts->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); if (IS_ERR(ts->reset_gpio)) { error = PTR_ERR(ts->reset_gpio); @@ -666,20 +680,32 @@ struct cyttsp *cyttsp_probe(const struct cyttsp_bus_ops *bus_ops, disable_irq(ts->irq); + error = regulator_bulk_enable(ARRAY_SIZE(ts->regulators), + ts->regulators); + if (error) { + dev_err(dev, "Cannot enable regulators: %d\n", error); + return ERR_PTR(error); + } + cyttsp_hard_reset(ts); error = cyttsp_power_on(ts); if (error) - return ERR_PTR(error); + goto err_dis_reg; error = input_register_device(input_dev); if (error) { dev_err(ts->dev, "failed to register input device: %d\n", error); - return ERR_PTR(error); + goto err_dis_reg; } return ts; + +err_dis_reg: + regulator_bulk_disable(ARRAY_SIZE(ts->regulators), + ts->regulators); + return ERR_PTR(error); } EXPORT_SYMBOL_GPL(cyttsp_probe); diff --git a/drivers/input/touchscreen/cyttsp_core.h b/drivers/input/touchscreen/cyttsp_core.h index 8c651336ac12..c102a094e888 100644 --- a/drivers/input/touchscreen/cyttsp_core.h +++ b/drivers/input/touchscreen/cyttsp_core.h @@ -23,6 +23,7 @@ #include #include #include +#include #define CY_NUM_RETRY 16 /* max number of retries for read ops */ @@ -123,6 +124,7 @@ struct cyttsp { enum cyttsp_state state; bool suspended; + struct regulator_bulk_data regulators[2]; struct gpio_desc *reset_gpio; bool use_hndshk; u8 act_dist; From patchwork Tue Mar 30 08:54:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 12172053 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF8A1C433E4 for ; Tue, 30 Mar 2021 08:55:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A2FB86199A for ; Tue, 30 Mar 2021 08:55:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231269AbhC3Iyw (ORCPT ); Tue, 30 Mar 2021 04:54:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231313AbhC3Iyp (ORCPT ); Tue, 30 Mar 2021 04:54:45 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DD9AC061762 for ; Tue, 30 Mar 2021 01:54:33 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id w28so1663735lfn.2 for ; Tue, 30 Mar 2021 01:54:33 -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=xL6erVnxQRl61MXnF85N/4HssiewiDMqKG8DTl4YuT0=; b=sJqtEpMbZ/peEhed9U3nZGgfwzRFiyq986U+KtAl3UM0Dni1Aj22f4aBffF0lrBv1V BrMxyl6kwKrpEweT8OcsyVcKZs5rxgBJXREnq/F8P/+k3wjgN3JZY/RPcFfWnwZJ/4qT 5A7V+n0WcER/Moecomig/XBCpSoYYqMJ+JHHJgceawpxXcHM9OEenKxiE0EjrBxCxIFz BFVqb1s9/sfQah99Nel3rgIxRYkSVnfEeRDaxJs3xPrPa13p/qT4tGEGrFoC6QeLVjPF fROqq0NrsX/qTLeateLqeSbpACaYv+7NWCktiY14clX7bOTHSuYN++vebXfDLjeIQRg0 ZzMg== 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=xL6erVnxQRl61MXnF85N/4HssiewiDMqKG8DTl4YuT0=; b=BF8iNKK//Gw9iaWte7F34OYilN6/tG9UWNIbnKxYF60nT8TvPo8pB0enKcLzRQx98c qQoIm/mETkkYHjl0WFsd3jeLVHXJnk7uF4T/Vb240t90NAeVoWPVgB1UYBkJtX1znlQq xLdpvmiKL7kDsfKZszZ7tTHhHJCas+jsMFVkGSfpdPxaSNeoxfuyxvy/QwdDkqdJVMV7 wGY7OLLC5UkmoJGwLT1URN+rBBKYyQvG1L2hsUkeTOX/z+q/Q6WzLaI8X7vZpFi5VnIF S5yh3kgV7p0EKp6PRUCGEicnOyk147sQBsClBtcfC42RRAqNBpywk0sudp9Fc6wMW6l8 q/ew== X-Gm-Message-State: AOAM532U0WY0yU+u/MgoZoHYcoRagJG9tn4HyTSajIJakhDXXVacymur z+t3Pct5jUKfFuMSTRbOlBhZmA== X-Google-Smtp-Source: ABdhPJwhzmbw2j9LiMsjkq3AjDbCRNB/p+csQitEWdgfuA3+edUtVN8OYpy35tGo7Yd/fwFlycNWyw== X-Received: by 2002:a19:915:: with SMTP id 21mr18514597lfj.270.1617094471072; Tue, 30 Mar 2021 01:54:31 -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.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Mar 2021 01:54: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 3/7] Input: cyttsp - Error message on boot mode exit error Date: Tue, 30 Mar 2021 10:54:20 +0200 Message-Id: <20210330085424.2244653-4-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 Provide a proper error message when attempting to exit boot loader mode and failing, which is something that happened to me. Signed-off-by: Linus Walleij Reviewed-by: Javier Martinez Canillas --- drivers/input/touchscreen/cyttsp_core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/cyttsp_core.c b/drivers/input/touchscreen/cyttsp_core.c index a19d7cce95ca..91f8f38b3f06 100644 --- a/drivers/input/touchscreen/cyttsp_core.c +++ b/drivers/input/touchscreen/cyttsp_core.c @@ -410,8 +410,10 @@ static int cyttsp_power_on(struct cyttsp *ts) if (GET_BOOTLOADERMODE(ts->bl_data.bl_status) && IS_VALID_APP(ts->bl_data.bl_status)) { error = cyttsp_exit_bl_mode(ts); - if (error) + if (error) { + dev_err(ts->dev, "failed to exit bootloader mode\n"); return error; + } } if (GET_HSTMODE(ts->bl_data.bl_file) != CY_OPERATE_MODE || From patchwork Tue Mar 30 08:54:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 12172047 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8E4FC433E2 for ; Tue, 30 Mar 2021 08:55:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8081F61959 for ; Tue, 30 Mar 2021 08:55:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229633AbhC3Iyu (ORCPT ); Tue, 30 Mar 2021 04:54:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231154AbhC3Iye (ORCPT ); Tue, 30 Mar 2021 04:54:34 -0400 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0707AC061764 for ; Tue, 30 Mar 2021 01:54:34 -0700 (PDT) Received: by mail-lj1-x231.google.com with SMTP id o16so4980023ljp.3 for ; Tue, 30 Mar 2021 01:54:33 -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=O+nWoIhda88CRufoRBshjxqM91Z/QYAbPeuTebH+AdA=; b=piJznGslXavbNLo0UigIy4MydA1w2Q+wQg2o+IArBwdMzR+WUapIgcxlmp6jAVP5lU 4nXL3DeRqMCU/3+To+TUMIj9bOF+Qa0aFWGAeyf7q0gC+Kszjy1EBLsEtuw1sDaRQML/ Bp2KPW2GSmMKU3iRgcnyAheH9q8HbQXLu5JlTGRUUsjIsAa1Jf92a1NZuYCVRj8gM9R+ cWY+l4xp4RZC1INBmHTeGj3B6BpqOEEsPv2riRo8goUGANWGQGsEqqljJAmKrJmEg1px KG8egKWfoZQKgkWSBYGktsCyPjq3fXhcuSCICAMA+6mi6V4PWPN61RPcMxZCjZEjK0U2 9N9g== 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=O+nWoIhda88CRufoRBshjxqM91Z/QYAbPeuTebH+AdA=; b=rFYmWx5GZPO/BYAV9dP3y69lC8/ypBGu1AUH8H0nZJF3sgdKIdwc20QMLciSzSMoZc /CMZW6Z0/MiiblyZdjvcNFsez5gcg0tqf+Ri6/CDFmt1R4DwtWCA1so388hACBPEiHWw aO9WI/RGBQxIYSuBXi3HotKp6xt9sxhwGdHjPJd4MEvwFJcudWUUYSYgOocWr3TN+PBy AAvKpPSu2UeWHrFTEvAkqEWWcfahfOEQKeEQqxYJgaNMvjfaSEcrq9CBa7tZKnk4vj5E 4K+k4nVvBXw6BUPx/xS+6JhtAkqm6/Igixzn+hWjdSE+gWiHOJQ0MrMB/qFm/RHLtu32 mx2A== X-Gm-Message-State: AOAM533ay0iUGWVI1yatAM5cYj7UowcApt9xkd4e0dU+jFzprjDDw97D tM5/5fFv+0Sk6fTdjydyYBFaHg== X-Google-Smtp-Source: ABdhPJwmeYCwNd/Fd+PfliNS6cHeLOqSUhJTvBKHrJ2YGLSrde5ldpdl1Zba3iqIMKbHfn3Av8ROow== X-Received: by 2002:a2e:2e19:: with SMTP id u25mr21184133lju.487.1617094472533; Tue, 30 Mar 2021 01:54:32 -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.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Mar 2021 01:54:32 -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 4/7] Input: cyttsp - Reduce reset pulse timings Date: Tue, 30 Mar 2021 10:54:21 +0200 Message-Id: <20210330085424.2244653-5-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 data sheet for CY8CTMA340 specifies that the reset pulse shall be at least 1 ms. Specify 1-2 ms with usleep_range() to cut some slack for the scheduler. Curiously the datasheet does not specify how long we have to wait after a hard reset until the chip is up, but I have found a vendor tree (Samsung GT-S7710) that has code for this touch screen and there this is set to 5 ms so I use this with the same 1 ms fuzz. Signed-off-by: Linus Walleij Reviewed-by: Javier Martinez Canillas --- drivers/input/touchscreen/cyttsp_core.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/cyttsp_core.c b/drivers/input/touchscreen/cyttsp_core.c index 91f8f38b3f06..84f4f1c1a220 100644 --- a/drivers/input/touchscreen/cyttsp_core.c +++ b/drivers/input/touchscreen/cyttsp_core.c @@ -230,10 +230,16 @@ static int cyttsp_set_sysinfo_regs(struct cyttsp *ts) static void cyttsp_hard_reset(struct cyttsp *ts) { if (ts->reset_gpio) { + /* + * According to the CY8CTMA340 datasheet page 21, the external + * reset pulse width should be >= 1 ms. The datasheet does not + * specify how long we have to wait after reset but a vendor + * tree specifies 5 ms here. + */ gpiod_set_value_cansleep(ts->reset_gpio, 1); - msleep(CY_DELAY_DFLT); + usleep_range(1000, 2000); gpiod_set_value_cansleep(ts->reset_gpio, 0); - msleep(CY_DELAY_DFLT); + usleep_range(5000, 6000); } } From patchwork Tue Mar 30 08:54:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 12172049 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96E8EC433E1 for ; Tue, 30 Mar 2021 08:55:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 541A26195C for ; Tue, 30 Mar 2021 08:55:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231124AbhC3Iyu (ORCPT ); Tue, 30 Mar 2021 04:54:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231194AbhC3Iyg (ORCPT ); Tue, 30 Mar 2021 04:54:36 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93374C061764 for ; Tue, 30 Mar 2021 01:54:35 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id b4so22621652lfi.6 for ; Tue, 30 Mar 2021 01:54:35 -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=zjK96CKPYhWJsRojqqw/3kO0UdS2THfbIH/lD9qwZRI=; b=y3UM4XVZ+jolBdJ/j2UQym3ri6kZusUPIXy9i/t2h7HkTqDKc8B0EH6ho6JZFnNqdY 2anbTQKIuOfI+OokvQEwlK1M561LxC3ZY5Q138ixoagINf27ZM1p4hk/GKCsVafEPrA/ snqKm8xpDjN5Levl/VI6UIZpH1JwmufJfBp8ZQ8beTP0plHsT+lB/CDusgwYMR596sOa BDYmfPmsWv6khM1A1Q98QpQ9xR6P1d6ZtXdYnR5ymNxocqlUOgLD1BFh4WM9HEf64k19 whEZdFQ4aoQ1J5ueZ/onoAH8XtuGNkbfbJVos0ufAa+/SNge2TijYNMwW/5ros+tOfE/ uB2g== 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=zjK96CKPYhWJsRojqqw/3kO0UdS2THfbIH/lD9qwZRI=; b=ZqemHoZQa6IIGG/CYi13zKjFYvikZE12r7aB8kL62lWfPuW+MnhieotGpzkpAYqjbz VgEFueHrORWTamndIDK3PmtDi+qqVTght8ljIMFpt2N572zxNSMcYdrs6rwUcup4f2Vn Y5H1BCXkQFYS4J4+AtAoOPgjBL1rGZTMzkOGZgjw0WYTFQsuQm+dfwbQ+6CKl3oEMQ8z +xubSgsAa4bBMgxAnCEba5kY+N1MVVTrmhBYNFdFKVcl+jKk939ax9W3eXYZM7FDALdh 8GizUrLq96XrdGXyYpT8oLVYe/15gZdqSWfsDvJRAgufxZ7pUCp7ocy19bryva03FFQF 0WdQ== X-Gm-Message-State: AOAM531Q+yLqD+dytuJtm7PebDxiOJiJQJPtGUxX1iY7Tx+hKvYLexIN 0NtqsLgH6xXhBqvNmIEK0qvJbA== X-Google-Smtp-Source: ABdhPJwn7SaguG9aC/k122h2si0lUK9dsQowlHLj1hPRA4VWzKxMUseXKlu2rkXzzYyP6VdxwdH4Qw== X-Received: by 2002:a19:7412:: with SMTP id v18mr18359157lfe.234.1617094474159; Tue, 30 Mar 2021 01:54:34 -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.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Mar 2021 01:54:33 -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 5/7] Input: cyttsp - Drop the phys path Date: Tue, 30 Mar 2021 10:54:22 +0200 Message-Id: <20210330085424.2244653-6-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 When I test to use the CY8CTMA340 with PostmarketOS I don't have any problem whatsoever in dropping this phys path, it finds and uses the touchscreen just as well. I suppose it is because userspace is using modern input libraries. I challenge the maintainers to point out a valid and still used userspace that actually need this. I say we drop it. Signed-off-by: Linus Walleij Reviewed-by: Javier Martinez Canillas --- drivers/input/touchscreen/cyttsp_core.c | 2 -- drivers/input/touchscreen/cyttsp_core.h | 1 - 2 files changed, 3 deletions(-) diff --git a/drivers/input/touchscreen/cyttsp_core.c b/drivers/input/touchscreen/cyttsp_core.c index 84f4f1c1a220..8ae9f00e5e31 100644 --- a/drivers/input/touchscreen/cyttsp_core.c +++ b/drivers/input/touchscreen/cyttsp_core.c @@ -655,10 +655,8 @@ struct cyttsp *cyttsp_probe(const struct cyttsp_bus_ops *bus_ops, return ERR_PTR(error); init_completion(&ts->bl_ready); - snprintf(ts->phys, sizeof(ts->phys), "%s/input0", dev_name(dev)); input_dev->name = "Cypress TTSP TouchScreen"; - input_dev->phys = ts->phys; input_dev->id.bustype = bus_ops->bustype; input_dev->dev.parent = ts->dev; diff --git a/drivers/input/touchscreen/cyttsp_core.h b/drivers/input/touchscreen/cyttsp_core.h index c102a094e888..8eba9d8ba74a 100644 --- a/drivers/input/touchscreen/cyttsp_core.h +++ b/drivers/input/touchscreen/cyttsp_core.h @@ -115,7 +115,6 @@ struct cyttsp { struct device *dev; int irq; struct input_dev *input; - char phys[32]; const struct cyttsp_bus_ops *bus_ops; struct cyttsp_bootloader_data bl_data; struct cyttsp_sysinfo_data sysinfo_data; From patchwork Tue Mar 30 08:54:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 12172055 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A429C433E3 for ; Tue, 30 Mar 2021 08:55:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D7E556195D for ; Tue, 30 Mar 2021 08:55:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231154AbhC3Iyv (ORCPT ); Tue, 30 Mar 2021 04:54:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231269AbhC3Iyh (ORCPT ); Tue, 30 Mar 2021 04:54:37 -0400 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F18F8C061764 for ; Tue, 30 Mar 2021 01:54:36 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id a1so19041215ljp.2 for ; Tue, 30 Mar 2021 01:54:36 -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=WeDMmUHMqTW6OH9fZV+W9CUsFCKVXgQjWfbISHyWnmo=; b=qQ4m2s7ext90HzptdeeG/jREjBptW9hyrZcFLN4TBNbeizr2atRcTioxUnH++RKGcR 3haHGYFTVYD1yvPZWOlcnHBJlt/MBl0t5g3uveI5bS+BS6yTtvMATJqz+J7Ye12xKw2p 1qY8I9vsQ/9WN7e21UASG4kojxtFtWcLascetWPEa2TA3EIIIiC3y7WJTQggoXKZaj5T FVZ5kTAvLup5rTe0NDSQXwcsCzwWuggjug3HQOHhqSwyKqZROpDELVnnYRVStynOw7cd fqazuBzXppiFNZjCjTFLOgkUc+oMcPMov884h/f9FSySsmuir/SiNpivoJgaWYVgbqQC 2F4A== 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=WeDMmUHMqTW6OH9fZV+W9CUsFCKVXgQjWfbISHyWnmo=; b=CBJgIglL4FUpVRcuDqerkuuKJ34KTWakc3cNcVduoMl3noRQarTIG7VJ3RvRIOc18P cBCqdvEOp3fcZw1Bt+z35Lpm00iq/bbBE6Ig0lp1Y+3ML5XHn2euPjpS5xkbu9wTQ/lx 2Qvc2DWvrDWyqGLufwCOFdHEoZUbgqufxAqbxkvvgMKnoJKeHnpeQ2dMDfklvJnB8VRA pSTJsYSN0ZQ0iF8qTkVegsb1+4VzlZFvfT1yVPUcQhaWCnzNa2AerVdxa/M8FEE8y41C w9xIcRgvd1YpvuYQ7Mx/Gf+1ekZxT01KItfjVlWKaWXf9RdipCc2vZj8R18CPqcCCy36 r/Gw== X-Gm-Message-State: AOAM533iz+3d1bKrKztuCHWB7vy9LQ263YjecaF6JKGgH3IpFSeA1yQ3 GEaSp8kVvcWFdNeOLAKR+aeRdQ== X-Google-Smtp-Source: ABdhPJxHAkR7LbIwYmmYmFHKP/J5wK3XOC5M2Z+k1wnWyQBkOU34Uaqp6ZLaQrIL6ya7ECfAZ61aPg== X-Received: by 2002:a2e:a177:: with SMTP id u23mr20494915ljl.286.1617094475521; Tue, 30 Mar 2021 01:54:35 -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.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Mar 2021 01:54:35 -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 6/7] Input: cyttsp - Set abs params for ABS_MT_TOUCH_MAJOR Date: Tue, 30 Mar 2021 10:54:23 +0200 Message-Id: <20210330085424.2244653-7-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 is certainly reporting pressure in cyttsp_report_tchdata() with input_report_abs(input, ABS_MT_TOUCH_MAJOR, tch->z); so we should also advertise this capability. Signed-off-by: Linus Walleij Reviewed-by: Javier Martinez Canillas --- drivers/input/touchscreen/cyttsp_core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/input/touchscreen/cyttsp_core.c b/drivers/input/touchscreen/cyttsp_core.c index 8ae9f00e5e31..ac412bcb15d8 100644 --- a/drivers/input/touchscreen/cyttsp_core.c +++ b/drivers/input/touchscreen/cyttsp_core.c @@ -667,6 +667,9 @@ struct cyttsp *cyttsp_probe(const struct cyttsp_bus_ops *bus_ops, input_set_capability(input_dev, EV_ABS, ABS_MT_POSITION_X); input_set_capability(input_dev, EV_ABS, ABS_MT_POSITION_Y); + /* One byte for width 0..255 so this is the limit */ + input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, 0, 255, 0, 0); + touchscreen_parse_properties(input_dev, true, NULL); error = input_mt_init_slots(input_dev, CY_MAX_ID, 0); From patchwork Tue Mar 30 08:54:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 12172051 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E941EC433E5 for ; Tue, 30 Mar 2021 08:55:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BAAB46195C for ; Tue, 30 Mar 2021 08:55:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231194AbhC3Iyv (ORCPT ); Tue, 30 Mar 2021 04:54:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231310AbhC3Iyi (ORCPT ); Tue, 30 Mar 2021 04:54:38 -0400 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56E65C061764 for ; Tue, 30 Mar 2021 01:54:38 -0700 (PDT) Received: by mail-lj1-x229.google.com with SMTP id s17so19024894ljc.5 for ; Tue, 30 Mar 2021 01:54:38 -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=UfaoV/sNb42ikH43Koy/D/irGAW84Qvp9X/UlbMwEzk=; b=k32sLOjiJYsWxfXX9S+t/N5vmo6WuHtFecVAec02o04ogYTmrhDbf49bzsuQmTcarm k1AzPPp4N2U9XcEGtTrriIUaPI6fs8t8aYOVdmhh5M5f5SxVuRx/sp5uoJ0PyW1AVtyC pPedra8xXAQW9smWbiy4HqQMxs7FfMBq3LJdhSi/eRIPz4+7iFPU+vN/bIlUt4CD84q+ M9D27r375cxfmS5yrLiLPpt4ThCv0wejNxLobKsI+50W6dqXFD0GDO4nSPyEf8MdpInt X+D79lXpVr3qJAfD0/ysNE18sAvgjEr21FRKPjJCNkv5vntN71KtpvX3TPSTTmmPqPFb EiTA== 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=UfaoV/sNb42ikH43Koy/D/irGAW84Qvp9X/UlbMwEzk=; b=ZMofqDZywWhOKSDeQqal6nKp5pQXKpcZJMp4CWc8gc7YF9AJG1kwaWXz7iMgJQYbTm 9mVTQsovxSrle7stJlokUWwlPc6RBqSc1nNQs9W6veZQ/fYVaPKbDN4WL8u6pV7H5DFB 36xz8ADAlxxcZXOFm0mHLPPzxOhMkCZnqmaJ8cBoHf3hdSsBinxsxevqBTN519fGMTVP PMTDlqJo6JkrqmKXn2zsUXHbJC7BbW4L9UQl2fo+pB0rzEB3a6R6O0OyO3F/CXC0qzla nj8yE0S0ZMxQB0r+hq7s84p9c7ojvosA9unJjGL6DV6bgxkMGQULIbCv1k3erTasVlcx kR/w== X-Gm-Message-State: AOAM531EgdQz75nR6ExS27HnwGfsX86XxqsmKibPU14ygoPTumRs/URh 2s6h3fekYJU1O3Wd5dJxWJaBCw== X-Google-Smtp-Source: ABdhPJxqwpf7ujkInmHkQZAME5T06FwK36cvAikR0qzwohiEXbf4vFgV7HFZxdZk95adqYqVhHdFFQ== X-Received: by 2002:a2e:9a96:: with SMTP id p22mr19652691lji.167.1617094476870; Tue, 30 Mar 2021 01:54:36 -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.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Mar 2021 01:54:36 -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 7/7] Input: cyttsp - Flag the device properly Date: Tue, 30 Mar 2021 10:54:24 +0200 Message-Id: <20210330085424.2244653-8-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 This device is certainly a very simple touchscreen so we set INPUT_MT_DIRECT. The sibling driver for CY8CTMA140 also sets INPUT_MT_DROP_UNUSED and experimenting with this driver it clearly does not hurt: the touchscreen is working just fine so let's set it for this one as well. Signed-off-by: Linus Walleij Reviewed-by: Javier Martinez Canillas --- drivers/input/touchscreen/cyttsp_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/cyttsp_core.c b/drivers/input/touchscreen/cyttsp_core.c index ac412bcb15d8..fb71cd0d2070 100644 --- a/drivers/input/touchscreen/cyttsp_core.c +++ b/drivers/input/touchscreen/cyttsp_core.c @@ -672,7 +672,8 @@ struct cyttsp *cyttsp_probe(const struct cyttsp_bus_ops *bus_ops, touchscreen_parse_properties(input_dev, true, NULL); - error = input_mt_init_slots(input_dev, CY_MAX_ID, 0); + error = input_mt_init_slots(input_dev, CY_MAX_ID, + INPUT_MT_DIRECT | INPUT_MT_DROP_UNUSED); if (error) { dev_err(dev, "Unable to init MT slots.\n"); return ERR_PTR(error);