Received: by 10.223.185.111 with SMTP id b44csp817046wrg; Fri, 9 Mar 2018 14:25:37 -0800 (PST) X-Google-Smtp-Source: AG47ELugkXmhIo3wHJgQpBYnfGjozGu6nnZ3RYEk5+pR45ffCHAWcgQpN68SKqp+0bBlBhqkth8U X-Received: by 10.99.45.194 with SMTP id t185mr26285pgt.267.1520634337532; Fri, 09 Mar 2018 14:25:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520634337; cv=none; d=google.com; s=arc-20160816; b=0P+ZEz1AnebOLK1SO4Y4M86NTlyj9uW+3sofKkP8hSKCsL7J5HHH6ecG4yOZDs745Y RkcCb4Hv7vZOXbDgnNDb6pGSqsCSg/ft6wWYq8tWBzAVj1IuagIqUa09f+3Etj7w3h8r aSC4TZuIdRcMBhRJ8VXmh3BKn4+ihTZDBRhViL/2KQwP//NUXvMrzpipHDT+BRYBFp37 +2v0jh7MmoKIiM1CS/ocjefMdmjHExEYU4/za+wbvDnakHZ1dAe1YoLnChvZ2/KY5e3B KBl4CafwYbYZ0cIV1Ux4fgdl9NUQPjS29uUqJuGtfGWo6uMNZ8pciddecM2KtcTNF5Ue FTkg== 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=eYjwrvp6Rv8fPrL6k2U2ftVVAPiBBCW7WMyqIRrFCNQ=; b=nw88CNr9byCCwqHYyfoJlauDQWCOIWToVrgS/DguSJBuSp3B307vgesLksjxWR1zv5 E4FRow4jcg4Hu0Skg2x1D0/ZF0MLfhpIsR9EGP0c9u6SUV0KhibZqoWVZ1F+w+HiXbhx WfkMxbcfOVHn7Wf0QNjotgHPHeIUSESJx2yMPDAkljoJ8VRio+52oXbH68cNhYZq38ux FEdAcakOhmygHhQLu6AcdH89XVJEfAC2iw/lIbhfe+79l1K7mQCqmYbUCMBODEid7wbN ubW1f4ESf+3za5JobaKBpdwBFsVJTnjKrM6QesFmiYcNJ8yImgdnLxHDKvyThlQver1C T7WQ== 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 e18si1537738pfi.130.2018.03.09.14.25.22; Fri, 09 Mar 2018 14:25:37 -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 S932979AbeCIWYS (ORCPT + 99 others); Fri, 9 Mar 2018 17:24:18 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:42506 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932959AbeCIWYP (ORCPT ); Fri, 9 Mar 2018 17:24:15 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id 6ED7E2792D1 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 12/36] drm/bridge: analogix_dp: Set PD_INC_BG first when powering up edp phy Date: Fri, 9 Mar 2018 23:23:03 +0100 Message-Id: <20180309222327.18689-13-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: zain wang Following the correct power up sequence: dp_pd=ff => dp_pd=7f => wait 10us => dp_pd=00 Cc: Stéphane Marchesin Signed-off-by: zain wang Signed-off-by: Sean Paul Signed-off-by: Thierry Escande Signed-off-by: Enric Balletbo i Serra Tested-by: Marek Szyprowski --- drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c | 10 ++++++++-- drivers/gpu/drm/bridge/analogix/analogix_dp_reg.h | 3 +++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c index b47c5af43560..bb72f8b0e603 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c @@ -321,10 +321,16 @@ void analogix_dp_set_analog_power_down(struct analogix_dp_device *dp, break; case POWER_ALL: if (enable) { - reg = DP_PHY_PD | AUX_PD | CH3_PD | CH2_PD | - CH1_PD | CH0_PD; + reg = DP_ALL_PD; writel(reg, dp->reg_base + phy_pd_addr); } else { + reg = DP_ALL_PD; + writel(reg, dp->reg_base + phy_pd_addr); + usleep_range(10, 15); + reg &= ~DP_INC_BG; + writel(reg, dp->reg_base + phy_pd_addr); + usleep_range(10, 15); + writel(0x00, dp->reg_base + phy_pd_addr); } break; diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.h b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.h index 40200c652533..9602668669f4 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.h +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.h @@ -342,12 +342,15 @@ #define DP_PLL_REF_BIT_1_2500V (0x7 << 0) /* ANALOGIX_DP_PHY_PD */ +#define DP_INC_BG (0x1 << 7) +#define DP_EXP_BG (0x1 << 6) #define DP_PHY_PD (0x1 << 5) #define AUX_PD (0x1 << 4) #define CH3_PD (0x1 << 3) #define CH2_PD (0x1 << 2) #define CH1_PD (0x1 << 1) #define CH0_PD (0x1 << 0) +#define DP_ALL_PD (0xff) /* ANALOGIX_DP_PHY_TEST */ #define MACRO_RST (0x1 << 5) -- 2.16.1