From nobody Tue Nov 26 11:53:37 2024 Received: from out-180.mta1.migadu.com (out-180.mta1.migadu.com [95.215.58.180]) (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 3A816191F62 for ; Sat, 19 Oct 2024 19:54:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729367689; cv=none; b=JMySEy0zQqI5CWHfvEer4Zy332OPl7DV6IrGwtzYzdK609nAdBAqOsxhXZ9qmbjYH2Zq+toycDZE51pgvWn6DX1DJEgtKBe6jQHBXQzlJzDo6kJwrlGzCh5SI8bxqeoLNi3gpoo+goyAdncvNuGFKtm0ujDBrp8nxEoojPWbd0Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729367689; c=relaxed/simple; bh=YG8WiJQeyyD4dF+PgGaf/rrZpU7jT4w9sE/GFgFQGp8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=swI4ZLvIS5RrGfti8cMLSwAx/IyFaEdwVcQByHt5nhgfls58NR2oQKQqDRFAhseDkozUjmI2pw194mZrNwxNo/wR8u5KxLdWZXs54R5dlV8c4ZZp5VNWjtTZgMAK4aa8bw98QxFqlR4V6pcItT25YhJqirbE9OYc71sqMFSkSTQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=FUzQFxHB; arc=none smtp.client-ip=95.215.58.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="FUzQFxHB" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1729367685; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3HJygdyJ066Xs3apcFHC5i1N9FuSeNHbO8RlThkAytM=; b=FUzQFxHBL9otUEIDyVWpeNdRZFDmEjJL8ODtFmDiEfVFL2kKA5Yxnlb0xcorYHi3VZtuWj aD18WdPkL+Rpxb9VYkfC1z6/MZObNM2QpVdzVU9BFQaPDzMqMNlnYgFvQ7B+eOnstBIZ2q raoLeW3Qp2rUlBtOtaQH8KseJwmfR9o= From: Aradhya Bhatia To: Tomi Valkeinen , Dmitry Baryshkov , Laurent Pinchart , Andrzej Hajda , Neil Armstrong , Robert Foss , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: Dominik Haller , Sam Ravnborg , Kieran Bingham , Nishanth Menon , Vignesh Raghavendra , Devarsh Thakkar , Praneeth Bajjuri , Udit Kumar , Jayesh Choudhary , DRI Development List , Linux Kernel List , Aradhya Bhatia Subject: [PATCH v5 03/13] drm/bridge: cdns-dsi: Fix Phy _init() and _exit() Date: Sun, 20 Oct 2024 01:24:01 +0530 Message-Id: <20241019195411.266860-4-aradhya.bhatia@linux.dev> In-Reply-To: <20241019195411.266860-1-aradhya.bhatia@linux.dev> References: <20241019195411.266860-1-aradhya.bhatia@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: Aradhya Bhatia Initialize the Phy during the cdns-dsi _resume(), and de-initialize it during the _suspend(). Also power-off the Phy from bridge_disable. Fixes: fced5a364dee ("drm/bridge: cdns: Convert to phy framework") Signed-off-by: Aradhya Bhatia Signed-off-by: Aradhya Bhatia --- drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c b/drivers/gpu/d= rm/bridge/cadence/cdns-dsi-core.c index 5159c3f0853e..d89c32bae2b9 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c @@ -672,6 +672,10 @@ static void cdns_dsi_bridge_disable(struct drm_bridge = *bridge) if (dsi->platform_ops && dsi->platform_ops->disable) dsi->platform_ops->disable(dsi); =20 + phy_power_off(dsi->dphy); + dsi->link_initialized =3D false; + dsi->phy_initialized =3D false; + pm_runtime_put(dsi->base.dev); } =20 @@ -698,7 +702,6 @@ static void cdns_dsi_hs_init(struct cdns_dsi *dsi) DPHY_CMN_PDN | DPHY_PLL_PDN, dsi->regs + MCTL_DPHY_CFG0); =20 - phy_init(dsi->dphy); phy_set_mode(dsi->dphy, PHY_MODE_MIPI_DPHY); phy_configure(dsi->dphy, &output->phy_opts); phy_power_on(dsi->dphy); @@ -1120,6 +1123,8 @@ static int __maybe_unused cdns_dsi_resume(struct devi= ce *dev) clk_prepare_enable(dsi->dsi_p_clk); clk_prepare_enable(dsi->dsi_sys_clk); =20 + phy_init(dsi->dphy); + return 0; } =20 @@ -1127,10 +1132,11 @@ static int __maybe_unused cdns_dsi_suspend(struct d= evice *dev) { struct cdns_dsi *dsi =3D dev_get_drvdata(dev); =20 + phy_exit(dsi->dphy); + clk_disable_unprepare(dsi->dsi_sys_clk); clk_disable_unprepare(dsi->dsi_p_clk); reset_control_assert(dsi->dsi_p_rst); - dsi->link_initialized =3D false; return 0; } =20 --=20 2.34.1