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: 12191057 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,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 BA03FC433ED for ; Thu, 8 Apr 2021 13:12:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 83D2E61153 for ; Thu, 8 Apr 2021 13:12:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231370AbhDHNMb (ORCPT ); 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-Google-Smtp-Source: ABdhPJzG3mcaE/NMLOaw3b0Bdglvyn2CIV/h0P/DAgPlUjfUXQqKlhqnLaTGC52y0GGeay8yC3gb7A== 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 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: 12191059 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,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 EB847C43461 for ; Thu, 8 Apr 2021 13:12:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A863161153 for ; Thu, 8 Apr 2021 13:12:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231424AbhDHNMc (ORCPT ); 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-Google-Smtp-Source: ABdhPJy8QxfhOyZaIxIqPgT2FMKxQChtTzI6RDbVjXbaBSKjjPVMEDSNyOSCwp1i1QT8Mw1Jt3nqTA== 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(+) 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: 12191061 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,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 074A1C433B4 for ; Thu, 8 Apr 2021 13:12:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BF1A061153 for ; Thu, 8 Apr 2021 13:12:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231308AbhDHNMf (ORCPT ); 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-Google-Smtp-Source: ABdhPJwJK4NSeYR+/7YwCZfJ3V0c3MrCN4v6HQMi2W+wRQUQdC2RmOIKblMOzAz/qQ+Rvhoua07xHw== 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(-) 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: 12191063 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,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 CDD93C433ED for ; Thu, 8 Apr 2021 13:12:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9B97E61153 for ; Thu, 8 Apr 2021 13:12:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231255AbhDHNMf (ORCPT ); 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-Google-Smtp-Source: ABdhPJwzAere9PzpRP6pIgktfSWmeCGd/vmHzcXOsJldE5UlpcmepbDROGCatlZiMy1xQ9yOT2NdpQ== 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(-) 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: 12191065 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,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 0BBF7C433B4 for ; Thu, 8 Apr 2021 13:12:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CEC6B61154 for ; Thu, 8 Apr 2021 13:12:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231508AbhDHNMi (ORCPT ); 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-Google-Smtp-Source: ABdhPJygTfMDZ5mheXkfSeujRbvov6DXFah4qDiW9+6Kopcbd7BknAwqzBZBvJPYyCnGHAMn113MLw== 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(-) 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: 12191067 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,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 493E4C433B4 for ; Thu, 8 Apr 2021 13:12:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 218E461153 for ; Thu, 8 Apr 2021 13:12:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231295AbhDHNMl (ORCPT ); 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-Google-Smtp-Source: ABdhPJzeS8xewYBLq3ybg9r0CJQ3SnPlPUvUarKhZtQPzr7sFVjcSw6U3a2g6d2ZePZECZLePWZDzA== 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(-) 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: 12191069 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.7 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 6690FC433B4 for ; Thu, 8 Apr 2021 13:12:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 369D161154 for ; Thu, 8 Apr 2021 13:12:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229741AbhDHNMp (ORCPT ); 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-Google-Smtp-Source: ABdhPJwzGznodfAmiszfj1zUk9q+aiW5Pq/PjJhaBxqyqF0mj9/pYCwno5ky2ojv7ncimXnsesVuow== 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(+) 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: 12191071 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.7 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 A968CC433ED for ; Thu, 8 Apr 2021 13:12:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 75ECB61159 for ; Thu, 8 Apr 2021 13:12:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231446AbhDHNMq (ORCPT ); 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-Google-Smtp-Source: ABdhPJy8Np9bPlbHm55raxU1iqh7Nd9lkRjhfrGXENw4oGXm3p1W1lY6HXOmG6FaRRnahh1Fn6HnWA== 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(-) 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);