Received: by 10.213.65.68 with SMTP id h4csp1742160imn; Thu, 5 Apr 2018 03:03:17 -0700 (PDT) X-Google-Smtp-Source: AIpwx4++CUEUrPOVl6wKg/5+BbSzTzsJyMqiM+bKys8hmTngbSr29YCkTLF9uVqtLVFSKSoVzPPB X-Received: by 10.101.90.203 with SMTP id d11mr14216464pgt.20.1522922597144; Thu, 05 Apr 2018 03:03:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522922597; cv=none; d=google.com; s=arc-20160816; b=RuH0IbrHVdS9AZOcnEz+EcZ1UJYr+i8e4siGysL3WwWySzzX0f7DT8b+l/P8tiqYLe kmG0wsIZFK6f4rnPv88EcgRQAHew0iQny1uRlAu1XscgTcddqCA2daOD9rAfUaqDTUVP sBp14GrsMWrgpUwSqmJJp4/xny0fwfQoh7Rwrzj5Vp8U+ICldU2oDA2YxIN80TaXAIaB FN1iqPYJCkUCr9I5FEUhuM5ThUVDSbCPdZKmIFcDdQ2ZSsuExZJye928+DYx6GrFpK2/ 3CZT/Ptg5LG75hevxGcaYhZYM1azcnO01ZXLr4Aazp/y1AYZR7zThhQ14nDtfLxaZfiR 5CVQ== 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=Lorr/hYYSqWrXooplKZnR0Vw68C4fPY3AZcSo5wjODk=; b=0IYDTqU3QGqJAbu8865i+xkh1B8OLgPy5auUhyu79s79HF1ESLww9AbaoSoP3G2Gmt 2RwoEBhvI9jelTu/4aIErQihpVcGHfgXrH+0KupQzW7JFmVMVnSPzbNam0NY9+wSS2qw YamL12iHxMTG5BWJ/Lq5hqbVPTGOz5Rq2RlC7rqMM0Qc6F4Ypm0CGTo80vDa5S+5QuTY qA2XQa2Sv37efWcywsE3K5YiFaBUSa0S4aKwv52WROb/52G1y6ou71jgiIWqo9T+sMgi PTtq9QFzHPi64Fx6YIpcWMxYTN3yV6e7FZ3opXhpbx3JHtqGvhFuxzCqAcA4MB7czuXN 4CAw== 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 y7si3729716pgv.427.2018.04.05.03.03.03; Thu, 05 Apr 2018 03:03:17 -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; 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 S1752348AbeDEKCA (ORCPT + 99 others); Thu, 5 Apr 2018 06:02:00 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:60596 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751443AbeDEJu0 (ORCPT ); Thu, 5 Apr 2018 05:50:26 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id 2FEB427A650 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 v6 06/30] drm/bridge: analogix_dp: Set PD_INC_BG first when powering up edp phy Date: Thu, 5 Apr 2018 11:49:36 +0200 Message-Id: <20180405095000.9756-7-enric.balletbo@collabora.com> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180405095000.9756-1-enric.balletbo@collabora.com> References: <20180405095000.9756-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 Reviewed-by: Archit Taneja --- 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.3