Received: by 10.223.176.46 with SMTP id f43csp689119wra; Fri, 26 Jan 2018 05:26:07 -0800 (PST) X-Google-Smtp-Source: AH8x224REmvhgE1mXqR+LlcGXdpwVEfP5DzvFyuZ9gERNyfvsBTJ0EPb9BSmG7MyEDbtFBCxswuQ X-Received: by 10.101.93.17 with SMTP id e17mr16027886pgr.352.1516973167645; Fri, 26 Jan 2018 05:26:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516973167; cv=none; d=google.com; s=arc-20160816; b=0euUX0eRHBaR153Fh6iuD+uhhie14JzJksR6tP/fJtjW3hhfKT+L0m23kmrkdXFAMc RGTSdBqV9gkZsLSceUSaUwGIT4gj5rwMF26FIakEMyvlu5z0d5HgBX9NjO2Tow1kI/RC ePM56/vgNby/l6zJOTBNHN4fYzvSVaRD1/cTwvA1lxgtcnfRkpuIVRXCxHPoduF0G6fY e8scAUXARB86HiNFWUPmUAFLtuHw//Rl5IB6ZTaX+KuyTQK06kkIxWJyOvI6q2l5SkPr ezWWmATES/oyYTIc2i0uaeAdPPVIh/gyf3We2DkF0m14Q5Y/acros6h4HfofJmKBfejx aYcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-transfert-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=nU9vu1SWf0VTvKAJGwvUZ7CoT0X+LYI4f+QJoG1duEY=; b=xMh0IHBODm6u/u52hDbyfgb7MSSK+SPNvmSdotlYjKAeEbGe7kXcoPbzQ2Kkd5mW/X qzC+ldfsaFERLSKQwYIIIrtRaNMWkGkrE1iopCug0pgn8tqkQyprg/Oz2UQ/mbdZodWy zNvgIUzL5TVSl6XIbfA7mx+0HdQSrWwtTmJoZLpTOXmCxrY3bNSnsAWK2QmxSs90qDH5 1eCMCStiLeL71jR6Az/cDpP4uw5Nd0fbxqh3EIlhcZ7YzYxJo0O/S2FPfx4+z+BmHfgq JOFdA+v/PItH3G6HumRqq8M7R6K9MXQ8PJ/2M0NAF9TU6eMwt1PwWlPKw2YL6yklTGha bQ+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a61-v6si3703666pla.248.2018.01.26.05.25.53; Fri, 26 Jan 2018 05:26:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752582AbeAZNXk (ORCPT + 99 others); Fri, 26 Jan 2018 08:23:40 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:34374 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752222AbeAZNRv (ORCPT ); Fri, 26 Jan 2018 08:17:51 -0500 Received: from localhost.localdomain (unknown [IPv6:2a01:e35:8a7e:4790:a8d7:ca4:7b4f:7f87]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: tescande) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id B17DA274804; Fri, 26 Jan 2018 13:17:50 +0000 (GMT) From: Thierry Escande To: Archit Taneja , Inki Dae , Thierry Reding , Sandy Huang , Sean Paul , David Airlie , Tomasz Figa Cc: Haixia Shi , =?UTF-8?q?=C3=98rjan=20Eide?= , Zain Wang , Yakir Yang , Lin Huang , Douglas Anderson , Mark Yao , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, dri-devel@lists.freedesktop.org Subject: [PATCH v2 19/43] drm/bridge: analogix_dp: Ensure edp is disabled when shutting down the panel Date: Fri, 26 Jan 2018 14:16:46 +0100 Message-Id: <20180126131710.7622-20-thierry.escande@collabora.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180126131710.7622-1-thierry.escande@collabora.com> References: <20180126131710.7622-1-thierry.escande@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Type: text/plain; charset = "utf-8" Content-Transfert-Encoding: 8bit Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lin Huang When panel is shut down, we should make sure edp can be disabled to avoid undefined behavior. Cc: Stéphane Marchesin Signed-off-by: Lin Huang Signed-off-by: zain wang Signed-off-by: Sean Paul Signed-off-by: Thierry Escande Reviewed-by: Andrzej Hajda --- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c index c940a5bb80ac..fa4ef28e286f 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c @@ -1161,6 +1161,12 @@ static int analogix_dp_set_bridge(struct analogix_dp_device *dp) pm_runtime_get_sync(dp->dev); + ret = clk_prepare_enable(dp->clock); + if (ret < 0) { + DRM_ERROR("Failed to prepare_enable the clock clk [%d]\n", ret); + goto out_dp_clk_pre; + } + if (dp->plat_data->power_on) dp->plat_data->power_on(dp->plat_data); @@ -1192,6 +1198,8 @@ static int analogix_dp_set_bridge(struct analogix_dp_device *dp) phy_power_off(dp->phy); if (dp->plat_data->power_off) dp->plat_data->power_off(dp->plat_data); + clk_disable_unprepare(dp->clock); +out_dp_clk_pre: pm_runtime_put_sync(dp->dev); return ret; @@ -1235,10 +1243,13 @@ static void analogix_dp_bridge_disable(struct drm_bridge *bridge) disable_irq(dp->irq); phy_power_off(dp->phy); + analogix_dp_set_analog_power_down(dp, POWER_ALL, 1); if (dp->plat_data->power_off) dp->plat_data->power_off(dp->plat_data); + clk_disable_unprepare(dp->clock); + pm_runtime_put_sync(dp->dev); ret = analogix_dp_prepare_panel(dp, false, true); -- 2.14.1