From patchwork Fri Feb 10 07:44:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Zhong X-Patchwork-Id: 9566103 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 CCBD1601EA for ; Fri, 10 Feb 2017 07:46:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8BBB2853F for ; Fri, 10 Feb 2017 07:46:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD9A028546; Fri, 10 Feb 2017 07:46:21 +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=-1.4 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_SORBS_SPAM autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9BD412853F for ; Fri, 10 Feb 2017 07:46:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=gJK285qd+WTEf//upDkxC1qgtoz3/rzxZ/NBqfeK00w=; b=k6t2Arf6E428Ac8VLyq9B9dUgr llG7In88FCWHPvl3+RBzjbeUqnL7z0TTyJVM8CKXFH7FznUukbjCc6gxSumehimY8YS7FcsgGVuFE sCr7wZI6WCD9/C0e7H3cM8QmMcakDlxIl7DfsEFzC0JnHlXklm4/m9scmZWtS8JcvsERuJ6zTDOAg HVMyuiaIEkQwrqI48pn9kHbv2Vtsmt17q4VPVglChu9C1cjvf+Lpd3PfoOrsEacx1S8K0oPfZYjIR xLzOODMd4UwibNxVtB67rIj8KU5FVv/F3zy6rSqmqSxd34h7efBZ2AbPgFEO87wBmSVpyQ38+LYxb iM9yTrsQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cc5uN-0005tT-Vb; Fri, 10 Feb 2017 07:46:19 +0000 Received: from mail-pf0-f194.google.com ([209.85.192.194]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cc5tF-0003bW-AV; Fri, 10 Feb 2017 07:45:15 +0000 Received: by mail-pf0-f194.google.com with SMTP id 19so2027131pfo.3; Thu, 09 Feb 2017 23:44:48 -0800 (PST) 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=wqGvZE9txsdO6NXkRs4OvC+V2Xh5glFs+sWF/iE8PBo=; b=hSz1fQvYGN25v9k8SwITvmQlZO1NUVrFwCcQJEwkYepNda7sUnXAN4dNF21/9wJCuf 1KDcd3mlOzJi8brX1dGlUzSv1j2vQX1743kNep107lhvRFVQdqncyzo8xHMJfHIgMOFh GBwDx6UaesTjgQMEK86O6m4j/IRNEsbdPd4D7i3+mc3cmyoIs5ArmvgngrXF/K3M+Of7 D1nw4sM4pZXF20Aru8OLdk0M6WgcLaHiyDARa28iF0CSS0X1O7aDoS+dZGi+OZwPoCUU s/SDYVfKBv3T8dyQJGyoROXHHe3jfH/UmbkICB/66eAYhZF5WC1fX2rtwlqYrHeZHdEL kprg== X-Gm-Message-State: AMke39lEPHuM4Kn1f86g1SfL+DFUetHtW8pebJjnlbjmify7DVv5I3Td78Nozeg00jSdeQ== X-Received: by 10.99.120.65 with SMTP id t62mr9066801pgc.149.1486712688356; Thu, 09 Feb 2017 23:44:48 -0800 (PST) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id 82sm2686857pge.42.2017.02.09.23.44.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Feb 2017 23:44:47 -0800 (PST) From: Chris Zhong To: dri-devel@lists.freedesktop.org, kishon@ti.com, robh@kernel.org, linux-rockchip@lists.infradead.org Subject: [PATCH 4/4] drm/rockchip: cdn-dp: remove the DP phy switch Date: Fri, 10 Feb 2017 15:44:14 +0800 Message-Id: <1486712654-15431-5-git-send-email-zyw@rock-chips.com> X-Mailer: git-send-email 2.6.3 In-Reply-To: <1486712654-15431-1-git-send-email-zyw@rock-chips.com> References: <1486712654-15431-1-git-send-email-zyw@rock-chips.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170209_234510_159121_D5BD5722 X-CRM114-Status: UNSURE ( 9.29 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Heiko Stuebner , David Airlie , linux-kernel@vger.kernel.org, zyw@rock-chips.com, seanpaul@chromium.org, groeck@chromium.org, linux-arm-kernel@lists.infradead.org, mark.yao@rock-chips.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP There are 2 Type-c PHYs in RK3399, but only one DP controller. Hence only one PHY can connect to DP controller at one time, the other should be disconnected. The GRF_SOC_CON26 register has a switch bit to do it, set this bit means enable PHY 1, clear this bit means enable PHY 0. If the board has 2 Type-C ports, the DP driver get the phy id from devm_of_phy_get_by_index, and then control this switch according to this id. But some others board only has one Type-C port, it may be PHY 0 or PHY 1. The dts node id can not tell us the correct PHY id. Hence move this switch to PHY driver, the PHY driver can distinguish between PHY 0 and PHY 1, and then write the correct register bit. Signed-off-by: Chris Zhong --- drivers/gpu/drm/rockchip/cdn-dp-core.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c index 9ab67a6..d3f6e6b 100644 --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c @@ -43,8 +43,6 @@ #define GRF_SOC_CON9 0x6224 #define DP_SEL_VOP_LIT BIT(12) #define GRF_SOC_CON26 0x6268 -#define UPHY_SEL_BIT 3 -#define UPHY_SEL_MASK BIT(19) #define DPTX_HPD_SEL (3 << 12) #define DPTX_HPD_DEL (2 << 12) #define DPTX_HPD_SEL_MASK (3 << 28) @@ -403,11 +401,6 @@ static int cdn_dp_enable_phy(struct cdn_dp_device *dp, struct cdn_dp_port *port) union extcon_property_value property; int ret; - ret = cdn_dp_grf_write(dp, GRF_SOC_CON26, - (port->id << UPHY_SEL_BIT) | UPHY_SEL_MASK); - if (ret) - return ret; - if (!port->phy_enabled) { ret = phy_power_on(port->phy); if (ret) {