From patchwork Fri Sep 9 10:27:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yunlong Jia X-Patchwork-Id: 12971478 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 AACD8C6FA82 for ; Fri, 9 Sep 2022 10:28:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231148AbiIIK2U (ORCPT ); Fri, 9 Sep 2022 06:28:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229946AbiIIK2G (ORCPT ); Fri, 9 Sep 2022 06:28:06 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FCA212F205 for ; Fri, 9 Sep 2022 03:28:05 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id m10-20020a17090a730a00b001fa986fd8eeso4973297pjk.0 for ; Fri, 09 Sep 2022 03:28:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ecs-corp-partner-google-com.20210112.gappssmtp.com; s=20210112; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=A2mUQ7fRFvl4uncpd865iji4uF5goEpWJoSgQh7OGzs=; b=wnY6Ju26Lduyy3BBxnOibYoABYQp14RiI/A6EelKgXJBluGpYMufyYgKVPhByOdgJm kalR7E1gMTCYua2iNwMqB3xxF3VIL/uqJNjJu6fUEkOOLKTW0c+dMsNAKQ/QgpItcivh xoqFs44Hidtxc2XnsOMJiH6oEmVf/T2msU8LlUWkq1Chi8bmhIdJlaA5Xu+n0CKwYs/l LAgU9KOO8Nk9ZbKgn9CeKro5T7bv8OLL3f3XfFyANRxW6NoBw+QEdQH2Tr8cVgvso5n2 Szwo+4CjibfG4jAT66Uph8C9itXGeUukRA7kuH3UM82Q3YoXErthZZx5zpNWI4mJ/3fS 8l0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=A2mUQ7fRFvl4uncpd865iji4uF5goEpWJoSgQh7OGzs=; b=uqdl+e1HC2K6PruHrUjgL6YK4Z51exGTbyP1z+1i6SvvYq/j7Wza5cTGRyy7zmq45p OIIyQ62CCKvBZVvBBhu6KKwQmx2wJPJ+HHfmMS7mCYXwztE/rMP/zNEsAm2zrFxvzr2U kZgzlUcpnXA0+0O6sdJYTdcvVTd3B8D2fjEwwAiMruyKrXWQmm6s5NBrHy+pOAS1G54C DKfAXGO1pjn6/+BDkGQItbzxBuEVNOXq3AL5MkY6XUzrQ17SUliqp1cctowgmWPAH5iD LIuWp98nPAOXXdsidsYAYl1boYp/LMPUfCwvROUMaDixvshJMDzhldNzSQhcTRc5Hzo3 qNSQ== X-Gm-Message-State: ACgBeo1I9KwXeArGGou6Qbb+gBJ8GO/DVwAAEANj6AuxMuQ10zInm61+ ekt/3+g/n5qGq0F9hCUBJPAbig== X-Google-Smtp-Source: AA6agR71IB5DpQABFJR4ATzXtpHnNkODpV6uYlIX33pXUwuCzJlt/xXeNA8s3hfTmvBUxpDl+ont4g== X-Received: by 2002:a17:902:e2d3:b0:176:e97a:d3eb with SMTP id l19-20020a170902e2d300b00176e97ad3ebmr12072323plc.172.1662719284553; Fri, 09 Sep 2022 03:28:04 -0700 (PDT) Received: from localhost.localdomain ([103.150.184.130]) by smtp.gmail.com with ESMTPSA id c12-20020a170902d48c00b0016bb24f5d19sm121476plg.209.2022.09.09.03.28.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Sep 2022 03:28:03 -0700 (PDT) From: Yunlong Jia X-Google-Original-From: Yunlong Jia To: LKML Cc: Henry Sun , Douglas Anderson , Bob Moragues , Yunlong Jia , David Heidelberg , Dmitry Torokhov , Rob Herring , devicetree@vger.kernel.org, linux-input@vger.kernel.org Subject: [PATCH v3 1/2] dt-bindings: input: touchscreen: elants_i2c: Add eth3915n touchscreen chip Date: Fri, 9 Sep 2022 10:27:54 +0000 Message-Id: <20220909102720.v3.1.Ib599a6001558a4afd11016e7016d74dce748a749@changeid> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Add an elan touch screen chip eth3915n. This chip requires more delay time than the eth3500. Signed-off-by: Yunlong Jia Reviewed-by: Douglas Anderson Acked-by: David Heidelberg --- (no changes since v1) .../devicetree/bindings/input/touchscreen/elan,elants_i2c.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/input/touchscreen/elan,elants_i2c.yaml b/Documentation/devicetree/bindings/input/touchscreen/elan,elants_i2c.yaml index a9b53c2e6f0ab..d28625372f5ac 100644 --- a/Documentation/devicetree/bindings/input/touchscreen/elan,elants_i2c.yaml +++ b/Documentation/devicetree/bindings/input/touchscreen/elan,elants_i2c.yaml @@ -17,6 +17,7 @@ properties: enum: - elan,ektf3624 - elan,ekth3500 + - elan,ekth3915 reg: maxItems: 1 From patchwork Fri Sep 9 10:27:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yunlong Jia X-Patchwork-Id: 12971479 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 D6B7EC6FA86 for ; Fri, 9 Sep 2022 10:28:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230488AbiIIK2Y (ORCPT ); Fri, 9 Sep 2022 06:28:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231157AbiIIK2V (ORCPT ); Fri, 9 Sep 2022 06:28:21 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CCBC12F205 for ; Fri, 9 Sep 2022 03:28:20 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id q15-20020a17090a304f00b002002ac83485so1152205pjl.0 for ; Fri, 09 Sep 2022 03:28:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ecs-corp-partner-google-com.20210112.gappssmtp.com; s=20210112; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date; bh=dudaN+vQlPBdSJzNtdC8je441R+dRkrcZdvbH6gzK6o=; b=GyvQxiY/w91s0naf5u4nCgJth+JgxU7PiIRHwg1M2nASw77wKcmvilHtPwP+yvYbKC GrGTta2EiooFYTyvGqjdct5bzij5WNo5McezHCjswy0MNkOX/fHpmHYFBtM+QTw8MCd4 vCuH08rZtNm5K7h3lJBo48kkvzwYCI1+ZYADLy73Bud6Yn9o3opOQgfsqlGjFJkT6CNS VzmEZFmrCsBRMe+5Cfps6TJuyrc+iLvF8Mcpvws6sbdf+0Kk7rbIZNlimSTbsYSfD+9A Q2wN3w/v+Xuy8SoGzazstKby6Yl3Qf7jCHAjq0Hc7KYIvs6CpnEYtkEJSBo0DD1AiTCE 8Haw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date; bh=dudaN+vQlPBdSJzNtdC8je441R+dRkrcZdvbH6gzK6o=; b=y/FPyaHVP+ODW1repCfpD3wKg/THnZk1qJejs/JQoVG+7ahQaIb/4oB4MNs4ggOk75 /A2RYqyy1O39AtGAm3uWroQa2ndOSMphrzURlteoHpTjWkA22Tc+e0hhiNF1AZ9rKMyc cbJFPp15Nm8ZNGpE6FQ2/f9aY53jsPLNKxHTe9idrzaIM4LjMv+BgngvJbOtv0DsqEw7 kl/kEST/5t6Qwyexl1ICuHwJ0ArZHXFPpgkyZNOTR6fzDAke4nmS4agdCKA5ehcR8eTd Lcr3bTGPJ8zRcvzQPibpzWLYNYnu0ZK6/+LevyyF+K8B15w10UusDo6/BiU4JBftAhdp ACaQ== X-Gm-Message-State: ACgBeo0MYRyJtdaGTTLnMXRfvt9sY+7gROOayxYk+Iw3cUKpcw+PflL0 0JppCaqmEEs/9w6fwTgiKCQl4g== X-Google-Smtp-Source: AA6agR74SLJNRgDh7EXqn5O6lou0t+YKwAvGJ0lXu5mgXosr5nxdp5gBXaPgpbg627lWslom8gojTw== X-Received: by 2002:a17:902:7b8a:b0:172:9516:f15 with SMTP id w10-20020a1709027b8a00b0017295160f15mr13481676pll.92.1662719299472; Fri, 09 Sep 2022 03:28:19 -0700 (PDT) Received: from localhost.localdomain ([103.150.184.130]) by smtp.gmail.com with ESMTPSA id c12-20020a170902d48c00b0016bb24f5d19sm121476plg.209.2022.09.09.03.28.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Sep 2022 03:28:19 -0700 (PDT) From: Yunlong Jia X-Google-Original-From: Yunlong Jia To: LKML Cc: Henry Sun , Douglas Anderson , Bob Moragues , Yunlong Jia , Dmitry Torokhov , Greg Kroah-Hartman , Johnny Chuang , linux-input@vger.kernel.org Subject: [PATCH v3 2/2] input: touchscreen: elants_i2c: Add eth3915n touchscreen chip Date: Fri, 9 Sep 2022 10:27:55 +0000 Message-Id: <20220909102720.v3.2.I22ae48d8ee064456073a828393704809360c4368@changeid> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220909102720.v3.1.Ib599a6001558a4afd11016e7016d74dce748a749@changeid> References: <20220909102720.v3.1.Ib599a6001558a4afd11016e7016d74dce748a749@changeid> Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org The eth3915n requires more delay time than the eth3500 when poweron & reset. Define EKTH3915_POWERON_DELAY_MSEC as the poweron delay time of eth3915n, about 80ms. Define EKTH3915_RESET_DELAY_MSEC as the reset delay time of eth3915n, about 300ms. Signed-off-by: Yunlong Jia Reviewed-by: Douglas Anderson --- Changes in v3: 1. Add poweron delay time. Changes in v2: 1. Adjust the 'Signed-off-by'. drivers/input/touchscreen/elants_i2c.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/elants_i2c.c b/drivers/input/touchscreen/elants_i2c.c index c9dd703b0c7d8..fb99dd10b0b6d 100644 --- a/drivers/input/touchscreen/elants_i2c.c +++ b/drivers/input/touchscreen/elants_i2c.c @@ -116,6 +116,8 @@ #define ELAN_POWERON_DELAY_USEC 500 #define ELAN_RESET_DELAY_MSEC 20 +#define EKTH3915_POWERON_DELAY_MSEC 80 +#define EKTH3915_RESET_DELAY_MSEC 300 /* FW boot code version */ #define BC_VER_H_BYTE_FOR_EKTH3900x1_I2C 0x72 @@ -133,6 +135,7 @@ enum elants_chip_id { EKTH3500, EKTF3624, + EKTH3915, }; enum elants_state { @@ -664,6 +667,7 @@ static int elants_i2c_initialize(struct elants_data *ts) switch (ts->chip_id) { case EKTH3500: + case EKTH3915: if (!error) error = elants_i2c_query_ts_info_ekth(ts); break; @@ -1331,6 +1335,9 @@ static int elants_i2c_power_on(struct elants_data *ts) if (IS_ERR_OR_NULL(ts->reset_gpio)) return 0; + if (ts->chip_id == EKTH3915) + msleep(EKTH3915_POWERON_DELAY_MSEC); + gpiod_set_value_cansleep(ts->reset_gpio, 1); error = regulator_enable(ts->vcc33); @@ -1361,7 +1368,17 @@ static int elants_i2c_power_on(struct elants_data *ts) if (error) return error; - msleep(ELAN_RESET_DELAY_MSEC); + if (ts->chip_id == EKTH3915) + /* + * There need delay 300ms for power on sequence. + * T1 + T2 + T3 >= 305 ms + * T1: 05ms + * T3: >300ms + */ + msleep(EKTH3915_RESET_DELAY_MSEC); + else + msleep(ELAN_RESET_DELAY_MSEC); return 0; } @@ -1686,6 +1703,7 @@ static const struct i2c_device_id elants_i2c_id[] = { { DEVICE_NAME, EKTH3500 }, { "ekth3500", EKTH3500 }, { "ektf3624", EKTF3624 }, + { "ekth3915", EKTH3915 }, { } }; MODULE_DEVICE_TABLE(i2c, elants_i2c_id); @@ -1702,6 +1720,7 @@ MODULE_DEVICE_TABLE(acpi, elants_acpi_id); static const struct of_device_id elants_of_match[] = { { .compatible = "elan,ekth3500", .data = (void *)EKTH3500 }, { .compatible = "elan,ektf3624", .data = (void *)EKTF3624 }, + { .compatible = "elan,ekth3915", .data = (void *)EKTH3915 }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, elants_of_match);