From patchwork Thu Apr 8 13:11:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 417438 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp560690jai; Thu, 8 Apr 2021 06:12:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxD1C7ZHPWr1017FkwTnDKYQ3BEAO6m2bW5l28YGtEoX+1vjWuC/HoknFazt30FEz89hhWu X-Received: by 2002:a05:6402:57:: with SMTP id f23mr11101906edu.323.1617887541746; Thu, 08 Apr 2021 06:12:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617887541; cv=none; d=google.com; s=arc-20160816; b=K090wPPRzn3I8mQwZI/2aBBkqu0uhduxEYplMuwIzwl50MfNxYIH8CLc1fqDr3rXMc xb7SPhd0ohw+xX0gbMRTuTtqhXZPfojG0dzyv9YzxxyjKUk3ig1wYKZbA+/zHih/nXrb 5l8LsbkyYrX43s/3s63U1jpjCL6lfcfbcq6L7wxtipufu3NOZT+dR4VN7JHYWbLDIefu SXVeOJ8TvD5NgvdyQN3nC1VKfBHPT0ZlgDO02Qdrh9C07xzBrLDLDbEHSdjdjVy0knW1 WUpaLCD/ZGKrz694iOqwRezZkWFkWlrHaPj4x660Ixhjh181/2XZw2sz9iDTl2m6BUIX 7tjA== 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=Mg1rnmzYlGS0W73zSpiFdEvCZx/ufEx400E1vd3zKK4=; b=jmRcZNZwwMKiA38gSiTI7mlOn5cGn6toRxAkVfTMU3G/zn4ouH3ijU31KgkrWwjDm7 m8BXMUM+6K3Yd87v/rleadG5DDbWTmKdH4uvBCsYwSBfHayeo3yMU7Vga6yMPYMZp86i HxmFZ3bb2JUFnQ0K8Ra/TOUUkK5gnD0UlFWup/h4mFNglwNWpqh0VOabXzgJOCwN9GF6 n2xZeQWhCHnWw06osoJRr/Zhq1BgcUiBzQnSaf3zHMbhXTQr0OMBZzGJjz1/kMcMTDgd yPXLBKCFAIosZVXIy6tCYFWf4dCB+awoAK1cYGQTJLX/F76oAspWCQRniQAX6S1Zd4eQ +HGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oTCHNhCR; 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.21; Thu, 08 Apr 2021 06:12:21 -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=oTCHNhCR; 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 S231370AbhDHNMb (ORCPT + 1 other); Thu, 8 Apr 2021 09:12:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229741AbhDHNMa (ORCPT ); Thu, 8 Apr 2021 09:12:30 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C59B4C061761 for ; Thu, 8 Apr 2021 06:12:18 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id j18so3945796lfg.5 for ; Thu, 08 Apr 2021 06:12:18 -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=Mg1rnmzYlGS0W73zSpiFdEvCZx/ufEx400E1vd3zKK4=; b=oTCHNhCRwwzS55aMYQxja6D+CShYifEG+L+pSHzGe3fyVw8Pk/iifaUNfwcG6Sk2ds 3cQSKIFIqFM2Afua8eJWBGqOUCx4XO9ouF1M64XFDjBt6jPq+iLu3SgtGV5SiYRLPjTL 0PqoeBO9GsBUxl9vj1b+/KhzWwahcgfu82XXxV5Pz7FaDTTYwSH59LUiR9DswiTUfPoL /HM9tJskbLHyD4VVFxkKA/ZPN0Ho/k+hwbaUEgvOiuBm3M3MWFHBgWtMJnR0PPaeOIpj wca/TkmpCDIeevD95XTWr/cFPVWs1+bhthDfYseK2T2f3pePoJllpI6TJgFpFY5ACG2X 8nVg== 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=Mg1rnmzYlGS0W73zSpiFdEvCZx/ufEx400E1vd3zKK4=; b=AUPrQiNXMBe8qtidpl3k9WyAD4Z6KpSOqKMU8hrO2iTjnMBgpfN3IpWfqfEycd0gkr TgyMLOtAewwKqghhBfMP9gSbrZ8+ewkPOYnSyDRReKrFhUa+60H4/D29W48VdYiBYkc8 zDgtcoCjykkESdhNiz2/l+HByS/19rd7quWAahRA3g63QUux0SA6sCexzT0FeOzsGB1+ uS1Usyzhdk3ZlUbU4RIW+bYYp6cJ/V39m6MyWCodHPprqbXWiZQ8CfqNOd6DePf/ICmX WYo8k/7NAwsUxF7WL2J34w5D9qhmV+0UnQY7DJQBHfsscyGa4AyKXuAtnpsqH7eYYHUq QiEg== X-Gm-Message-State: AOAM532z6gi6RfHAfChrne+h9Y83W78+ml8nWapXFAczkeBeLWS5UFwY aQArNQ6PhvxHfKmgD954IArqklD8flW1nILi X-Received: by 2002:a19:700d:: with SMTP id h13mr6278116lfc.17.1617887537081; Thu, 08 Apr 2021 06:12:17 -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.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Apr 2021 06:12:11 -0700 (PDT) From: Linus Walleij To: Ferruh Yigit , Dmitry Torokhov , Javier Martinez Canillas Cc: Henrik Rydberg , linux-input@vger.kernel.org, Linus Walleij , devicetree@vger.kernel.org, Rob Herring Subject: [PATCH 1/8 v3] Input: cyttsp - Convert bindings to YAML and extend Date: Thu, 8 Apr 2021 15:11:46 +0200 Message-Id: <20210408131153.3446138-2-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 This converts the CYTTSP "Cypress TrueTouch Standard Product" to YAML bindings and fixes and adds some things in the process: - Rename the bindings file to cypress,cy8ctma340 after the main product in the series. - Add proper compatibles for the two known products: CY8CTMA340 and CY8CTST341. - Deprecate "cypress,cyttsp-spi" and "cypress,cyttsp-i2c" because device compatibles should be named after the hardware and not after which bus they are connected to. The topology implicitly tells us which bus it is and what interface to used. - Add VCPIN and VDD supplies, these are present just like on the CY8CTMA140. Cc: devicetree@vger.kernel.org Cc: Ferruh Yigit Reviewed-by: Rob Herring Reviewed-by: Javier Martinez Canillas Signed-off-by: Linus Walleij --- ChangeLog v2->v3: - Collect Robs and Javiers Review tags. - Use the right mail address for Javier. - Include in the patch series with the rest of the CYTTSP fixes. ChangeLog v1->v2: - Use minItems and maxItems directly without -items - Drop u32 type from all properties ending with "-ms" that thus have implicit types. - Add maintiner to Cc. Patch to add the new compatibles to the Linux driver is sent separately. --- .../input/touchscreen/cypress,cy8ctma340.yaml | 149 ++++++++++++++++++ .../bindings/input/touchscreen/cyttsp.txt | 93 ----------- 2 files changed, 149 insertions(+), 93 deletions(-) create mode 100644 Documentation/devicetree/bindings/input/touchscreen/cypress,cy8ctma340.yaml delete mode 100644 Documentation/devicetree/bindings/input/touchscreen/cyttsp.txt -- 2.29.2 diff --git a/Documentation/devicetree/bindings/input/touchscreen/cypress,cy8ctma340.yaml b/Documentation/devicetree/bindings/input/touchscreen/cypress,cy8ctma340.yaml new file mode 100644 index 000000000000..29eb0b7ebe6a --- /dev/null +++ b/Documentation/devicetree/bindings/input/touchscreen/cypress,cy8ctma340.yaml @@ -0,0 +1,149 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/input/touchscreen/cypress,cy8ctma340.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Cypress CY8CTMA340 series touchscreen controller bindings + +description: The Cypress CY8CTMA340 series (also known as "CYTTSP" after + the marketing name Cypress TrueTouch Standard Product) touchscreens can + be connected to either I2C or SPI buses. + +maintainers: + - Javier Martinez Canillas + - Linus Walleij + +allOf: + - $ref: touchscreen.yaml# + +properties: + $nodename: + pattern: "^touchscreen(@.*)?$" + + compatible: + oneOf: + - const: cypress,cy8ctma340 + - const: cypress,cy8ctst341 + - const: cypress,cyttsp-spi + description: Legacy compatible for SPI connected CY8CTMA340 + deprecated: true + - const: cypress,cyttsp-i2c + description: Legacy compatible for I2C connected CY8CTMA340 + deprecated: true + + reg: + description: I2C address when used on the I2C bus, or the SPI chip + select index when used on the SPI bus + + clock-frequency: + description: I2C client clock frequency, defined for host when using + the device on the I2C bus + minimum: 0 + maximum: 400000 + + spi-max-frequency: + description: SPI clock frequency, defined for host, defined when using + the device on the SPI bus. The throughput is maximum 2 Mbps so the + typical value is 2000000, if higher rates are used the total throughput + needs to be restricted to 2 Mbps. + minimum: 0 + maximum: 6000000 + + interrupts: + description: Interrupt to host, must be flagged as + IRQ_TYPE_EDGE_FALLING. + maxItems: 1 + + vcpin-supply: + description: Analog power supply regulator on VCPIN pin + + vdd-supply: + description: Digital power supply regulator on VDD pin + + reset-gpios: + description: Reset line for the touchscreen, should be tagged + as GPIO_ACTIVE_LOW + + bootloader-key: + description: the 8-byte bootloader key that is required to switch + the chip from bootloader mode (default mode) to application mode + $ref: /schemas/types.yaml#/definitions/uint8-array + minItems: 8 + maxItems: 8 + + touchscreen-size-x: true + touchscreen-size-y: true + touchscreen-fuzz-x: true + touchscreen-fuzz-y: true + + active-distance: + description: the distance in pixels beyond which a touch must move + before movement is detected and reported by the device + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 0 + maximum: 15 + + active-interval-ms: + description: the minimum period in ms between consecutive + scanning/processing cycles when the chip is in active mode + minimum: 0 + maximum: 255 + + lowpower-interval-ms: + description: the minimum period in ms between consecutive + scanning/processing cycles when the chip is in low-power mode + minimum: 0 + maximum: 2550 + + touch-timeout-ms: + description: minimum time in ms spent in the active power state while no + touches are detected before entering low-power mode + minimum: 0 + maximum: 2550 + + use-handshake: + description: enable register-based handshake (boolean). This should only + be used if the chip is configured to use 'blocking communication with + timeout' (in this case the device generates an interrupt at the end of + every scanning/processing cycle) + $ref: /schemas/types.yaml#/definitions/flag + +additionalProperties: false + +required: + - compatible + - reg + - interrupts + - bootloader-key + - touchscreen-size-x + - touchscreen-size-y + +examples: + - | + #include + #include + spi { + #address-cells = <1>; + #size-cells = <0>; + num-cs = <1>; + cs-gpios = <&gpio 2 GPIO_ACTIVE_HIGH>; + + touchscreen@0 { + compatible = "cypress,cy8ctma340"; + reg = <0>; + interrupt-parent = <&gpio>; + interrupts = <20 IRQ_TYPE_EDGE_FALLING>; + reset-gpios = <&gpio 21 GPIO_ACTIVE_LOW>; + vdd-supply = <&ldo_aux1_reg>; + vcpin-supply = <&ldo_aux2_reg>; + bootloader-key = /bits/ 8 <0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07>; + touchscreen-size-x = <480>; + touchscreen-size-y = <800>; + active-interval-ms = <0>; + touch-timeout-ms = <255>; + lowpower-interval-ms = <10>; + }; + }; + +... diff --git a/Documentation/devicetree/bindings/input/touchscreen/cyttsp.txt b/Documentation/devicetree/bindings/input/touchscreen/cyttsp.txt deleted file mode 100644 index 6ee274aa8b03..000000000000 --- a/Documentation/devicetree/bindings/input/touchscreen/cyttsp.txt +++ /dev/null @@ -1,93 +0,0 @@ -* Cypress cyttsp touchscreen controller - -Required properties: - - compatible : must be "cypress,cyttsp-i2c" or "cypress,cyttsp-spi" - - reg : Device I2C address or SPI chip select number - - spi-max-frequency : Maximum SPI clocking speed of the device (for cyttsp-spi) - - interrupts : (gpio) interrupt to which the chip is connected - (see interrupt binding[0]). - - bootloader-key : the 8-byte bootloader key that is required to switch - the chip from bootloader mode (default mode) to - application mode. - This property has to be specified as an array of 8 - '/bits/ 8' values. - -Optional properties: - - reset-gpios : the reset gpio the chip is connected to - (see GPIO binding[1] for more details). - - touchscreen-size-x : horizontal resolution of touchscreen (in pixels) - - touchscreen-size-y : vertical resolution of touchscreen (in pixels) - - touchscreen-fuzz-x : horizontal noise value of the absolute input device - (in pixels) - - touchscreen-fuzz-y : vertical noise value of the absolute input device - (in pixels) - - active-distance : the distance in pixels beyond which a touch must move - before movement is detected and reported by the device. - Valid values: 0-15. - - active-interval-ms : the minimum period in ms between consecutive - scanning/processing cycles when the chip is in active mode. - Valid values: 0-255. - - lowpower-interval-ms : the minimum period in ms between consecutive - scanning/processing cycles when the chip is in low-power mode. - Valid values: 0-2550 - - touch-timeout-ms : minimum time in ms spent in the active power state while no - touches are detected before entering low-power mode. - Valid values: 0-2550 - - use-handshake : enable register-based handshake (boolean). This should - only be used if the chip is configured to use 'blocking - communication with timeout' (in this case the device - generates an interrupt at the end of every - scanning/processing cycle). - -[0]: Documentation/devicetree/bindings/interrupt-controller/interrupts.txt -[1]: Documentation/devicetree/bindings/gpio/gpio.txt - -Example: - &i2c1 { - /* ... */ - cyttsp@a { - compatible = "cypress,cyttsp-i2c"; - reg = <0xa>; - interrupt-parent = <&gpio0>; - interrupts = <28 0>; - reset-gpios = <&gpio3 4 GPIO_ACTIVE_LOW>; - - touchscreen-size-x = <800>; - touchscreen-size-y = <480>; - touchscreen-fuzz-x = <4>; - touchscreen-fuzz-y = <7>; - - bootloader-key = /bits/ 8 <0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08>; - active-distance = <8>; - active-interval-ms = <0>; - lowpower-interval-ms = <200>; - touch-timeout-ms = <100>; - }; - - /* ... */ - }; - - &mcspi1 { - /* ... */ - cyttsp@0 { - compatible = "cypress,cyttsp-spi"; - spi-max-frequency = <6000000>; - reg = <0>; - interrupt-parent = <&gpio0>; - interrupts = <28 0>; - reset-gpios = <&gpio3 4 GPIO_ACTIVE_LOW>; - - touchscreen-size-x = <800>; - touchscreen-size-y = <480>; - touchscreen-fuzz-x = <4>; - touchscreen-fuzz-y = <7>; - - bootloader-key = /bits/ 8 <0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08>; - active-distance = <8>; - active-interval-ms = <0>; - lowpower-interval-ms = <200>; - touch-timeout-ms = <100>; - }; - - /* ... */ - }; 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, }; From patchwork Thu Apr 8 13:11:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 417440 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp560762jai; Thu, 8 Apr 2021 06:12:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFtapHcnpnRP7fjlr/I7PZ/MQxbBbwRvtJit6aQ2o6eTRasYcKpcVMy2k0tBNsoYWYdSlj X-Received: by 2002:aa7:c888:: with SMTP id p8mr2910068eds.339.1617887545937; Thu, 08 Apr 2021 06:12:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617887545; cv=none; d=google.com; s=arc-20160816; b=hnG5JV54pYS/bjuqPLPPxwHumRNWK2y/GpchTCogbj5k6aVH7fEBCfY9XDLVU9cJUx xFh+QNAGVBjNTAwgrEvzyhQA8xadW8pFF+2SCo2W06HooZ39VrIlJ/tWD/uTh5FACOAB fmWkd9onkpG7cGkpP0ZAp2g+1q/H/hJsqQnPVkZ+s6qPwQwbuV3J/pFtnI+yA0WZFOkM 7MmPYJhdJvBp2PJoTlhgFBmvscyq4Xq2l1qB+D6d9F9Qkgi8d/1s+xl6pNgikfL7+pOd wy5upWhbUW/zohJ05PJMf0x/kAVkUroyv2fDVEh/9yMXdF68OyrvWlT+TZh7Qkga7oMS 5OQw== 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=RVS/LU7jqjcdXf4E5Cbtx0sONNBFIluxdVbfhRy1+Lk=; b=bXHpwnQVUoB52lhItJrRjfCKFiqdKj8Sx9y4hQ+ylItNlqNwkc469+1xn3TiyELRVb jpZir/V2c+4fr6fsKCeFCBUQbS9MZlyAMgKYkiAMzZi5qJ4eNRELUcR9AOjAV+mYjxEM DCrCw+DBXHlwrOTug5N7FQVq78J4X2rVuUs+4IIy9bf3jHrJcOjW1CZdA2L7TpN0tmjQ 0LLp27u7QDQNtBAgEG+ECsV5+U2hKat24jmhYhvvItD900VzHUU1kmnmYsyPJynMrGA0 NLv8yANyCzBjLLOqq+41yuRaXNw6JQ1eSFEAqRCXh7aJETZ1pIWoznlinZtdBGDjHPrD 9I/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jjZ+8Zay; 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.25; Thu, 08 Apr 2021 06:12:25 -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=jjZ+8Zay; 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 S231308AbhDHNMf (ORCPT + 1 other); Thu, 8 Apr 2021 09:12:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231255AbhDHNMe (ORCPT ); Thu, 8 Apr 2021 09:12:34 -0400 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D685C061760 for ; Thu, 8 Apr 2021 06:12:22 -0700 (PDT) Received: by mail-lj1-x22a.google.com with SMTP id s17so2196826ljc.5 for ; Thu, 08 Apr 2021 06:12:22 -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=RVS/LU7jqjcdXf4E5Cbtx0sONNBFIluxdVbfhRy1+Lk=; b=jjZ+8Zay6JXOc0ieQniwN+KRK114jxztN+s9xArVb/1/+V3X4orFicDBMg0e4mmQ7B lJV2U5dcEE5K0GKGRiyZtQ20hS1zImSewG7e3wQEsLOx+5YPH7Za0eY+cc3TLNpYu9V2 tZvGh2wmreLRZQ0pkSpy3UYb8ULIeGrfGY6XMkZobEbnS4Lf1GtnWfxDQyA3nwT2Rs+l uGplaiItKgfGtNvcc51A2aXYgLWdFonUsiAb1qdUgJ+L6aR0WkRjP5PaAXBjhFXVMReN HUioHKDEGKlRCXLyAEY9Z3oB/naEQtY6l3ina6ZnYGPOqcnz9Bvrk/kGPza/9NT+hBt9 s/Rg== 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=RVS/LU7jqjcdXf4E5Cbtx0sONNBFIluxdVbfhRy1+Lk=; b=eGRNuYu3rj3AxYuyWlw1FcjHECnj+gjJPrLtyQigjmrcHqJw+pi/vZ13EX/Y7HdGIC A3fOtvjxe/KEQJPM0cetHO3//xsimny00hMg3JsNLb8qltYfi85IReUBitxqNwngONWB u0vw/li2TmtVGqRaWf1G+wiXkAr9uNhqa7/4qKViuPdZOpKb3TV+Xbzo6ReJaLKnrH1O bQ5Ga4LI2lF3eIxMbxj0g6bGltfz4xFLS8I8gzk84W0aM0jayy6svvWvsW3IzCd0cr2m MV14ZnBrdOaFnsnjYfojchm0K5SvpQH1PEKEaXouIpBTVgA6XbAZYbALTT02eCuktDbb TOkQ== X-Gm-Message-State: AOAM5330+RBPsCqLd4KqVMw5WVTRQaGiT9h7rH+5mENTBhHmDOuz4x9S slXhAL2i0Uw/IkmbQS3/xmWZLk+4a9HxqzgV X-Received: by 2002:a2e:bba1:: with SMTP id y33mr2887671lje.345.1617887540797; Thu, 08 Apr 2021 06:12:20 -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.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Apr 2021 06:12:20 -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/8 v3] Input: cyttsp - Obtain regulators Date: Thu, 8 Apr 2021 15:11:48 +0200 Message-Id: <20210408131153.3446138-4-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 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. Reviewed-by: Javier Martinez Canillas Signed-off-by: Linus Walleij --- ChangeLog v1->v3: - Collect Javier's reviewed-by. --- drivers/input/touchscreen/cyttsp_core.c | 30 +++++++++++++++++++++++-- drivers/input/touchscreen/cyttsp_core.h | 2 ++ 2 files changed, 30 insertions(+), 2 deletions(-) -- 2.29.2 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 Thu Apr 8 13:11:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 417441 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp560780jai; Thu, 8 Apr 2021 06:12:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxF838TgJDSyRNPOmmRSNw8CucGW1sKyf6D6jCHmcKbxK4Ebfh/mEw0nwlo9LxNjY6muUHL X-Received: by 2002:a17:906:3950:: with SMTP id g16mr10360772eje.116.1617887546793; Thu, 08 Apr 2021 06:12:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617887546; cv=none; d=google.com; s=arc-20160816; b=QaM+5Pscn9plCVpFSqEFXCWyXKh4TXRGOgLaMT8I2+pZ1ivLkLP/jnU7fzLoarAdYv tH1Nneiq/xyqoMMrFIOudXPd5Y7GNLgID/yTXFtcBomEkqD3GMdj8gnU1Vn5av2G53XP RhZA2UCbCRmP+KpolltO9CJr5hHtfnfxOMSilnYe4StK+pmsnhZ8lpmupVNHAmP/aoti pWagOPnHMh1cgN8yHyfCe4TJuQM/hzy9Yz5OYqbOK/gozM9hCLWrp26KOxB1+IDtUQDo 0fvfzBVC3G7vWJ4pOVBpD8MGFa73Nx3Mbg2vwbv9ntr/iOQvDtnhaTVinMiXwgcst5x+ ETNw== 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=RTlZrDUTDthiwbBRPHwMeQoWFhgADwLFTg4elxJDyEI=; b=rhvDF/RildXU2tmmMpH8CP8VeOMlgBsgtzlx14synXP+ozscBLoFtRpKQuzYamPGdW DjwG2eBvkTBjPgrjoilFG65o8oW5yMd5rsmi2lOeRc5MIBetCgoiO3p/9mcT81avvciV 5WjudV5bHvdzmrnU1VXZiKifqmBzw68oilL1vXwLTr2mdM3P7JcSlyUiDboPHxXnDmoq r30t6OVhO4SmHEoEF6B1vl5pzfE+cX8QBZqFXO6dOEyUuKMwU7HD+OrnZpJsh/VFmrui nIz0XeodZE1NDLRlmezed7I1hcUZT7/GnQMdQSjeEKPFzFIRWHsOseWppYdnxqfn8fCm 7eWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M70TMGzd; 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.26; Thu, 08 Apr 2021 06:12:26 -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=M70TMGzd; 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 S231255AbhDHNMf (ORCPT + 1 other); Thu, 8 Apr 2021 09:12:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229741AbhDHNMf (ORCPT ); Thu, 8 Apr 2021 09:12:35 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7CFAC061761 for ; Thu, 8 Apr 2021 06:12:23 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id n8so3970109lfh.1 for ; Thu, 08 Apr 2021 06:12:23 -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=RTlZrDUTDthiwbBRPHwMeQoWFhgADwLFTg4elxJDyEI=; b=M70TMGzdwMSfj86n124ozsQJLfKY0IBqhmzk5aWZHGkTjaY/MGsgs56kwZ8BTJwvAw feZ6loEjOPH+HfPeSlwJO/AzxswYNrBobe65V+zarF1uzY1dnHd3BonThI5uXmnYcDk0 uHVBWBkv1RfS+d7NFDUtFpwxvAxa3ERmNE+KafJx2/lYx27fyjZjvRQ0PrCKC70Aw7Vt bF+Oi3tATLdpRKC1jI+v8KQKQfLejc2QBxDO3LNRS84G6xRgOpPzER7X2iwUHV1qVqJf uQPcmIcfOXhVhQngUfsViN+bLSns4GmEgCP6/fSB/5Rlq/hPe25kPlMVzkfhaDKJTWTk CZ1Q== 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=RTlZrDUTDthiwbBRPHwMeQoWFhgADwLFTg4elxJDyEI=; b=WKZ4tMRSP3RDyd1UC8avt+ZPlRiufQX0ue4ctzf+NLu60Kw0DVIbQv9gEPG15uHYF5 uS//dW9VDggxD4qU7Vwbz9T9VTQxH8g2VwRawVi0lGM0n8EjDWBEirvWp3999pK7pKRX Mklr2rVwvwU8qny4cdrEqUKvA00Rxqm/rwSS02i92oFml8FZxxnxPDdTrvv04SLNpy5B Mp7ojFNKY4fIiEk13EmbRsAta705pbznEpi7Z3Cbz/DcTCid74CZSJr6CxmLjhjVDCXt EO0gEBXjYduJGtmjg35AqczGd13S/6xkhh+Uu1k4lAQGvvqkHn69Iuo0L21mAeA7yY5M spOg== X-Gm-Message-State: AOAM533NOKe7IkneyRyYzo4gERo2J/kPas/zDFUj2WVgq8giL/qZZ0bv 79sBs0bZC5Y6m/XWrdNgT5FqPQ== X-Received: by 2002:a19:7dc3:: with SMTP id y186mr6487666lfc.242.1617887542360; Thu, 08 Apr 2021 06:12:22 -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.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Apr 2021 06:12:21 -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/8 v3] Input: cyttsp - Error message on boot mode exit error Date: Thu, 8 Apr 2021 15:11:49 +0200 Message-Id: <20210408131153.3446138-5-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 Provide a proper error message when attempting to exit boot loader mode and failing, which is something that happened to me. Reviewed-by: Javier Martinez Canillas Signed-off-by: Linus Walleij --- ChangeLog v1->v3: - Collect Javier's Reviewed-by --- drivers/input/touchscreen/cyttsp_core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.29.2 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 Thu Apr 8 13:11:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 417442 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp560831jai; Thu, 8 Apr 2021 06:12:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPkjKbvPepdkZYc7BzLygA5x5qmSDo/lZF6hh0Yamc3zS+k4DoNU7MzMxP4y9jC7hI+sK+ X-Received: by 2002:ac2:5eca:: with SMTP id d10mr3814027lfq.525.1617887549453; Thu, 08 Apr 2021 06:12:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617887549; cv=none; d=google.com; s=arc-20160816; b=WFMugSZWdzfBCRf4qeXXul7XuNQv6s9Ez2r4xwTdvqwXCpcEz7C1953JR7TUqRhK59 /eQPKwtBfwhE8XmTxajqSa8zNTIGg+g91UpeJZvLWHNDZcwu4apXLJZ5E3BdF7zWGOoG s/bZaClIMrG8rxIdUKNjIsFxI+KLTXgDrdpvAcrPn9YqA/g7mpURFqpOiNO/bWt5hmyf DxAbRzkRTEfCV9LNj6V/q6H5qtTdS8D1FTi3jQ16qrVua+MPGfDpeKPmkJ2D+SwgN/iN mGpOOyUFzwYsuPmbbuIIMZlQWf3hYFinVyNE0bD0OL91CjtDbCU7WKcnFnrJfnj+PJC0 gPIg== 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=n+BE/ls2y9st49pyD89waC8wDozI9Ea/Mpt87FhjcNo=; b=jfryvdKnSpMoL7+OcmAUCz9PlGRle5K81xin5eoeVorxhTr9JINeuVtSG6A7cfsCaX wbD2YZLXoSJnPNIrVXRyVibYoKYFBlK/MUeiYe53oqznMOpIoz2Q7VD/NOYiSGhelCK3 Sq8VIRKGK3+HnmYW4/baFf3UJjjCx98DpXBTzfWoMCK/mlegKdo21sMcmJJINqnjnIFv XB4+BrHtX9JdSLICbhPLTERCx4t7BaZPXsEKvxkcC5FRmlr19lR3LJlyLlN27FDjZFHN Peo8ZQQH9K0+zP0gV8cws8iSwGiGkzDPatTZCPFaMvQhluqsJ/5zSq0RnnSA0PNoBD2x pCng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kw3NapkT; 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.29; Thu, 08 Apr 2021 06:12:29 -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=kw3NapkT; 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 S231508AbhDHNMi (ORCPT + 1 other); Thu, 8 Apr 2021 09:12:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231474AbhDHNMh (ORCPT ); Thu, 8 Apr 2021 09:12:37 -0400 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83BFCC061761 for ; Thu, 8 Apr 2021 06:12:25 -0700 (PDT) Received: by mail-lj1-x22b.google.com with SMTP id z8so2168725ljm.12 for ; Thu, 08 Apr 2021 06:12:25 -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=n+BE/ls2y9st49pyD89waC8wDozI9Ea/Mpt87FhjcNo=; b=kw3NapkTQ27jXn9jWYbeeDpaIVzhbrfRKlcFIYK9shi/Zh1Q5vcXsp1M5LrZMMExJn 51ezyf91LZ10qeBNOjRwpaedDb+lPG0KIeOF9FWZHh/y8hnKsoagyRkIvVH0XeGdqUXG jMobSES+lg2Agzx7FigEA/YAlWAP6MgtiChwscmU8lZwizKPM27IY/Okc4Jsy3wrD08I Lov59tMkIemFasjnij2Gqey7fpNSOzNXNIrTeOrpyAxsmP/Cm4LxmBAUbyQUPAwzhXlt QE/upTeXhLQGHXUKuoPAUDtR+8qN3JDN3CLM3Q8A9Tcg2jtohI+QuXp7VOozhUwafHPj 2hCw== 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=n+BE/ls2y9st49pyD89waC8wDozI9Ea/Mpt87FhjcNo=; b=GsXllaGSZHJkHwhXmec0v1jweoGJ0IbzazFXOz9Qg3DHDPBLEYQ1ymzxoIiYwxLbDf fDE+pDe+1p9ANXHc495XXHZGGRE5vzVFiyK9GX3VEHrba5E9wejpzBlf6DNr2uF25+KX ZeKfSqpi9Q3lu2nCty5wDtcVuSV1h052qTiZwfs+5Cs2emRSNrF2sDXh2roVrQUnh3om ASPW8/9KclFzchUVilqpRPIxzYruTBFX23dRn1YWoxR9atzIxRkW7yWkhV5elfJrE8Ca KFs0whUZ32XOQKOVjkoLIQGVjk+8zjmxL2yF7OrB14gYv233fUSfKxfjGCAQtfH/MKAg dWjQ== X-Gm-Message-State: AOAM532iFNH4vy3Gpyvh7fwdx6Dn0K4Yyd9KaSMXhY4pK8BL4VcrlDAm gm2l3pCCYnCT+6JcI0z9bjZ3vQ== X-Received: by 2002:a05:651c:119b:: with SMTP id w27mr5593776ljo.237.1617887543685; Thu, 08 Apr 2021 06:12:23 -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.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Apr 2021 06:12:23 -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/8 v3] Input: cyttsp - Reduce reset pulse timings Date: Thu, 8 Apr 2021 15:11:50 +0200 Message-Id: <20210408131153.3446138-6-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 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. Reviewed-by: Javier Martinez Canillas Signed-off-by: Linus Walleij --- ChangeLog v1->v3: - Collect Javier's Reviewed-by --- drivers/input/touchscreen/cyttsp_core.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) -- 2.29.2 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 Thu Apr 8 13:11:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 417443 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp560935jai; Thu, 8 Apr 2021 06:12:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHktWgCmhqxXT2Nd0L5ce0VmuUG0O0YoD0BOMpOLZNnSyOuFgkV3jEt31TbrtXit0jCuDI X-Received: by 2002:a2e:96c3:: with SMTP id d3mr5870520ljj.284.1617887554494; Thu, 08 Apr 2021 06:12:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617887554; cv=none; d=google.com; s=arc-20160816; b=Fm4BNkJTHszkV58hvarjYF0RdNaVgWE9GSrzdurI9h5l62JK5giMntZIDsF0WTSNPB BCwktZiWxVcuB7rHmuO3G2W8vKdLBGGO8bBR9rWNl9h4+XyliccXrqaQ9UI7yO8STyxz 39ejEOIixfelcNFCemfDxUybMOJihEE3JGUsUymzGjH7XoPc8fZ+rjQR+Q+MEYubTAbn RiiplOfxO2h2qD3M6KGTxJTFpc71DAiq/stMIc94yVP+GWyJV0t7d8p6q5WXct0nT8dV jKHMLkRqVtX0CSDVzUE18X+bBkwcWelwhI/sXRh5HPcsP8Du1CoyhVqnEEe8QGTJfej6 rNxA== 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=gWnMMOyBwTpMyNgPfLl+lFBRxHprbgaokPK7N7UcYDg=; b=XZg9oSpbwQ5sOAsdJcNMuIKzSkjohbe8V8So5ribEvL84JRIzHek4PJG1BhFjzexga MMtmih0Ddn5hUUZ43xE4onyOmLbfKNgVN+pPnHnVBI0PH/R9afoEB4EtroSPiP2TXO9R T6QhsnxoiRwFmN0wyNbTMohk6zUm+7JsQOpIiuEer/HfmE7uIjwV+MiCzBjVtdqdD2Hr 5KEllOdx1lyu1jzMJEDfJe81oaOhWZw0BPy3YtiC5zmn4nrVPq8pBlh/QlphOPJHEP41 9/MG+zZW8ELTT/ye1QTRak83zKD9sOyFMUxch+GRRcu+GAaZ6EPomIYTimMrnMKwat/9 dN7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VZY4iqsx; 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.34; Thu, 08 Apr 2021 06:12:34 -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=VZY4iqsx; 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 S231295AbhDHNMl (ORCPT + 1 other); Thu, 8 Apr 2021 09:12:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229741AbhDHNMj (ORCPT ); Thu, 8 Apr 2021 09:12:39 -0400 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19184C061760 for ; Thu, 8 Apr 2021 06:12:28 -0700 (PDT) Received: by mail-lj1-x234.google.com with SMTP id r20so2204195ljk.4 for ; Thu, 08 Apr 2021 06:12:28 -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=gWnMMOyBwTpMyNgPfLl+lFBRxHprbgaokPK7N7UcYDg=; b=VZY4iqsxyv24QnKqvm0O7bzEesG1GFM8yHhOnP5g9JaQWJQUp9n1F8SaGukTh2jfYX APhljNM9obpYmmyGMhaV1m7+6UdCzNBzeAG8DjpiA1dSneMgN8A9jL3SvnJstMhWA6c6 eSazsC8Ion40BL+him4SaygJ9PajPhKwZFRSnR4Bmj/lXm5HH3l8b41wn136BEPNwpRn AbHDzuuQQ5p6UBKJ9dH0dNr1kz9bhMKy42Eg8lulMpU+7nSyfSHUJ44uWpZhz7ZDy6XW Ecpi7wkulub79bfirlFA4uX/pgYNXsVWqUAYoFxkB7wqh+q7OxzC6eMFauMsKi43FkOe mgCQ== 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=gWnMMOyBwTpMyNgPfLl+lFBRxHprbgaokPK7N7UcYDg=; b=pvmZxz8L45aS36V8vnnXjH5cMQmVTKg2yFjd+/kRfEUmbkFnUhF5+ZWFSQK4ukrxDV qHCARWXGsojiMrO5M9HWvyqg5FnGJfbLGq9uHJVZvSa7eMD7alahB36skxzYgGY6AiJo vZY2hPwup19f1sU7MtCANI84N9Q9CF/ORogcS6ihtIZxqCfTJmxdjYjlwVHQyM0VxQmH a+a5wp0v333uu8xM0zuCf4rFfIx7TWev0aEgkOeaShWtDHAvlef4Ycb2yVBrkGP//q4R OqRCG3o5zm4XeSc36/74b2ZV2DRNJZHEvaTUx+L+q/DZee5b8R90ZZjlKFe2JKOZ1yvT HuZQ== X-Gm-Message-State: AOAM530gZE1gczAxFrObN3LIOCP+Uxf6/dmE1D6x1nWbeYj76jup5tri 8m294f8Omb1+G5fphnigRLrAPRBEJfnXqgye X-Received: by 2002:a2e:8508:: with SMTP id j8mr5632482lji.270.1617887545448; Thu, 08 Apr 2021 06:12:25 -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.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Apr 2021 06:12:25 -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/8 v3] Input: cyttsp - Drop the phys path Date: Thu, 8 Apr 2021 15:11:51 +0200 Message-Id: <20210408131153.3446138-7-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 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. Reviewed-by: Javier Martinez Canillas Signed-off-by: Linus Walleij --- ChangeLog v1->v3: - Collect Javier's Reviewed-by --- drivers/input/touchscreen/cyttsp_core.c | 2 -- drivers/input/touchscreen/cyttsp_core.h | 1 - 2 files changed, 3 deletions(-) -- 2.29.2 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 Thu Apr 8 13:11:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 417444 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp560964jai; Thu, 8 Apr 2021 06:12:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx228RIzMk1ei0dc7jPaAv6XNLgoPHixgQn22Z28G9lVzh5qLUQFOQ8YUcc1AsAl3GW9meb X-Received: by 2002:aa7:c559:: with SMTP id s25mr11222160edr.171.1617887556389; Thu, 08 Apr 2021 06:12:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617887556; cv=none; d=google.com; s=arc-20160816; b=KnSLJ3Dm6TKSfCQUk5MFYxFhGl/tI9WriTilr/rr5RenFzguzwfTMRUkx+qAQcqp45 HkKnfiGRYo8BIOlIOoYvrGRoGI69hB+1uP54zGle/Zdgm0lvrR4tcUq4oDwGZ8GhSPlt CxUarmjq4yYZgjDUMJYYZBUnTrLQdZ1Q4HB5NQ8/qk7t8wOExYH5qL71CKleq2MscndR wN4EYMvVpArtE9gQ7wc6qyJyFVyerMl7XLuO0z30bmcwfZKMx5qUmBxorkDY1IkeR2PM /kP7LwI2lTfC9hJonyqN06dTVIczNgtJtaixCFb9yxWV4MXMmOtsW0xclEx0GhUdlc6v P55w== 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=olpPcQyA4i8jA1zfF3uYSdUT7/y4KQjokOlzlpJlQ1E=; b=g/VPPmj1OEsDZAqrq5ZoosUOhyB4MLa0C43wZxGZ8M25xz08EDv2n29x82UCq46pP3 dbOO+X1IIRG2xl68m8ulvew2Iq7Jv4sbH6rEDDz3SRxcP4YrgYmhH7ZKHrBfwiJ8xnkx mskHA6rbGimDNLrAkt7/uCGqaKD3WL9xdV1AtV3MR6jSh14+rQnz6bzZVlHw1WUKDldV hp2/9nt1CSLGKCKoTTvahLHzneBfLBC3jeWcz4/z35ET+9XVqwhnnon4RYtz4bf3ovTq +YGqpNrT6Kqi6k7qXpfrsJB0kA35D6rk/+8sZVET2NwrGlXJg4rRTaJ+ZQ5+yJ50R3mY VQ1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Wtopn/cK"; 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.36; Thu, 08 Apr 2021 06:12: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="Wtopn/cK"; 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 S229741AbhDHNMp (ORCPT + 1 other); Thu, 8 Apr 2021 09:12:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231446AbhDHNMo (ORCPT ); Thu, 8 Apr 2021 09:12:44 -0400 Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 086A3C061761 for ; Thu, 8 Apr 2021 06:12:30 -0700 (PDT) Received: by mail-lj1-x230.google.com with SMTP id a1so2221678ljp.2 for ; Thu, 08 Apr 2021 06:12: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=olpPcQyA4i8jA1zfF3uYSdUT7/y4KQjokOlzlpJlQ1E=; b=Wtopn/cK+KcqJHtS89Aycpg+eLf/64oQvLgxAg4cH0r+bGViDWUc4sJiII1JvB6HB6 Diyr2f5aVceZlzUq6MeFwc8VAizUwXaiEhSvFXqK5AnffEcd646JIs0PN0f1viJk7PRx yimRk+RbmX4QUyhmYl/QyfQWkTA9Xu2jcX4ZB+4gSblSHwqTxwshl9Ir6kpPfjHsmuyp l/BbhIorYdQ5wtOXnvr+gqUo4gy6fWk8ZoreT2Z51gaPQ/AlCTGHxr7igUpg4Uvg0d+W oWGsEU2llGPmKBiFwgzhKmlJ2bDaPXigAe/xbSICo4ztJgLifKtMjOdSfLG52N701KC/ IdHg== 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=olpPcQyA4i8jA1zfF3uYSdUT7/y4KQjokOlzlpJlQ1E=; b=B/Qx86HgZB5T4ThpsoavRODKkvoNvfGi/fa8lXx8pV7TaDOxg6a6wUNngzNyC7qyN+ S5WvZjq2HhX8/EIg/UOA0ZY6rrhppQbjV3FgE6Mqhs1kBorsjPHz9Lt+oQkMJb5ojVmX NNd5km2z6pUYewt3nLRDc+nBpirPJOko2EiO8OraiOy2BHrsNU2LoE2HeznmZ6WvI6nr fZbDpAbIJmhLFEmiW6X7mLM1nKMfk9NtDxNTk5ri/eQCXDEScfFyUn9H0+eT118Ejwbi Kk6qfbjTGJM86qj+2M1jztwZ7cSNcwkueRtg6ZpXVsRdtdaoi0+UDvcCQ9DG4W3q3iub Ipjw== X-Gm-Message-State: AOAM532iP/Xuazi+ljbjdKTm3AE+IC6U7f0DsgHy2PP98S8m5NV+eRuj KXHR+JwqVp+7BxFl6enFGaf3YQ== X-Received: by 2002:a2e:9098:: with SMTP id l24mr5745728ljg.150.1617887549040; Thu, 08 Apr 2021 06:12: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 z7sm126936ljm.102.2021.04.08.06.12.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Apr 2021 06:12:28 -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/8 v3] Input: cyttsp - Set abs params for ABS_MT_TOUCH_MAJOR Date: Thu, 8 Apr 2021 15:11:52 +0200 Message-Id: <20210408131153.3446138-8-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 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. Reviewed-by: Javier Martinez Canillas Signed-off-by: Linus Walleij --- ChangeLog v1->v3: - Collect Javier's Reviewed-by. --- drivers/input/touchscreen/cyttsp_core.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.29.2 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 Thu Apr 8 13:11:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 417445 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp560973jai; Thu, 8 Apr 2021 06:12:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxts8TKTrwDYNQ6i6BVjBxoIJdrlLnW0UPesZT6qBgql7lFowqhQVURKfjrS8mdAu3lUxhd X-Received: by 2002:a2e:320c:: with SMTP id y12mr5747442ljy.360.1617887556805; Thu, 08 Apr 2021 06:12:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617887556; cv=none; d=google.com; s=arc-20160816; b=SsmCu3Yc8eqJk2sD1GL84/+I0raipq/Padw+ybo2MS2EBETUblZffOaeyi9EjfmWOw kwaKMGd4xyVBVJY2AXSGZjZaU/+Z7WC5RtTyYKg6AlB7YLV2OuYdxlDQWYDeCAM89MDO pyFKemU9rrGzEQXWzVHSb3OreKq+0po/biG+QW6y2EdWY5eUV7LQjwrrvSJk5JkxY3Ia D+Xmp18yIlcrtbSBqmGYcG/zaFZoe7fuZFq3BMFUSQlQav7zFJRbiiYZW71WgPRCe1zH jZish9wFThMSRcsHEUU3+/6SGuXv/deoIaeb9D4r+a2qzdPR+SDR+YtZVp+l2EroGnQ0 lLWQ== 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=rB+Uj9Rbn2xqB0YtuwwjNW8xA1jhA5o/KbB6xl34qfI=; b=K0KqPFRDu76G5Rw96XB4xFeTIjFlqEcHau2eWDCLVkT3au/2DFaPerfAz2tBCBiSik I/nQCMBO82Oe+3gESVRgoCvoZMDNU58HX0Wl/ZiA3s9c70ylC/zfk8hL2FvTj09Q8/ts WbHIS9Sapaqz/rXt2dCLA9qT3UhJK+JWPLsg3zM15FomEwEW6x4Hrxh0EDFQ4UP5j6SG 27h6BseyskLkvXbjCYqJBa8IdpwABxTe5Azqyw2stgSU5A3sF6WvtgUUOOSPpZHRNjaw 53Nsyf+PZD3dg4IdxZcWglMJBKYdZNykl7exutxumguRpOseBbXE6NNZhKi2e5Rk/ZWU 8cwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M9nzOE9u; 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.36; Thu, 08 Apr 2021 06:12: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=M9nzOE9u; 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 S231446AbhDHNMq (ORCPT + 1 other); Thu, 8 Apr 2021 09:12:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231474AbhDHNMp (ORCPT ); Thu, 8 Apr 2021 09:12: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 A0FC6C061762 for ; Thu, 8 Apr 2021 06:12:33 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id g8so3889505lfv.12 for ; Thu, 08 Apr 2021 06:12: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=rB+Uj9Rbn2xqB0YtuwwjNW8xA1jhA5o/KbB6xl34qfI=; b=M9nzOE9ui4stAiFlevwmfrEaPsnFGnNW/70ic3dc+MUdBa0K/si7SVhlZMDSyJbWzn X03j3P2oiM87pK9BhdedoCgCxdc+Rm/2q4hRqU3e2OWRxU+5n+qKUckXglInxLe8UaE3 qFkIFP/8nqxLusyGPcPkaKc4e62HWaRg6G0dWz0sD0xCJXRNh6wopchKeKKXxu3Jxwp1 H7/rNdMQB7l5qgl8jnkR9EtCZIv1jO/lEG8bMzX9ZttoOn8InwOKhaFfjl8sLslav+d+ n3D2fxoVZMxj1cwacF8TPThf3pofuzVvdL3O0tZYlT0QSs+fjf6LUjqoWsW3Or/Gx8Qp NSiA== 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=rB+Uj9Rbn2xqB0YtuwwjNW8xA1jhA5o/KbB6xl34qfI=; b=Y3Orl4aEDk5s6y9QrZ3tKhtWCW1C7qzEkyxFFeP9coCpIR+T0GuG22nCTC/I/qp7Z3 31/hjw6EehwNN3RmUHsaltjKCtT6yTFTZxm2hzDvzDM3ZVdE5fxDl/x2WFqYlbQFARFk MIsIzH/oyHQLopEOYJtQg7mAxLTSR1DuR1GeUTTeUnbCjFT5NfFmuRSe9AE2Ti1adFRh novTOAeIO78RaZPRZdQf6ZG2WEyybj9ADgEGHZoFZ5CoAz7gf1V0qHJWbPp6/kAj+Yan 3zyVSmB1b5fTCZ11zIaGo+aM+7QEfJyHcRXgzxaFZBETs76xl+XgMUbqrycWAJsLPM+X YG0Q== X-Gm-Message-State: AOAM53125b4Gkgp3gREu0LNyqeZWVk3KS7BZw8UXMHSuPVMPHZ8RJt8r snMWN28rLGjx5G4G+OkCL9UUlA== X-Received: by 2002:a19:911e:: with SMTP id t30mr90047lfd.292.1617887552105; Thu, 08 Apr 2021 06:12: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 z7sm126936ljm.102.2021.04.08.06.12.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Apr 2021 06:12: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 8/8 v3] Input: cyttsp - Flag the device properly Date: Thu, 8 Apr 2021 15:11:53 +0200 Message-Id: <20210408131153.3446138-9-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 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. Reviewed-by: Javier Martinez Canillas Signed-off-by: Linus Walleij --- ChangeLog v1->v3: - Collect Javier's Reviewed-by. --- drivers/input/touchscreen/cyttsp_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.29.2 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);