Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp1396103lqh; Mon, 6 May 2024 06:40:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCViGdKmHjKO9XdUYeQuCGMbtVUz/iYu/VYitmVe/A3D/4E7AtBl3pAGfEFxDWXW79DYp7P1aF4Nw6zhqbD3t7WHzSbq5Zk5o1uEgIdNVw== X-Google-Smtp-Source: AGHT+IH8kTVUt5fFXQp9Z7e9kbKmoQXgu96sgLwDHsfsbyE13K3i8Wsk1DXEjSOF1g6ncU9Su6YE X-Received: by 2002:a17:90a:a108:b0:2b4:39cd:250c with SMTP id s8-20020a17090aa10800b002b439cd250cmr7769657pjp.8.1715002859063; Mon, 06 May 2024 06:40:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715002859; cv=pass; d=google.com; s=arc-20160816; b=alFVHpQ4RphlP2H8vLd6mDPi/9NxwsDov9NperSWpeOdBN6Y6bRgegkj62QCMnBqVF C8BQhrKMYgTlXYYKLJcBvqHLpVW3+6E+nlZNe/IyVYzQvGMr8RfS+Z2xHk4FBY3ngWmM YA78GQSjLlIN+NQ2dsyzAg+IgYayIZpkzm+NjWUikQ6pwPvwLvhnRWPd+cVvLGMs7/3d 5Zezv8ZgK1d+zgE+8ZZj1tUYjego6XBv8/9KbG344LPFteCHDZhudprh5Igu6Z0m6cHK gQk4WqcYAb5YmWPUaJIbVX4IsGwLTGnyiJrdTf51LSNpVbvoDAuJ/gmXfsOyJYs6QDp1 HnHA== 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=2tSx7Ic2SVtcK6pZ/xXOJj7K7utlsI2X9s7StX5o1K8=; fh=SuRMajwH7N2ZLVBLirbkCwTFKIhKCObxyHKAw4nU6hQ=; b=YXpW8rDUosNrPbNmXYIDNw7HKCcbCHqRTlEx9wvqrTcENaTv/2ewZxf608VvhRLxOS yCctUiv9j8lDueCGsMOTTXrCom7frgd3b5bN5i8z5EgrDpMV0NMCCq1QFQ62XbReY0ga TUfLGw19lkKH/N9nX2CZGnzV7Yl12HI0xUksTgqmUqogCDupxFTy0ZuUajsiRpnLi3kJ T/KzthgOmAnr4zpzjNyWKen4hKdywg5ErPzZbmYLPg8Vlbkvj1rH2h1+DislpGrPW9X+ VZe54bh5Z9N0XOHAXdumec3vmYXTDKrfrTbIYUZRtW0ZzL62/xKPs/ohHKiTJ2VTIhge EKuw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="c9s/WUkz"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-169914-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169914-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 fr7-20020a17090ae2c700b002a9f7b48feasi10553871pjb.151.2024.05.06.06.40.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 06:40:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-169914-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="c9s/WUkz"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-169914-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169914-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 40C7A282693 for ; Mon, 6 May 2024 13:40:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E02A286131; Mon, 6 May 2024 13:36:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="c9s/WUkz" 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 173258594C for ; Mon, 6 May 2024 13:36:26 +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=1715002587; cv=none; b=I+cJWQhCeGofpXtgP7NjSS9w+LJdrquYDztRW9yVpO6cPxfRPPPsJ6qY7FJgK1egQcZLLUD3ZRHAqQ26n1OeVzzkwgIRJNNbO3I52ym6Hw2KvPrGeM9ewkWlC5yZrPYoE3PqhhlHPzWQYixWvgwbR4cX+eOPrOeCATMOcN8vy48= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715002587; c=relaxed/simple; bh=Hm8IbzH7o86qGsPyzm5DKDFy+pWLYyONwjVqfO4C4rg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BSHSAMt5cXrr5QX0Bv72qpKabv2u7OO41dG3vvhBJywBWcsEgxniKcIC5ZI3YNQExUUw+3s+FVIW0P/9zAF9Dj64veQAaO1Y1YGMxkXEoKtESl9g8w8gJEcirlRJiX6USR+5LSLP77pUDgWSznvzqjW00Xocq/A9wwkyx133rE4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=c9s/WUkz; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26C2BC4AF68; Mon, 6 May 2024 13:36:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715002586; bh=Hm8IbzH7o86qGsPyzm5DKDFy+pWLYyONwjVqfO4C4rg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=c9s/WUkzLe0/Gv60ykQuMYisA+qfLshxmw/LYojmokJi/IFRzXPXz3p7WTjXqTUcu 9cO9wxDiJJ7V/gNHD316aargzM6HJ5kQz5tLFxy4b09QtHmY9CGScsnCBH9raaqgg1 ovFY1Lzdq3L8wtWXvB9u6txLzMzgSj7OAApgNpQ7MjR4Q+gv5VBsFB0jo/myaNQ5ep yyg8txlfAv6PT6aHaUh56acPXe/OiSPLwqS6+rv6rmUM7jbdnhK1aCssHYK1R/wfF7 AhMejO6EnmKXCMlB3MpkvgKwRNXoZhDi9d52bnu5PEsjffWVTT3Bf5rKI+RhyPmL8P iWTPegQ6Oqw3g== From: Michael Walle Date: Mon, 06 May 2024 15:34:46 +0200 Subject: [PATCH 17/20] drm/bridge: tc358775: move bridge power up/down into functions 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-17-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 Move the bridge power-up and power-down handling into own functions. This is a preparation patch to fix the power-up sequencing of the bridge. No functional change. Signed-off-by: Michael Walle --- drivers/gpu/drm/bridge/tc358775.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358775.c b/drivers/gpu/drm/bridge/tc358775.c index c50554ec4b28..d5b3d691d2c1 100644 --- a/drivers/gpu/drm/bridge/tc358775.c +++ b/drivers/gpu/drm/bridge/tc358775.c @@ -215,6 +215,7 @@ struct tc_data { struct gpio_desc *reset_gpio; struct gpio_desc *stby_gpio; bool lvds_dual_link; + bool powered; u8 bpc; enum tc3587x5_type type; @@ -233,9 +234,8 @@ static inline struct tc_data *bridge_to_tc(struct drm_bridge *b) return container_of(b, struct tc_data, bridge); } -static void tc_bridge_pre_enable(struct drm_bridge *bridge) +static void tc358775_power_up(struct tc_data *tc) { - struct tc_data *tc = bridge_to_tc(bridge); struct device *dev = &tc->dsi->dev; int ret; @@ -256,9 +256,8 @@ static void tc_bridge_pre_enable(struct drm_bridge *bridge) usleep_range(10, 20); } -static void tc_bridge_post_disable(struct drm_bridge *bridge) +static void tc358775_power_down(struct tc_data *tc) { - struct tc_data *tc = bridge_to_tc(bridge); struct device *dev = &tc->dsi->dev; int ret; @@ -279,6 +278,20 @@ static void tc_bridge_post_disable(struct drm_bridge *bridge) usleep_range(10000, 11000); } +static void tc_bridge_pre_enable(struct drm_bridge *bridge) +{ + struct tc_data *tc = bridge_to_tc(bridge); + + tc358775_power_up(tc); +} + +static void tc_bridge_post_disable(struct drm_bridge *bridge) +{ + struct tc_data *tc = bridge_to_tc(bridge); + + tc358775_power_down(tc); +} + /* helper function to access bus_formats */ static struct drm_connector *get_connector(struct drm_encoder *encoder) { -- 2.39.2