From patchwork Fri Mar 10 04:32:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 9614785 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 B411160415 for ; Fri, 10 Mar 2017 04:51:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A56F3286C0 for ; Fri, 10 Mar 2017 04:51:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 97889286EF; Fri, 10 Mar 2017 04:51:02 +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=ham 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 1F974286C0 for ; Fri, 10 Mar 2017 04:51:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BC3676EDB0; Fri, 10 Mar 2017 04:50:41 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk0-x229.google.com (mail-qk0-x229.google.com [IPv6:2607:f8b0:400d:c09::229]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7A9196ED98 for ; Fri, 10 Mar 2017 04:49:09 +0000 (UTC) Received: by mail-qk0-x229.google.com with SMTP id 1so151773041qkl.3 for ; Thu, 09 Mar 2017 20:49:09 -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; bh=1oX3yNWpMagT/nTerBDtO82qeVDoHNZzS4wM29lvEGA=; b=TGSzXl2V57NoznIrkD+nuaYzaD/hmugn1dL2YgRDYihLU+gTyvJkTheeWAIWRnp9Ue pk7Gzkf56+Njo0srfpRNUmrFoATkLyhI1nVDGTD0DhGSX87eHovp1wjsXf/gIGXZCLgJ MI5bUsVZFNnwZvMH+wG+N8zjj6oRLOuvOdbro= 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; bh=1oX3yNWpMagT/nTerBDtO82qeVDoHNZzS4wM29lvEGA=; b=jA2f0yIe2QEoV4xs0AE7ELvYDtl4xAIg95JoaJEMC2P9mpi6Aeyv1xOUmNLMSLTaJp 2oWf62izvvd/ZY5iEzBAWv0+wG0bAjrvMuTBCqZ7FVILzG1B/PskdD+7wAPWTw3/Gbfb DQh9WDbXzJSIJFHYdVGfy2FTUvhbMw3yk22DjrnczxUCUC49jjaNcTUtdm6gGlfo5WDV dZXB72sLwjiTcMvvGPyfLcxsUn5ZjIDgi5J7OM0fqxuJIPB/IydBIcVYD0QVFz8SGwAo shMuctEvpnzM1kwgrlUZ1ZmGsfkmaktDQO5UEmK2QHLarz7DC8ed7KTlWfGODN1T/Lyo KV0A== X-Gm-Message-State: AMke39mL1GY2Cy7SuMecARC5xN9RpUc8g+rpCZHe/nRkLMKTQOioJwk0sf0UaiIgsibsA84B X-Received: by 10.200.34.171 with SMTP id f40mr18314378qta.125.1489120821031; Thu, 09 Mar 2017 20:40:21 -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.40.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Mar 2017 20:40:19 -0800 (PST) From: Sean Paul To: linux-rockchip@lists.infradead.org, dri-devel@lists.freedesktop.org Subject: [PATCH 28/41] drm/bridge: analogix_dp: Don't use ANALOGIX_DP_PLL_CTL to control pll Date: Thu, 9 Mar 2017 23:32:43 -0500 Message-Id: <20170310043305.17216-29-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> Cc: zain wang , Lin Huang , Tomeu Vizoso , Douglas Anderson , Yakir Yang 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: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: zain wang There is no register named ANALOGIX_DP_PLL_CTL in Rockchip edp phy reg list. We should use BIT_4 in ANALOGIX_DP_PD to control the pll power instead of ANALOGIX_DP_PLL_CTL. Cc: Douglas Anderson Signed-off-by: zain wang Signed-off-by: Sean Paul Reviewed-by: Andrzej Hajda --- drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c index 1cb57e528ec8..2cacd1e84b4d 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c @@ -230,16 +230,20 @@ enum pll_status analogix_dp_get_pll_lock_status(struct analogix_dp_device *dp) void analogix_dp_set_pll_power_down(struct analogix_dp_device *dp, bool enable) { u32 reg; + u32 mask = DP_PLL_PD; + u32 pd_addr = ANALOGIX_DP_PLL_CTL; - if (enable) { - reg = readl(dp->reg_base + ANALOGIX_DP_PLL_CTL); - reg |= DP_PLL_PD; - writel(reg, dp->reg_base + ANALOGIX_DP_PLL_CTL); - } else { - reg = readl(dp->reg_base + ANALOGIX_DP_PLL_CTL); - reg &= ~DP_PLL_PD; - writel(reg, dp->reg_base + ANALOGIX_DP_PLL_CTL); + if (dp->plat_data && is_rockchip(dp->plat_data->dev_type)) { + pd_addr = ANALOGIX_DP_PD; + mask = RK_PLL_PD; } + + reg = readl(dp->reg_base + pd_addr); + if (enable) + reg |= mask; + else + reg &= ~mask; + writel(reg, dp->reg_base + pd_addr); } void analogix_dp_set_analog_power_down(struct analogix_dp_device *dp,