From patchwork Fri Jun 2 14:09:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: cong yang X-Patchwork-Id: 688380 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95D82C7EE2D for ; Fri, 2 Jun 2023 14:10:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234281AbjFBOKx (ORCPT ); Fri, 2 Jun 2023 10:10:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235750AbjFBOKw (ORCPT ); Fri, 2 Jun 2023 10:10:52 -0400 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F7F61B8 for ; Fri, 2 Jun 2023 07:10:50 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-64d18d772bdso2437465b3a.3 for ; Fri, 02 Jun 2023 07:10:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=huaqin-corp-partner-google-com.20221208.gappssmtp.com; s=20221208; t=1685715049; x=1688307049; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=t0soG1YhojKKut/cvwo6U1h/OP9R4kqmXMLSIIqytqQ=; b=TNXO6ls5E7h7hjiAsQ7kmw+fxCeQAosJNW0XHdKzfsQmvmJOYjgDFlnzJFPaepN8kf uyixpf+sCYWWPO+7q2fo04nrvwCXIfYKc8vNLBmjkkxwr/l1SDD7yniYybGo92sW+ZD+ YPyvteU36FRDSutziZtgYJ8l/zhtlTE0cVZykJlsV7RJnwQ0NbZiVcj6YEw++Pnyhi6D tD3OfFsRzBklFekkSWIHnquoQ+VoEI9Z6Ha0/OEXaeepnNjIbrVq/+hl9IFsNM4VoqB8 iBfXYJVpI/A5GFRMoOi238knjLbxDXPSESIIl+byx25IKwIbhJHyUWaKOzL1a6bxrnl7 YlVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685715049; x=1688307049; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=t0soG1YhojKKut/cvwo6U1h/OP9R4kqmXMLSIIqytqQ=; b=F0/H8FKpwgnnm1RHur/xAuhYxGsdZDNSaBGnX4WQaYTCfidNPO0kDewZ8MYNRsgPxU VkqTNIISyLfSoQhlgHWMzTUYzL+KHQ0DYK0Ru92/REE2suY74ymUk3psgRDBvou4rCWg 65ybXZM3n8uDtEuZmIH+FYiOIbN7PRyoNZxDFzmu85OPJWhN9vArYcdN04mQPvJ8Uaif iykfGemCl2OkQHf0h2Z2BuPkcjDGeT28sCcdKFq2/LZDIr8nanK3JiWUwgSwEK8tjSKi ipkOC65v6JDbJGR5xtX5u5TVuJ6NVz4x593+Y6nRhSrrKgn4L2nDVuNfmYh/6Yls+JDJ 2oiw== X-Gm-Message-State: AC+VfDxglfTvpJQjk5oHqFqn0D+ixf6s/EbxzmyCX6/kOVRWQfHYh+eO 81fZrBFUn9aO5hqnX7KIsliseQ== X-Google-Smtp-Source: ACHHUZ7BaTuk4zgrW6ynZZ1k+iErc4S59mBqXFZ3f+UaLGZkRLdAFVMSLH3Y6ylsaaoJbY4YR0Z8LQ== X-Received: by 2002:a17:903:2343:b0:1ae:5f7e:c117 with SMTP id c3-20020a170903234300b001ae5f7ec117mr24943plh.60.1685715049702; Fri, 02 Jun 2023 07:10:49 -0700 (PDT) Received: from yc.huaqin.com ([101.78.151.214]) by smtp.gmail.com with ESMTPSA id c11-20020a170902d48b00b0019e60c645b1sm1370878plg.305.2023.06.02.07.10.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jun 2023 07:10:49 -0700 (PDT) From: Cong Yang To: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, dmitry.torokhov@gmail.com, jikos@kernel.org, benjamin.tissoires@redhat.com, dianders@chromium.org, hsinyi@google.com Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Cong Yang Subject: [PATCH 1/2] dt-bindings: input: touchscreen: Add ilitek 9882T touchscreen chip Date: Fri, 2 Jun 2023 22:09:47 +0800 Message-Id: <20230602140948.2138668-2-yangcong5@huaqin.corp-partner.google.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230602140948.2138668-1-yangcong5@huaqin.corp-partner.google.com> References: <20230602140948.2138668-1-yangcong5@huaqin.corp-partner.google.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add an ilitek touch screen chip ili9882t. Signed-off-by: Cong Yang --- .../bindings/input/elan,ekth6915.yaml | 36 ++++++++++++++----- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/Documentation/devicetree/bindings/input/elan,ekth6915.yaml b/Documentation/devicetree/bindings/input/elan,ekth6915.yaml index 05e6f2df604c..73e94cb6c4e0 100644 --- a/Documentation/devicetree/bindings/input/elan,ekth6915.yaml +++ b/Documentation/devicetree/bindings/input/elan,ekth6915.yaml @@ -15,11 +15,15 @@ description: properties: compatible: - items: - - const: elan,ekth6915 + oneOf: + - enum: + - elan,ekth6915 + - ilitek,ili9882t reg: - const: 0x10 + enum: + - 0x10 + - 0x41 interrupts: maxItems: 1 @@ -29,17 +33,31 @@ properties: vcc33-supply: description: The 3.3V supply to the touchscreen. + If using ili9882t then this supply will not be needed. vccio-supply: description: The IO supply to the touchscreen. Need not be specified if this is the same as the 3.3V supply. - -required: - - compatible - - reg - - interrupts - - vcc33-supply + If using ili9882t, the IO supply is required. + + required: + - compatible + - reg + - interrupts + - vcc33-supply + +if: + properties: + compatible: + contains: + const: ilitek,ili9882t +then: + required: + - compatible + - reg + - interrupts + - vccio-supply additionalProperties: false From patchwork Fri Jun 2 14:09:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: cong yang X-Patchwork-Id: 688865 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C84FEC7EE2D for ; Fri, 2 Jun 2023 14:11:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235905AbjFBOLE (ORCPT ); Fri, 2 Jun 2023 10:11:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235775AbjFBOLB (ORCPT ); Fri, 2 Jun 2023 10:11:01 -0400 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26F37E49 for ; Fri, 2 Jun 2023 07:10:59 -0700 (PDT) Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1b01d912a76so11174025ad.2 for ; Fri, 02 Jun 2023 07:10:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=huaqin-corp-partner-google-com.20221208.gappssmtp.com; s=20221208; t=1685715058; x=1688307058; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NafLjDBYefQHH3Gad7ICKC/rnUp/PXcgqV+CuJGbaps=; b=G7kmqJz8jCezobMbu8i6NSsiDBWE8Nu5IDJjwICyJCFL907aGO+ZpuBmM25Jc9wHxt 5t9IsVzcivgt4rjzub87CWfsaVBo2HcHdoCiD9yFiQeRdSm+swaAc/g2qyVOZ3HV8JZS NNsuEJJlOitgLpuBovi8lrgqY5tD3gufcNCuRuA0SV+sLPHcY12jMlN5dAFpvYiw3UnV 5i0XsbSwU5T4NDTM4dQD7tQaYdmlu/p4Y933wxKq0ojC89ZArNWlT3wGXMy6FhrT9SOz c4dTunGUi7SeU2mRS861ndMLUszrJ/Q6cvWR/lf5lLPw/rhu4tYqhSaxCLKXM+FWvuwy iOQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685715058; x=1688307058; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NafLjDBYefQHH3Gad7ICKC/rnUp/PXcgqV+CuJGbaps=; b=UqCOhfShLUSjax5TLmlR2AgOt+jYQRqtc3ouTfQ03Ae9/pEBiHhzI3uwunGWx1p2vv dhJ3geM6IucQb59pS7yJbMSEeT/bLb7HGiRUZcqEjBG3a0Q20w4wfRx0UyDza7p82FTl MttdmGwB8eEmrEDpXIfViZSC8Z7lw2Wn5l838yv4nRkD1NUHrZ3FozmnqXVW3sJhvVC+ RCIJVClj/pmm+t+agYPJj5gCAiskHnYKeMtRDNqQXFFHAiS3QX4GfYWWFWwkkQtaINOv AxsFOX0H2nFCLgDF+YkT2K3JWh59C4W3H1G3r8zy5JnUIlf0+x2tUrJEa+912LkA25fk tzHw== X-Gm-Message-State: AC+VfDwBeIlc0HYQiu6SsR0a2nmwjqUI2qyP0VvUK+GBpNqmnuhJngMP zHFqutdX/V6IYIOvUdafO5Xm2A== X-Google-Smtp-Source: ACHHUZ52BrujIzK6kYeA5tQXGF1lbCqUIvbRUYtUuz8q4fWfpA/Mfde3UrbPhhQNlxYJEXzviP9IfA== X-Received: by 2002:a17:902:a3ce:b0:1b0:34a1:9946 with SMTP id q14-20020a170902a3ce00b001b034a19946mr66110plb.46.1685715058598; Fri, 02 Jun 2023 07:10:58 -0700 (PDT) Received: from yc.huaqin.com ([101.78.151.214]) by smtp.gmail.com with ESMTPSA id c11-20020a170902d48b00b0019e60c645b1sm1370878plg.305.2023.06.02.07.10.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jun 2023 07:10:58 -0700 (PDT) From: Cong Yang To: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, dmitry.torokhov@gmail.com, jikos@kernel.org, benjamin.tissoires@redhat.com, dianders@chromium.org, hsinyi@google.com Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Cong Yang Subject: [PATCH 2/2] HID: i2c-hid: elan: Add ili9882t timing Date: Fri, 2 Jun 2023 22:09:48 +0800 Message-Id: <20230602140948.2138668-3-yangcong5@huaqin.corp-partner.google.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230602140948.2138668-1-yangcong5@huaqin.corp-partner.google.com> References: <20230602140948.2138668-1-yangcong5@huaqin.corp-partner.google.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The ili9882t is a TDDI IC (Touch with Display Driver). The datasheet specifies there should be 60ms between touch SDA sleep and panel RESX. Doug's series[1] allows panels and touchscreens to power on/off together, so we can add the 65 ms delay in i2c_hid_core_suspend before panel_unprepare. [1]: https: //lore.kernel.org/all/20230523193017.4109557-1-dianders@chromium.org/ Signed-off-by: Cong Yang --- drivers/hid/i2c-hid/i2c-hid-of-elan.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/drivers/hid/i2c-hid/i2c-hid-of-elan.c b/drivers/hid/i2c-hid/i2c-hid-of-elan.c index 76ddc8be1cbb..411d7ea2725d 100644 --- a/drivers/hid/i2c-hid/i2c-hid-of-elan.c +++ b/drivers/hid/i2c-hid/i2c-hid-of-elan.c @@ -18,7 +18,8 @@ #include "i2c-hid.h" struct elan_i2c_hid_chip_data { - unsigned int post_gpio_reset_delay_ms; + unsigned int post_gpio_reset_on_delay_ms; + unsigned int post_gpio_reset_off_delay_ms; unsigned int post_power_delay_ms; u16 hid_descriptor_address; }; @@ -52,8 +53,8 @@ static int elan_i2c_hid_power_up(struct i2chid_ops *ops) msleep(ihid_elan->chip_data->post_power_delay_ms); gpiod_set_value_cansleep(ihid_elan->reset_gpio, 0); - if (ihid_elan->chip_data->post_gpio_reset_delay_ms) - msleep(ihid_elan->chip_data->post_gpio_reset_delay_ms); + if (ihid_elan->chip_data->post_gpio_reset_on_delay_ms) + msleep(ihid_elan->chip_data->post_gpio_reset_on_delay_ms); return 0; } @@ -64,6 +65,9 @@ static void elan_i2c_hid_power_down(struct i2chid_ops *ops) container_of(ops, struct i2c_hid_of_elan, ops); gpiod_set_value_cansleep(ihid_elan->reset_gpio, 1); + if (ihid_elan->chip_data->post_gpio_reset_off_delay_ms) + msleep(ihid_elan->chip_data->post_gpio_reset_off_delay_ms); + regulator_disable(ihid_elan->vccio); regulator_disable(ihid_elan->vcc33); } @@ -101,12 +105,20 @@ static int i2c_hid_of_elan_probe(struct i2c_client *client) static const struct elan_i2c_hid_chip_data elan_ekth6915_chip_data = { .post_power_delay_ms = 1, - .post_gpio_reset_delay_ms = 300, + .post_gpio_reset_on_delay_ms = 300, + .hid_descriptor_address = 0x0001, +}; + +static const struct elan_i2c_hid_chip_data ilitek_ili9882t_chip_data = { + .post_power_delay_ms = 1, + .post_gpio_reset_on_delay_ms = 200, + .post_gpio_reset_off_delay_ms = 65, .hid_descriptor_address = 0x0001, }; static const struct of_device_id elan_i2c_hid_of_match[] = { { .compatible = "elan,ekth6915", .data = &elan_ekth6915_chip_data }, + { .compatible = "ilitek,ili9882t", .data = &ilitek_ili9882t_chip_data }, { } }; MODULE_DEVICE_TABLE(of, elan_i2c_hid_of_match);