Received: by 10.223.185.111 with SMTP id b44csp822358wrg; Fri, 9 Mar 2018 14:32:45 -0800 (PST) X-Google-Smtp-Source: AG47ELtmN3lwI+v3buf9JEM7Ycq1WtjEO/0G2CiHXf48VC9QCVh44W4wFIpRPeO2HA00m+SIepg+ X-Received: by 2002:a17:902:e65:: with SMTP id 92-v6mr71044plw.268.1520634765037; Fri, 09 Mar 2018 14:32:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520634765; cv=none; d=google.com; s=arc-20160816; b=UN3rUsao8pE+vtM3bVk/CRSToUqkrnE3x5b2vSAIsIKjy9XDdPzvs/Bjy1ZlRr10K3 m57jxbZrvK2zrWQS60CNJCF1CevQmFgDhbPKdtDcbSIzD2a/A3Y5X/fsAD8wH/9rIbfz 9WIffwzP66we7ui1dCWCo0/B6ldVTCtVtJsiGow9jzcDFgBnJOjRM7rbMTjENg5+EJ0L DXs7CnzPFuDmNO1kGn3XoIAhAn6yw0HDjiBjlLzHP8xPU/YCGsyesCkaUlnqNgG7+Inx lAk7TfxHBRpcSlkluLrv9pRgC5mqPwlno5HvhAMs8rF8Jmm90rAP1usvNfHqATiLKgwC g3Xw== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=wUHsySjmY+aBOSCNAe5bOzxD25JOeg0SM5RYaJzhbvg=; b=kgbzo2/X93O0DDl2itcQbNv3FSvcTU7FX6Ld2Fy8h/ssjABry5BREKt+ljpsgqXsLi aHBpe6i31JvtnD6dHfK4UAN4D+yJ3W0d8htgm0rGhxwhzBDzgTygMMYvPH7xANwwcYHe eSq6F7QopKbVX90LCgE27v+i4rdHxQkbK6bGwzgBhTne8+BlVltH5Ve+8y6yhISjnbZR JWBx/ye/IM/7WA0XBQDxQmvvnmTxPZnO5wNjN/UTRMKMoFSlFm2V3Dbsab0YCYxA9wnR h+zkegdYn0+g5jgDBHBWPJu2C3b7YLuNzJKTG1sOL77lT3Csd6lKTxmPFOQ2iivdfex+ X2Og== 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 131si1567181pfa.109.2018.03.09.14.32.30; Fri, 09 Mar 2018 14:32:44 -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 S933053AbeCIWbo (ORCPT + 99 others); Fri, 9 Mar 2018 17:31:44 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:42552 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932795AbeCIWYS (ORCPT ); Fri, 9 Mar 2018 17:24:18 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id C6FA02792D5 From: Enric Balletbo i Serra To: architt@codeaurora.org, inki.dae@samsung.com, thierry.reding@gmail.com, hjc@rock-chips.com, seanpaul@chromium.org, airlied@linux.ie, tfiga@chromium.org, heiko@sntech.de Cc: dri-devel@lists.freedesktop.org, dianders@chromium.org, a.hajda@samsung.com, ykk@rock-chips.com, kernel@collabora.com, m.szyprowski@samsung.com, linux-samsung-soc@vger.kernel.org, jy0922.shim@samsung.com, rydberg@bitmath.org, krzk@kernel.org, linux-rockchip@lists.infradead.org, kgene@kernel.org, linux-input@vger.kernel.org, orjan.eide@arm.com, wxt@rock-chips.com, jeffy.chen@rock-chips.com, linux-arm-kernel@lists.infradead.org, mark.yao@rock-chips.com, wzz@rock-chips.com, hl@rock-chips.com, jingoohan1@gmail.com, sw0312.kim@samsung.com, linux-kernel@vger.kernel.org, kyungmin.park@samsung.com, Laurent.pinchart@ideasonboard.com, kuankuan.y@gmail.com, hshi@chromium.org, =?UTF-8?q?St=C3=A9phane=20Marchesin?= , Enric Balletbo i Serra Subject: [PATCH v5 13/36] drm/bridge: analogix_dp: Ensure edp is disabled when shutting down the panel Date: Fri, 9 Mar 2018 23:23:04 +0100 Message-Id: <20180309222327.18689-14-enric.balletbo@collabora.com> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180309222327.18689-1-enric.balletbo@collabora.com> References: <20180309222327.18689-1-enric.balletbo@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 Signed-off-by: Enric Balletbo i Serra Tested-by: Marek Szyprowski --- 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 92fb9a072cb6..3a222e7e46ee 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c @@ -1160,6 +1160,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); @@ -1191,6 +1197,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; @@ -1233,11 +1241,14 @@ static void analogix_dp_bridge_disable(struct drm_bridge *bridge) } disable_irq(dp->irq); + analogix_dp_set_analog_power_down(dp, POWER_ALL, 1); phy_power_off(dp->phy); 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.16.1