From patchwork Fri Mar 10 04:32:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 9614757 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C9ED460415 for ; Fri, 10 Mar 2017 04:47:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BB708286C0 for ; Fri, 10 Mar 2017 04:47:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AF07D286EF; Fri, 10 Mar 2017 04:47:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 42645286C0 for ; Fri, 10 Mar 2017 04:47:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0B5A66ED8E; Fri, 10 Mar 2017 04:47:26 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk0-x233.google.com (mail-qk0-x233.google.com [IPv6:2607:f8b0:400d:c09::233]) by gabe.freedesktop.org (Postfix) with ESMTPS id C84776ED8D for ; Fri, 10 Mar 2017 04:46:40 +0000 (UTC) Received: by mail-qk0-x233.google.com with SMTP id y76so152358926qkb.0 for ; Thu, 09 Mar 2017 20:46:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=E5ByHHUKLXJpVj+Zc02pzHdnCNHZIlTX4ne6loU/jtI=; b=lhrw/gQRhFQMqRBinC3Lms0hzrplA35NFCu5tZIh/j+Jc0bWv2eR4RpGnnsdeF+LON eYXjLtuAjq1fA8GmDyAZiB3vum13hz87UJzKu1eb6qnaYvo0iu4l/8/Phs45FMht4OGe 48Ff8C15B+kel2QbBg2fngquXWBRYJsp51cXk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=E5ByHHUKLXJpVj+Zc02pzHdnCNHZIlTX4ne6loU/jtI=; b=b/iQ2o+ZTk11xXcazb84A1kNgtPctbpTl5YGWGoN+/9War7EacuCYaEAdYJpMglWEe 8eM5VlfjprG+7zQ5P6ETTqZSNHpwOxLfZFMjQv3M1Nds9VjWS2N9QNTB3mUiGer1bZfh lt+Bs3Rqn8O9FSXFe3rEuYtaI2pfB/6Pdon3qrLIzrovwG7jeNxmr/Ht6MyM+v2u0bEQ AxZb5LuiWOU4hTaipnbkEgpTCI6f+edrbcP+NW1LIgODSDBdnt8+uP2OIiBCNIGvJ+Gn sH2MGH+/W4fL8dOXHCdQxgNTzhiNm6Ln+5LuudfYYUKp+RcxXdxaPO3CodY93yn4zVov 7UnA== X-Gm-Message-State: AMke39kA1s/CenAk2UYx9H5TYud/lLTbc8uTvHyBRzC6ObztpKYsic2stFnPgHHg842VuRae X-Received: by 10.200.54.161 with SMTP id a30mr17418197qtc.167.1489120723042; Thu, 09 Mar 2017 20:38:43 -0800 (PST) Received: from boxwood.roam.corp.google.com (cpe-75-189-128-87.nc.res.rr.com. [75.189.128.87]) by smtp.gmail.com with ESMTPSA id n19sm5697731qtn.35.2017.03.09.20.38.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Mar 2017 20:38:41 -0800 (PST) From: Sean Paul To: linux-rockchip@lists.infradead.org, dri-devel@lists.freedesktop.org Subject: [PATCH 21/41] drm/bridge: analogix_dp: Ensure edp is disabled when shutting down the panel Date: Thu, 9 Mar 2017 23:32:36 -0500 Message-Id: <20170310043305.17216-22-seanpaul@chromium.org> X-Mailer: git-send-email 2.12.0.246.ga2ecc84866-goog In-Reply-To: <20170310043305.17216-1-seanpaul@chromium.org> References: <20170310043305.17216-1-seanpaul@chromium.org> MIME-Version: 1.0 Cc: zain wang , Lin Huang , Tomeu Vizoso , Douglas Anderson , Yakir Yang , =?UTF-8?q?St=C3=A9phane=20Marchesin?= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 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" X-Virus-Scanned: ClamAV using ClamSMTP 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 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 048b6f7c9b6e..3b2d53935ae9 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c @@ -1163,6 +1163,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);