Received: by 10.192.165.148 with SMTP id m20csp4699972imm; Tue, 24 Apr 2018 07:06:13 -0700 (PDT) X-Google-Smtp-Source: AB8JxZprDLHfuQwdBbQfefDFaVidQb0gn4sDVbMrCK8EWNk5EYvc47T2vkq/NBdwhalo/G4VVqrz X-Received: by 10.167.133.206 with SMTP id z14mr2820552pfn.2.1524578773221; Tue, 24 Apr 2018 07:06:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524578773; cv=none; d=google.com; s=arc-20160816; b=UkPmdJ4Ky5EI4NBL2yU7gCzYWDuutCiSaR7py/iM/7LPOhrvLCtx9kyE1w8kFLdguI u47ZV5ct2utnnRsTPtUJPKBvMcBeRFXjKxJTAyAN7N/UbL0C9AxEQWYrc99MsVAWM/f7 1AjGW0211fqUSloqNAxwP7v0iqiY4N2CSLKXUgm9SfK1LNqxq7O8G8NCR55V9FX9FWJh o2wPSxqNaS9mWFbVmkTwbJS1/KZjzS0CRUFQrjnlRBDDzKbKh8YrXMHRERUxlV1gY39k gOAIF7xoar/kGFPNKqR39+//4Qj+nJEAn7ncNHljHEkXkRmSrwCn2rIor4eJMeLYVjDg nubA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:thread-index:content-language :content-transfer-encoding:mime-version:message-id:date:subject :in-reply-to:references:cc:to:from:dkim-signature :arc-authentication-results; bh=yVutlft0Y26Sr2ghLbsPSGBU8Xu5G1EL5Hw+FZnLb1g=; b=hHmfAMGSFWEtn+GGKWvnttjgvxXqyct/Q/PUgUXPEXesiKz5NExO9YO9kOTWt7cY9h 6hbnGKCPFyUNToMZ4U3mNKwxkU3TU+8f/r9E5ksfPSol0CKqeXTKKACfey1L5YrMctjU mvbf1JnrYHKPxvh7V0si0cgCfuFdV8i0RGXx0gECB3HFdXFhiROChl8t1p9Xec6k/6Im eKMVuiCPPGnDRDk1IjYH3Yt2tWmP8mtaBZvs9WTWzfUCiIC7wSrTqUKSOW0Xhoszuu8s kBR0UJAhb5RmC8c7QU49fbFrs/L8H46KHRMGRyn4B0KsXSauYlB+zyRoVM0IAjUQBDna V87A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tQVDGXvt; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p25si11852685pgd.395.2018.04.24.07.05.58; Tue, 24 Apr 2018 07:06:13 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tQVDGXvt; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758302AbeDXOCm (ORCPT + 99 others); Tue, 24 Apr 2018 10:02:42 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:33432 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758159AbeDXOCk (ORCPT ); Tue, 24 Apr 2018 10:02:40 -0400 Received: by mail-qt0-f194.google.com with SMTP id f16-v6so18344637qth.0; Tue, 24 Apr 2018 07:02:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:references:in-reply-to:subject:date:message-id :mime-version:content-transfer-encoding:content-language :thread-index; bh=yVutlft0Y26Sr2ghLbsPSGBU8Xu5G1EL5Hw+FZnLb1g=; b=tQVDGXvtHTV0BnTNovS0VRC17lGmhsPT2nx+aZXoA0wy7cLnKBpAnBsEK8yWQ214eD 8mQIVZceoyPRZu2GbsZCBbYfpB9gLxgdKJxzxEcHGoxOC+dv//SYi70tCTCLb62KA+BV L0pmegw7TFTwVIjv34CHsMy/RGX5bwEXn/UDTM7G6Kqmh1DGFaisLa4bYST0p7szz4vx oD2pB20rfKFASlXVzO8ynbmUPF5TW2+f1KujDHTotssRKw+CYNQhDnxPHvNMK1LpDuxq pb4jf7VXzYlnaxVvuOIgHjbvwgmtTxAF2XMcyrnuoG2eZ1ISoJ7Vf1AwnKCgl7bUhGuA e7Lg== 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:references:in-reply-to:subject:date :message-id:mime-version:content-transfer-encoding:content-language :thread-index; bh=yVutlft0Y26Sr2ghLbsPSGBU8Xu5G1EL5Hw+FZnLb1g=; b=iX3cqXJOPJ/N7iUC++pEGY6ugP/zUU4LrhTxdUsgkb/dvy8byPqz9HpwnW8nAAx9oE Fm8sMjJy9w+oNUhM+EfI7nj+YTT6XXteVI1oCR+Ik9DnAHbvlpBBUIPXCaU00z0jj1o5 6z8dF0pPdmVGbfrkwsAh/Zl6V4++EBXzv1kIFDoERyo0ln2RQc2gJyOafR5tsAwDeW78 i9uW5/e6YhdnzAu3Xbuntq4LoHOSSYJsAdops0reCjqicqC9oRVdY4g6by8M2s409ptQ XmSlaFquUnd3/P0M7dfzX9CK3R2/zgsugS0cFeYISpzEq7vpbV3aUbVH+nEAiO4LyXs7 NDpg== X-Gm-Message-State: ALQs6tC/PsCCqQS2/2YYZar7C0tmt4kIXNyY3mujEI1c3jl4/z443Lta 8GtnQD/XtUGkT9P4ghOllLM= X-Received: by 2002:ac8:1c1:: with SMTP id b1-v6mr28844256qtg.422.1524578558699; Tue, 24 Apr 2018 07:02:38 -0700 (PDT) Received: from DESKTOP3JAHB13 ([2607:b400:26:0:d591:2454:e7bc:aa63]) by smtp.gmail.com with ESMTPSA id r4sm12130259qki.0.2018.04.24.07.02.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Apr 2018 07:02:37 -0700 (PDT) From: "Jingoo Han" To: "'Enric Balletbo i Serra'" , , , , , , , , Cc: , , , , , , , , , , , , , , , , , , , , , , , "'Kristian H . Kristensen'" References: <20180423105003.9004-1-enric.balletbo@collabora.com> <20180423105003.9004-23-enric.balletbo@collabora.com> In-Reply-To: <20180423105003.9004-23-enric.balletbo@collabora.com> Subject: Re: [RESEND PATCH v6 22/27] drm/bridge: analogix_dp: Split the platform-specific poweron in two parts Date: Tue, 24 Apr 2018 10:02:33 -0400 Message-ID: <000501d3dbd4$e6f238e0$b4d6aaa0$@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Content-Language: en-us Thread-Index: AQJsKqzGdLQ3B8H319FIYPcigFOt/AEu9dt2otXchSA= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday, April 23, 2018 6:50 AM, Enric Balletbo i Serra wrote: > > 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 > Reviewed-by: Archit Taneja Acked-by: Jingoo Han Best regards, Jingoo Han > --- > > 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 a260de4f0bd8..2bcbfadb6ac5 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.17.0