Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp1396406lqh; Mon, 6 May 2024 06:41:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWN2MxEjqXrC2YXKmkprI+p52BvPqe5UvrWwJzam+Wg4OrIlrzZU+FP4N3RSuJ6nM3F4ZHwxTCFWSRAMCQ1yaO5HWKbYQwGfL/xNe2S1w== X-Google-Smtp-Source: AGHT+IFFNhTzvwmnN9ysd5PdIkMj3gRlDX+xwdZ7a2wrNaet4Th97opg2pM28yHKf/8ef4s2BU2Y X-Received: by 2002:a17:903:2342:b0:1e2:5e32:4444 with SMTP id c2-20020a170903234200b001e25e324444mr12533814plh.10.1715002897784; Mon, 06 May 2024 06:41:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715002897; cv=pass; d=google.com; s=arc-20160816; b=MCR9rd4OXzJM79tBdse9LQoRd8Gny5Tzpz1OIS8aLKqbH6Ucvvbu/SBZT44JgmxE7B G4jKI2Tg/1FGl0nInzC/iXv90TQO5PEjbo0y9OJtiSwGPaSv+JtoLBTj5HdlFdn0Qwzy 1k7BDpi7x+43qR5pQJaQStsoFV+SU06+oiLr+YTycfvXvcod/jBwJKvsT2sFB+jAFmuh BQ/F8IzS8YaxDJdqyuDzgZoLvU+p3uTX4ollFVDZnDXz2aens0Gw73JsgUYtK96VZK8B JfiQnDZRBMYlnvcv1JqJ1uSdZa2qQLi7FP8VoOjYEWh4W/giD7OMnp+tHhMUJsuw93ia JBpA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=KxBggYn36aUANZ5T1t5p/Wr+AXY12fYlFg1jkVkyc3A=; fh=SuRMajwH7N2ZLVBLirbkCwTFKIhKCObxyHKAw4nU6hQ=; b=AkRu3Kd5X+bf4gt538I7hFtqrI/xdNmzqms3AEcNmLsPW12UUfnJDY8DkWu/cTB1lz nMAbP68lauIxKMLDt3IHDkFPIcG5Mn7oen9nEx5Quw8oBBIb89t8sbQXIh5g+iHLy6P6 e6NfpvNadvQkM7/biaW+KV8d4NAk+vcXzPBnEPYfFTMbWIZuAJHB6M6uc5LG13Pnm3NC pynj7avZ0eG7W4Ied07Ww2uImTp84KlnZ7PD9C7BcIKPKTfaCdwpYqaScf2gKMA2k4Dp I14mafBqgvAuQL4AI6eAYumnGPm8zEThH17a3eYRsnewuRzvuRuASRtju3XOAJcaYA2X juJQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MQlzbcin; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-169918-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169918-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id m14-20020a170902db0e00b001eb22fab1b0si6355096plx.618.2024.05.06.06.41.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 06:41:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-169918-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MQlzbcin; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-169918-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169918-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id AB85D284D8A for ; Mon, 6 May 2024 13:41:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B78BF7F7C8; Mon, 6 May 2024 13:36:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MQlzbcin" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DB5CE86AC8 for ; Mon, 6 May 2024 13:36:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715002591; cv=none; b=V3IM+frDkKvCAXc/Ralgwbc9YznmC20SzfFxRsu/GYAq2yOrtaL+C3ydWalrHSY28fqSZFXSlA7uJPtiATXAujlmsBJ6od5JfispBhrnkLVtOpA5DEc8IEreZwKXVQyQ/bJYfLWdI5zyVejRnRDi601W4gFOmVF441nQJQo08R4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715002591; c=relaxed/simple; bh=CdCWrZhe83V0sESOJK7U77pyux4Xw5LMdp8ycoT3WUE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MK6EMgYZyifq78rvZP4qbvUjwVh4rDnCVKOPTWF3MZG4wlpPv+oEB2DQBfZjEELsinxZ2uqd+ia1OAGc8K/oIRR7dqi1DZN8eCv+H+ZsJxMh8BcLYq97Qb/R1877bM11Kgn/rZpJBHftYBCYGcwfySLFlSNZUg/IIEfAq2KVszg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MQlzbcin; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 062EAC116B1; Mon, 6 May 2024 13:36:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715002591; bh=CdCWrZhe83V0sESOJK7U77pyux4Xw5LMdp8ycoT3WUE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=MQlzbcin9J88aETS0zLDb0nvobS3wtLI2Y4BBLQYro4df7gUI0X62eehQlcKCMs9K WzNcODU+CgRa7rRgSlZR2PuZy/juDvvKr2lyV7KBnids0vcCKxinOR55C1pha6uQZy pqhtmhvqQ3aNOvtmJLcr7CO0vbwcd9m5eT1d1rccugbqf89CHBIJmAdTtGhnqwrCSC gxtn3C9GumjieD7KwgVLmf/H/GEYj6kGebzI6Dt52QbdqE8wyjHv8AwnQ4QdFdcdhg Gai+zjxlTch4LRJBulxLPBOxb6dED1DZOygysJFpsJ5sS4d0sWRi8dBJl54Mw7abqd pUu86gTg+hSrg== From: Michael Walle Date: Mon, 06 May 2024 15:34:47 +0200 Subject: [PATCH 18/20] drm/bridge: tc358775: fix the power-up/down delays Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240506-tc358775-fix-powerup-v1-18-545dcf00b8dd@kernel.org> References: <20240506-tc358775-fix-powerup-v1-0-545dcf00b8dd@kernel.org> In-Reply-To: <20240506-tc358775-fix-powerup-v1-0-545dcf00b8dd@kernel.org> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Sam Ravnborg , Vinay Simha BN , Tony Lindgren Cc: Daniel Semkowicz , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Michael Walle X-Mailer: b4 0.12.4 Implement the delays according to Figure 8-10 and 8-11 of the datasheet. In particular, the datasheet states that the *maximum* time between enabling the VDDIO and VDD is 10ms. Currently, as implemented this is always violated. Of course, this is only a best effort because we cannot be sure enabling of the two regulators will be that fast. The time between releasing the stby GPIO and releasing the reset GPIO must be at least 10us and not 10ms as it was before this patch. After reset is released, there must be at least a delay of 200us until the first HS clock is received. Signed-off-by: Michael Walle --- drivers/gpu/drm/bridge/tc358775.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358775.c b/drivers/gpu/drm/bridge/tc358775.c index d5b3d691d2c1..99dbbb1fee78 100644 --- a/drivers/gpu/drm/bridge/tc358775.c +++ b/drivers/gpu/drm/bridge/tc358775.c @@ -242,18 +242,16 @@ static void tc358775_power_up(struct tc_data *tc) ret = regulator_enable(tc->vddio); if (ret < 0) dev_err(dev, "regulator vddio enable failed, %d\n", ret); - usleep_range(10000, 11000); ret = regulator_enable(tc->vdd); if (ret < 0) dev_err(dev, "regulator vdd enable failed, %d\n", ret); - usleep_range(10000, 11000); gpiod_set_value(tc->stby_gpio, 0); - usleep_range(10000, 11000); + usleep_range(10, 20); gpiod_set_value(tc->reset_gpio, 0); - usleep_range(10, 20); + usleep_range(200, 250); } static void tc358775_power_down(struct tc_data *tc) @@ -265,17 +263,14 @@ static void tc358775_power_down(struct tc_data *tc) usleep_range(10, 20); gpiod_set_value(tc->stby_gpio, 1); - usleep_range(10000, 11000); ret = regulator_disable(tc->vdd); if (ret < 0) dev_err(dev, "regulator vdd disable failed, %d\n", ret); - usleep_range(10000, 11000); ret = regulator_disable(tc->vddio); if (ret < 0) dev_err(dev, "regulator vddio disable failed, %d\n", ret); - usleep_range(10000, 11000); } static void tc_bridge_pre_enable(struct drm_bridge *bridge) -- 2.39.2