From patchwork Fri Mar 10 04:32:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 9614741 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9E0E860415 for ; Fri, 10 Mar 2017 04:45:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 90F8428678 for ; Fri, 10 Mar 2017 04:45:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 85A4A286EF; Fri, 10 Mar 2017 04:45:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 52CBF28678 for ; Fri, 10 Mar 2017 04:45:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D9A0E6ED89; Fri, 10 Mar 2017 04:45:19 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk0-x22b.google.com (mail-qk0-x22b.google.com [IPv6:2607:f8b0:400d:c09::22b]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5FB326ED89 for ; Fri, 10 Mar 2017 04:45:18 +0000 (UTC) Received: by mail-qk0-x22b.google.com with SMTP id p64so152430887qke.1 for ; Thu, 09 Mar 2017 20:45:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=91NesMje9gNtU4B0CPhTpSW+ZyyDCbBta1HCf4AF83k=; b=FbxbmIsGwr5REEN56Tm8yymhpVpMju/GDkKyz3b0s3E/14XRrDMQq+3/6Ska+wCpps bt6Kel9P/WuXoqAqXJg1eqPr0XXZ5HRj5lmmRwefkhqCT1tmCOvNf/Pp4JohMIG/h/0e QKGJQt6Dum3fUfpeDxx9Hq+X4EOGOVhbnqc40= 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:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=91NesMje9gNtU4B0CPhTpSW+ZyyDCbBta1HCf4AF83k=; b=grazPTwgSAiSjlhOl60j2WXMFPe49nYrUiMV0Ls14TuRfG+Lt/kUBNvj6YTMazvs3l HfpFqy4KAW4Z/PNikT9x7gMRMNuGRJZ8RJumUhwE//AVQpL2G0XPFBri2yZpRgfwU+yr yR7EwBXO09A6tSr2fQuop8O3Um0BS5xS6rfgY9a1e8ExWqA6b1VP0Zt6wDf5seXOrLvG Zc8IhDYHOOzL8VCHr946m/83ZAlwpnGevqnNNhvIHEvdKu6nVrrmLDIKX4+Fw7K0JfII AQwPtCcNMgq+i22985yCozwIK/4VzHzI7K7WYq0tdZ3TEGN3Y4gfCE7Ml8MwezQVEXsc BbuQ== X-Gm-Message-State: AFeK/H14X0VuHYt6FAblokKfCQhdV1qWWNysAUqJmWI9O3kAwsO6M7lXPiSCWfHpAv6llLxq X-Received: by 10.55.144.6 with SMTP id s6mr18608619qkd.140.1489120711279; Thu, 09 Mar 2017 20:38:31 -0800 (PST) Received: from boxwood.roam.corp.google.com (cpe-75-189-128-87.nc.res.rr.com. [75.189.128.87]) by smtp.gmail.com with ESMTPSA id n19sm5697731qtn.35.2017.03.09.20.38.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Mar 2017 20:38:30 -0800 (PST) From: Sean Paul To: linux-rockchip@lists.infradead.org, dri-devel@lists.freedesktop.org Subject: [PATCH 20/41] drm/bridge: analogix_dp: Set PD_INC_BG first when powering up edp phy Date: Thu, 9 Mar 2017 23:32:35 -0500 Message-Id: <20170310043305.17216-21-seanpaul@chromium.org> X-Mailer: git-send-email 2.12.0.246.ga2ecc84866-goog In-Reply-To: <20170310043305.17216-1-seanpaul@chromium.org> References: <20170310043305.17216-1-seanpaul@chromium.org> MIME-Version: 1.0 Cc: zain wang , Lin Huang , Tomeu Vizoso , Douglas Anderson , linux-kernel@vger.kernel.org, Yakir Yang , Tomasz Figa , =?UTF-8?q?St=C3=A9phane=20Marchesin?= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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)