Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1961932rwb; Thu, 8 Dec 2022 18:08:15 -0800 (PST) X-Google-Smtp-Source: AA0mqf4Dy1LAt3Miyylv8N3v/Sq4Adn1GiLLKcjIQfWq2mDfnaUzRLICTQcE+zXkSq0GDSAgp7q5 X-Received: by 2002:a05:6402:1d8c:b0:46c:c16b:b4c9 with SMTP id dk12-20020a0564021d8c00b0046cc16bb4c9mr3756564edb.7.1670551695651; Thu, 08 Dec 2022 18:08:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670551695; cv=none; d=google.com; s=arc-20160816; b=MXJpJ7O+pLoD+7Wfl2vPkFPNIWxIj1spsxLmlP4WOtdWLiSJn9T54EXmCGZ1rwR4Fj npqLkgGcwwxz2rONaaGMuKxfcwuNCQHANvA2N0V9c4ijX96VAJ9UzPbj05c+i+fCin/G Oa2letWEux6+55vbzLV6yzVnN+URD6DbfaihQqypLPAt5NxVnvIfyVJcne1dowPdnK8E tbzz2J26TV8WmnXTicJk8f1UudYkrCExMJEtiNy2KK+8VotxjVYGKzxQKhBgrylsk6+V AO6VgvstUkfNF1ZBHHoGK2XSt7eabp/4KT6VlJJyRq1VtDLpcUnxZcQlWEmqL4KgjT/4 deHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=RcPX19iE4ZPsiS8IQ6h41NUvkyatGMpNna0NP2xQakM=; b=ge4npqk1vlrguXeu5Jy+zXhFXg3LSmTo3ygU6e8hx7oAXwbdFMDUAAgOkZR0A+T1q2 538jZI8MBUSyTq+f2/LPhRve/rDrg7udNTwmt5BshI/FQRWYborY+lLOCMsT4wzf+0pm NivIiUZ5dg0jlNoZioYE3dy7aFKVNetTVuIPtc567Rrz8ffBZK3zBZLPD3OBbAhHZkkO 3PgPqB2i8vp1Nq33pQNcYynngFajQumX0h8ipphfkqqtOwTvPFUNAKNONa7BOpU/lXrw Rzdpp2ynsw2kHuVHak4L6SyBR7glE5uUoV5zXkckvnNAayPMUpFrZa0VgwD8FIp/+jYV zGLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=i9bX128U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b9-20020a056402278900b00462f4ea167esi304186ede.315.2022.12.08.18.07.57; Thu, 08 Dec 2022 18:08:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=i9bX128U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229957AbiLIBtr (ORCPT + 74 others); Thu, 8 Dec 2022 20:49:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229950AbiLIBtm (ORCPT ); Thu, 8 Dec 2022 20:49:42 -0500 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2AA753ED6 for ; Thu, 8 Dec 2022 17:49:40 -0800 (PST) Received: by mail-ej1-x631.google.com with SMTP id ud5so8242291ejc.4 for ; Thu, 08 Dec 2022 17:49:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=RcPX19iE4ZPsiS8IQ6h41NUvkyatGMpNna0NP2xQakM=; b=i9bX128UhVLTaG/dxgJBSM/szOgTYQe2JbJxN3Za4RwvEFB9KoCXNLYR9RowE1l4+8 Sksm+2iQ/JPHcOW/XGMYUG277AIyVztwycchl0XFSUj/uZOcPqFfpgfPHS1YgSy4sjqI vbrBrqRPrbO+qk02AlBQBiG6GnMRbhU9SowvY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=RcPX19iE4ZPsiS8IQ6h41NUvkyatGMpNna0NP2xQakM=; b=GBwlGdh94vgfIiZzvgqO8gkt6dPK3Jv17WTatXXyBifNQ6Bvevpi/ljXjKjo2lL2IM GjfZZ7j60Zca+Cgp3WhrpPRqJ/kk4/CI1eqW6iLfJdk2Mz7HL1HjQzoOtzE/qtEJJdMW /4e/Oeedx1KJiKRARhIGmphi+b1Xh2tYa33gVWUIHRQU4nKf/51Eomnz0ezQqDOPXqzI aSAqMSmKC4oSecEhvAIQsROAI2ghWpHM+t4lr2dki6SwUEdUlGKyJ6Uxhn8mjEo09Od9 dZSUzC1CjXMfYC640HZR0XwUJFu3z9SQkEpuWx+uOiFG8LuPIPgQGqLVJrDgXKVbe5hs uKlQ== X-Gm-Message-State: ANoB5plWIthI1tJ21ORdpDWRcMSR2dySK3Xslg0ayAbZJtLTL0dOacCP p0/9b60btfa93M8UiLzabUxJ1OnBNk4zrFqMCBA= X-Received: by 2002:a17:907:1045:b0:7c0:ca94:4631 with SMTP id oy5-20020a170907104500b007c0ca944631mr3486449ejb.30.1670550579081; Thu, 08 Dec 2022 17:49:39 -0800 (PST) Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com. [209.85.221.54]) by smtp.gmail.com with ESMTPSA id gq22-20020a170906e25600b007c10ad73927sm23976ejb.28.2022.12.08.17.49.38 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Dec 2022 17:49:38 -0800 (PST) Received: by mail-wr1-f54.google.com with SMTP id h7so3772489wrs.6 for ; Thu, 08 Dec 2022 17:49:38 -0800 (PST) X-Received: by 2002:a5d:6409:0:b0:241:f7ae:b1dd with SMTP id z9-20020a5d6409000000b00241f7aeb1ddmr41090792wru.138.1670550578308; Thu, 08 Dec 2022 17:49:38 -0800 (PST) MIME-Version: 1.0 References: <20221208192006.1070898-1-dianders@chromium.org> <20221208111910.5.I6edfb3f459662c041563a54e5b7df727c27caaba@changeid> In-Reply-To: From: Doug Anderson Date: Thu, 8 Dec 2022 17:49:25 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 5/5] Input: elants_i2c: Delay longer with reset asserted To: Dmitry Torokhov Cc: Bjorn Andersson , mka@chromium.org, swboyd@chromium.org, linux-arm-msm@vger.kernel.org, linux-input@vger.kernel.org, Yunlong Jia , Konrad Dybcio , Johnny Chuang , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Thu, Dec 8, 2022 at 5:48 PM Dmitry Torokhov wrote: > > On Thu, Dec 08, 2022 at 05:38:28PM -0800, Dmitry Torokhov wrote: > > On Thu, Dec 08, 2022 at 11:20:06AM -0800, Douglas Anderson wrote: > > > The elan touchscreen datasheet says that the reset GPIO only needs to > > > be asserted for 500us in order to reset the regulator. The problem is > > > that some boards need a level shifter between the signals on the GPIO > > > controller and the signals on the touchscreen. All of these extra > > > components on the line can slow the transition of the signals. On one > > > board, we measured the reset line and saw that it took almost 1.8ms to > > > go low. Even after we bumped up the "drive strength" of the signal > > > from the default 2mA to 8mA we still saw it take 421us for the signal > > > to go low. > > > > > > In order to account for this we let's lengthen the amount of time that > > > we keep the reset asserted. Let's bump it up from 500us to 5000us. > > > That's still a relatively short amount of time and is much safer. > > > > > > It should be noted that this fixes real problems. Case in point: > > > 1. The touchscreen power rail may be shared with another device (like > > > an eDP panel). That means that at probe time power might already be > > > on. > > > 2. In probe we grab the reset GPIO and assert it (make it low). > > > 3. We turn on power (a noop since it was already on). > > > 4. We wait 500us. > > > 5. We deassert the reset GPIO. > > > > > > With the above case and only a 500us delay we saw only a partial reset > > > asserted, which is bad. Giving it 5ms is overkill but feels safer in > > > case someone else has a different level shifter setup. > > > > > > Signed-off-by: Douglas Anderson > > > > Applied, thank you. > > Unapplied ;) I guess we should follow kernel test robot's advise and > switch to using usleep_range(). Crud. I'll send a v2 right away. -Doug