From patchwork Wed Jul 17 06:29:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dragan Simic X-Patchwork-Id: 13735153 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A64A0C3DA42 for ; Wed, 17 Jul 2024 06:29:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E517D10E94D; Wed, 17 Jul 2024 06:29:39 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=manjaro.org header.i=@manjaro.org header.b="qikMfKZq"; dkim-atps=neutral Received: from mail.manjaro.org (mail.manjaro.org [116.203.91.91]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1726910E951 for ; Wed, 17 Jul 2024 06:29:36 +0000 (UTC) From: Dragan Simic DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=manjaro.org; s=2021; t=1721197774; 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; bh=XcMogaAUaZ3MeH9Rz27kLYrZiPWISfiW31C8HrmU3oc=; b=qikMfKZqXWx8jVfMM0XqFrblNKG6yB0RbQORKkwSHifzQBHyLNdKNN/ysn41q9OYaCNFfx DlDMCcM097yOduIVvMqMe8PSinsYCdC8UDsxXXhk+t/UYDKz1r6SW+Xv38ooC0y6nGDx9R eLWX/Tg/lFE5rkmZVwqffK2PM32RSCSygFFy1X0F5vx5C6cmEegd77rWHXw5T46PPqoQ7x mGgztZcM/p10Xhv5dBX45N2DCjqqklwdGWE39NgYIXkKARS/G5jTXOB6SUunPY7q2lnmtx fhvjIRNMk6YdbpKDtJ8wH0vJH2iAYphRXLpxY4d1TFcBCZ2NCA07hIfTeYJqEw== To: linux-rockchip@lists.infradead.org, dri-devel@lists.freedesktop.org Cc: heiko@sntech.de, hjc@rock-chips.com, andy.yan@rock-chips.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Ondrej Jirman Subject: [PATCH] drm/rockchip: dsi: Reset ISP1 DPHY before powering it on Date: Wed, 17 Jul 2024 08:29:14 +0200 Message-Id: <6e0ce232acfe952970e9b37402fe08a3678aa43a.1721196758.git.dsimic@manjaro.org> MIME-Version: 1.0 Authentication-Results: ORIGINATING; auth=pass smtp.auth=dsimic@manjaro.org smtp.mailfrom=dsimic@manjaro.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Ondrej Jirman After a suspend and resume cycle, ISP1 stops receiving data, as observed on the Pine64 PinePhone Pro, which is based on the Rockchip RK3399 SoC. Re-initializing DPHY during the PHY power-on, if the SoC variant supports initialization, fixes this issue. [ dsimic: Added more details to the commit summary and description ] Signed-off-by: Ondrej Jirman Signed-off-by: Dragan Simic Signed-off-by: Ondrej Jirman --- drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c index 4cc8ed8f4fbd..9ad48c6dfac3 100644 --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c @@ -1240,6 +1240,14 @@ static int dw_mipi_dsi_dphy_power_on(struct phy *phy) goto err_phy_cfg_clk; } + if (dsi->cdata->dphy_rx_init) { + ret = dsi->cdata->dphy_rx_init(phy); + if (ret < 0) { + DRM_DEV_ERROR(dsi->dev, "hardware-specific phy init failed: %d\n", ret); + goto err_pwr_on; + } + } + /* do soc-variant specific init */ if (dsi->cdata->dphy_rx_power_on) { ret = dsi->cdata->dphy_rx_power_on(phy);