From patchwork Wed May 18 20:49:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 574727 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 3D14BC433F5 for ; Wed, 18 May 2022 20:49:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242698AbiERUtM (ORCPT ); Wed, 18 May 2022 16:49:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242696AbiERUtL (ORCPT ); Wed, 18 May 2022 16:49:11 -0400 Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B89E1C94CC for ; Wed, 18 May 2022 13:49:10 -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 42EA7840DD; Wed, 18 May 2022 22:49:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1652906947; bh=XBqfKgLraEKIYEFZFeR2OqTYoyiBkz55i1A/38yJx/A=; h=From:To:Cc:Subject:Date:From; b=NuxBK3oIYWVprU9K74WFDPRCAQDN/m00egDhzYbfjZQvcMn3C3VlWQTdZarq1TNBC yxG69gO1s2O6puCG3bET+dlSDBtoAAMWrG223XhgDJ+9NLlkwn0FsjnyippPd7JnRy K2VD3vKxnrQ2XwOVI77+9X3gQh2gmdC+Qgwz7x2zuUB75yngrWj1OgejGlE4+tfuVe 0QEUQbA1B03vYWcAXzwGNpFER0bSGJzCb5FHGv0bPjfeWaOCu5gi8V2e/+Ey3DWwuh RpE9XQtTqfkiuD2JygOTrwa73w395T0AvBk5f04xSk4QLjWpDoWhxS+wFFjaasr7Ur CzpFu3lyoVJ6A== From: Marek Vasut To: linux-input@vger.kernel.org Cc: Marek Vasut , Dmitry Torokhov Subject: [PATCH v2] Input: ili210x - Fix reset timing Date: Wed, 18 May 2022 22:49:01 +0200 Message-Id: <20220518204901.93534-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 12ms 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 --- V2: Use usleep_range() for shorter 12..15ms delay --- 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..3a48262fb3d35 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); + usleep_range(12000, 15000); gpiod_set_value_cansleep(reset_gpio, 0); - msleep(100); + msleep(160); } priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);