From patchwork Wed May 18 16:34:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 574036 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 BB40DC433F5 for ; Wed, 18 May 2022 16:35:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240267AbiERQfB (ORCPT ); Wed, 18 May 2022 12:35:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240350AbiERQfA (ORCPT ); Wed, 18 May 2022 12:35:00 -0400 Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 116C81FB576; Wed, 18 May 2022 09:34:55 -0700 (PDT) Received: from tr.lan (ip-86-49-12-201.net.upcbroadband.cz [86.49.12.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 8BA0584293; Wed, 18 May 2022 18:34:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1652891693; bh=I/UAMHKRHLAz0ec0igZgJ+KfCIC77AzCAKBjSNJB0oQ=; h=From:To:Cc:Subject:Date:From; b=nUZTshLt4oNrfnbn4ORq0ZfQmmJ9VkF2+uQw7344//wsH4iLieaNXpsq2E2ZF3Coe lkZ6A0wMhmGYb7p3T73OO9BEOkRq27ZPE8Ah/rJ/xOzAo5FR47DT2Am/EPB2dyEW07 +CuZT9Km8Hh6ZPbDcYpJa+wSl599aqo2q9WrfODdF+AU3s1sUMLaMszKcZwBP8PQQ+ S5NHC5Oyab6/bsBjAOTHdZ1mwO7UvUSpj7K9H1UcMM/X4R5BDPORyP5G74g1I/PE5v EU6x/vkOx+Al1UT/eZ34ENOZK9T3Qvzh1UpMTPEzJHHkBRmxSq7PZtAsXn/f03eudK h6JBglMpmIUsA== From: Marek Vasut To: linux-input@vger.kernel.org Cc: stable@vger.kernel.org, Marek Vasut , Dmitry Torokhov Subject: [PATCH] Input: ili210x - Fix reset timing Date: Wed, 18 May 2022 18:34:30 +0200 Message-Id: <20220518163430.41192-1-marex@denx.de> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org According to Ilitek "231x & ILI251x Programming Guide" Version: 2.30 "2.1. Power Sequence", "T4 Chip Reset and discharge time" is minimum 10ms and "T2 Chip initial time" is maximum 150ms. Adjust the reset timings such that T4 is 15ms and T2 is 160ms to fit those figures. This prevents sporadic touch controller start up failures when some systems with at least ILI251x controller boot, without this patch the systems sometimes fail to communicate with the touch controller. Fixes: 201f3c803544c ("Input: ili210x - add reset GPIO support") Signed-off-by: Marek Vasut Cc: Dmitry Torokhov --- drivers/input/touchscreen/ili210x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/ili210x.c b/drivers/input/touchscreen/ili210x.c index 2bd407d86bae5..131cb648a82ae 100644 --- a/drivers/input/touchscreen/ili210x.c +++ b/drivers/input/touchscreen/ili210x.c @@ -951,9 +951,9 @@ static int ili210x_i2c_probe(struct i2c_client *client, if (error) return error; - usleep_range(50, 100); + msleep(15); gpiod_set_value_cansleep(reset_gpio, 0); - msleep(100); + msleep(160); } priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);