Received: by 10.223.176.46 with SMTP id f43csp688769wra; Fri, 26 Jan 2018 05:25:48 -0800 (PST) X-Google-Smtp-Source: AH8x224+uK7A91Gdto/hF8uIK3GjC8oSpbrbSl7yPeo+dERH1KXj3ToRY8NIR8ZCbva/lwY069So X-Received: by 10.98.74.133 with SMTP id c5mr19469172pfj.188.1516973148409; Fri, 26 Jan 2018 05:25:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516973148; cv=none; d=google.com; s=arc-20160816; b=IdE2eLIpNG6DhbmWdfR+u84wRFhCrS/dvS+YFQ4m+KO7KN7E+MSe5Yb7ZVVTQ47KCu +CI+kESPXUqkLjpcX2XRxtYThUmpFlLdo7JaZRnNkSkb5YPB/tCl4ct6xVthC9kS7MOe 7fxtwkeaZMGAHlAcpdtk8hQoix6d+UofKiwDHvBfmmGVHN6jh7FgFmJtKcJklgV+gZaC Znj8Mb+veaFkgI/Y4A9Mfe9od40M3uXbV45ObpF6PFYmtvAIMLsc6ufbq7bQ3sCTWSTD zGxYWTxB1YuQYey2C+ARjarxjOkizUbo+1yfq4cic1ZzDAx2y2Q5v/5nA9Ja3B9EEy5T XpZA== 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 :content-transfert-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=AwO7oWVYlq5pZ1VD1rNhWmi+p+H1NtzjmQ195Av40Nc=; b=T0LMo7rmi8ZBIscH0kxSyoK4J8G+uhBc7uJDQkoG84biIYu3fcjzAMAvxKn6wVaxjV 7a6dVfkLN3MCuHzfjcaVlNGbuvLIpRqeOOAxwNrk4qLcbDBKZtBSCqWSKO2kDPAVsC5h 1cV/kAm9KxACQzpIQUW1/8un8GIsOs+qKo9crQI3EY8NTyl+jCxjTJ/Nse7S0vZZhxpA yo8nLMRA2ox6Kt+vX5RjgODj+DXoTu9rwiFIYkM7HIPX0B+8A1KvaQWvKTxrC80CtzYt ghjmRFsAoaCiZdmcIRsi+WBj07BK+bgbEB7xLtKLspSHzWYGsZIKfjjytMnra3avqgSW 0I8A== 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 b9si3013610pgf.430.2018.01.26.05.25.34; Fri, 26 Jan 2018 05:25:48 -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 S1752767AbeAZNX5 (ORCPT + 99 others); Fri, 26 Jan 2018 08:23:57 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:34516 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752259AbeAZNRv (ORCPT ); Fri, 26 Jan 2018 08:17:51 -0500 Received: from localhost.localdomain (unknown [IPv6:2a01:e35:8a7e:4790:a8d7:ca4:7b4f:7f87]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: tescande) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 0CE38274803; Fri, 26 Jan 2018 13:17:50 +0000 (GMT) From: Thierry Escande To: Archit Taneja , Inki Dae , Thierry Reding , Sandy Huang , Sean Paul , David Airlie , Tomasz Figa Cc: Haixia Shi , =?UTF-8?q?=C3=98rjan=20Eide?= , Zain Wang , Yakir Yang , Lin Huang , Douglas Anderson , Mark Yao , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, dri-devel@lists.freedesktop.org Subject: [PATCH v2 18/43] drm/bridge: analogix_dp: Set PD_INC_BG first when powering up edp phy Date: Fri, 26 Jan 2018 14:16:45 +0100 Message-Id: <20180126131710.7622-19-thierry.escande@collabora.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180126131710.7622-1-thierry.escande@collabora.com> References: <20180126131710.7622-1-thierry.escande@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Type: text/plain; charset = "utf-8" Content-Transfert-Encoding: 8bit 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 --- 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.14.1