Received: by 10.223.185.111 with SMTP id b44csp819529wrg; Fri, 9 Mar 2018 14:29:12 -0800 (PST) X-Google-Smtp-Source: AG47ELsfXrV0YUFUlfGqlgu5RUzkMCYzTvFCHSpB6F+129Rr4HSHyhcHzwI7dlhhWRJ9WvQciPpl X-Received: by 2002:a17:902:8349:: with SMTP id z9-v6mr46550pln.163.1520634552669; Fri, 09 Mar 2018 14:29:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520634552; cv=none; d=google.com; s=arc-20160816; b=JH2KGM4IIw19yf3PnsT9ifkgCc1lN7Jm7Ik1agXfR3vRJuO62d+BD7Fz9dx788TWkD 6QVSeDmuVAD5YrcU6NgLXqNnnkZAqWytJeoDosAFDOi2igvbIG0OwyaanZGW2wkkq5UU iV3SDMNu/pXpIWS2IZv7k5ffCxiqvgn7UKRIT60ENE6qFZs4dYiB7r8uJAwWgdvRO8vj hH2NOo9CMT361wgPn8USg9aYTaVaCR+K4Ec/uCY2JKccHzBQtLZKEZTtFPNoMmJssNum ziqFOtqJzWFAHFrE6zPtjHHoJ6hp0dvXUbrRrXWFNxLLEQFLQNpuIpc6+U4ze8OJ2Onj Ljmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=h4KL/fsyKLQlYUQq8d69v5Sa9EE4P+mE/gY8LaiI0ls=; b=vL74RhxYN9ooJ2sEAglE/Q0d4qABukSz/gOnzXTtnhmRRUyYjDQlPG+MzEaR/yud3P hx0vv3YAJPzpiOkg/7nymyF/uD5Ls87k0lndz/8JSUuzvg1XY6LHmL4N0ivFZwtAZo/o cfZ5gGuLrUDSE5rPZU06DAW4sAUUXp1qTGilOglYuiyLvmDzxgkZDomAIlYY8asLhDQJ G8YBKkuX3pAaw4s7iMNT6VLZ6o/JXXwPNbWdD5sqMmO3EYtYjICVW9GwkR1k3ZUteB6n WHJAG3ToZ5Bryi94qEIZnFZBMbCstB9Z1fAj+NdzywrwYGwvD1G3teT4s/CDGC8vHW5J NqzQ== 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 p6si1602450pfg.96.2018.03.09.14.28.57; Fri, 09 Mar 2018 14:29:12 -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 S933267AbeCIW1b (ORCPT + 99 others); Fri, 9 Mar 2018 17:27:31 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:42964 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932515AbeCIWYx (ORCPT ); Fri, 9 Mar 2018 17:24:53 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id 94D382792D8 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, "Kristian H . Kristensen" , Enric Balletbo i Serra Subject: [PATCH v5 28/36] drm/bridge: analogix_dp: Split the platform-specific poweron in two parts Date: Fri, 9 Mar 2018 23:23:19 +0100 Message-Id: <20180309222327.18689-29-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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Douglas Anderson Some of the platform-specific stuff in rockchip_dp_poweron() needs to happen before the generic code. Some needs to happen after. Let's split the callback in two. Specifically we can't start doing PSR work until _after_ the whole controller is up, so don't set the enable until the end. Cc: Kristian H. Kristensen Signed-off-by: Douglas Anderson [seanpaul added exynos change] 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 | 7 +++++-- drivers/gpu/drm/exynos/exynos_dp.c | 2 +- drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 12 ++++++++++-- include/drm/bridge/analogix_dp.h | 3 ++- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c index eaf93cbd47a8..c527019daaa6 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c @@ -1260,8 +1260,8 @@ static int analogix_dp_set_bridge(struct analogix_dp_device *dp) goto out_dp_clk_pre; } - if (dp->plat_data->power_on) - dp->plat_data->power_on(dp->plat_data); + if (dp->plat_data->power_on_start) + dp->plat_data->power_on_start(dp->plat_data); phy_power_on(dp->phy); @@ -1286,6 +1286,9 @@ static int analogix_dp_set_bridge(struct analogix_dp_device *dp) goto out_dp_init; } + if (dp->plat_data->power_on_end) + dp->plat_data->power_on_end(dp->plat_data); + enable_irq(dp->irq); return 0; diff --git a/drivers/gpu/drm/exynos/exynos_dp.c b/drivers/gpu/drm/exynos/exynos_dp.c index 964831dab102..86330f396784 100644 --- a/drivers/gpu/drm/exynos/exynos_dp.c +++ b/drivers/gpu/drm/exynos/exynos_dp.c @@ -162,7 +162,7 @@ static int exynos_dp_bind(struct device *dev, struct device *master, void *data) dp->drm_dev = drm_dev; dp->plat_data.dev_type = EXYNOS_DP; - dp->plat_data.power_on = exynos_dp_poweron; + dp->plat_data.power_on_start = exynos_dp_poweron; dp->plat_data.power_off = exynos_dp_poweroff; dp->plat_data.attach = exynos_dp_bridge_attach; dp->plat_data.get_modes = exynos_dp_get_modes; diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c index b3f46ed24cdc..23317a2269e1 100644 --- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c +++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c @@ -109,7 +109,7 @@ static int rockchip_dp_pre_init(struct rockchip_dp_device *dp) return 0; } -static int rockchip_dp_poweron(struct analogix_dp_plat_data *plat_data) +static int rockchip_dp_poweron_start(struct analogix_dp_plat_data *plat_data) { struct rockchip_dp_device *dp = to_dp(plat_data); int ret; @@ -127,6 +127,13 @@ static int rockchip_dp_poweron(struct analogix_dp_plat_data *plat_data) return ret; } + return ret; +} + +static int rockchip_dp_poweron_end(struct analogix_dp_plat_data *plat_data) +{ + struct rockchip_dp_device *dp = to_dp(plat_data); + return rockchip_drm_psr_activate(&dp->encoder); } @@ -330,7 +337,8 @@ static int rockchip_dp_bind(struct device *dev, struct device *master, dp->plat_data.encoder = &dp->encoder; dp->plat_data.dev_type = dp->data->chip_type; - dp->plat_data.power_on = rockchip_dp_poweron; + dp->plat_data.power_on_start = rockchip_dp_poweron_start; + dp->plat_data.power_on_end = rockchip_dp_poweron_end; dp->plat_data.power_off = rockchip_dp_powerdown; dp->plat_data.get_modes = rockchip_dp_get_modes; diff --git a/include/drm/bridge/analogix_dp.h b/include/drm/bridge/analogix_dp.h index e9a1116d2f8e..475b706b49de 100644 --- a/include/drm/bridge/analogix_dp.h +++ b/include/drm/bridge/analogix_dp.h @@ -33,7 +33,8 @@ struct analogix_dp_plat_data { struct drm_connector *connector; bool skip_connector; - int (*power_on)(struct analogix_dp_plat_data *); + int (*power_on_start)(struct analogix_dp_plat_data *); + int (*power_on_end)(struct analogix_dp_plat_data *); int (*power_off)(struct analogix_dp_plat_data *); int (*attach)(struct analogix_dp_plat_data *, struct drm_bridge *, struct drm_connector *); -- 2.16.1