From patchwork Fri Jun 23 09:36:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jose Abreu X-Patchwork-Id: 9808495 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 060E4603F4 for ; Mon, 26 Jun 2017 00:49:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C93226E39 for ; Mon, 26 Jun 2017 00:49:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0143B280FC; Mon, 26 Jun 2017 00:49:29 +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=-2.5 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, URIBL_BLACK 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 DF36926E39 for ; Mon, 26 Jun 2017 00:49:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C85716E1BE; Mon, 26 Jun 2017 00:49:23 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtprelay.synopsys.com (smtprelay4.synopsys.com [198.182.47.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id A78A96E753 for ; Fri, 23 Jun 2017 09:37:05 +0000 (UTC) Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id 5AC1024E100F; Fri, 23 Jun 2017 02:37:04 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 35CFEBAD; Fri, 23 Jun 2017 02:37:04 -0700 (PDT) Received: from joabreu-VirtualBox.internal.synopsys.com (joabreu-e7440.internal.synopsys.com [10.107.19.66]) by mailhost.synopsys.com (Postfix) with ESMTP id EC92BB7D; Fri, 23 Jun 2017 02:37:01 -0700 (PDT) From: Jose Abreu To: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] drm: bridge: synopsys/dw-hdmi: Provide default configuration function for HDMI 2.0 PHY Date: Fri, 23 Jun 2017 10:36:44 +0100 Message-Id: <185ccf7d4473fa557044732402ca20b3d4007952.1498209896.git.joabreu@synopsys.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 26 Jun 2017 00:49:20 +0000 Cc: Jose Abreu , Laurent Pinchart , Carlos Palminha , Kieran Bingham 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 Currently HDMI 2.0 PHYs do not have a default configuration function. As *some* of the HDMI 2.0 PHYs have the same register layout as the 3D PHYs we can provide the same default configuration function for both and still let user overwrite this with custom configuration function if needed. If, for some reason, the PHY is custom or has a register different register layout then custom configuration function *must* be provided in order for the system to work correctly. As we prefer the pdata provided configuration function over the internal one this change will not make any impact in custom platforms. This patch is based on today's drm-misc-next branch. Signed-off-by: Jose Abreu Tested-by: Mark Yao Cc: Kieran Bingham Cc: Laurent Pinchart Cc: Archit Taneja Cc: Andrzej Hajda Cc: Mark Yao Cc: Carlos Palminha Cc: Heiko Stübner Changes in v2: - Rebased and refrased commit message Reviewed-by: Laurent Pinchart --- Hi All, There as been a little confusion about dw-hdmi phys so I will expand a little bit here so that I can base my decision about this patch and why does it only works in some platforms. First, if you read dw-hdmi.c code, you will see that there is an identification register for the phy type being used. Unfortunatelly, this only states the phy type and not the phy version. Second, we have many HDMI 2.0 phys (so, same phy type: 0xf3) but, as you may have guessed, HW team decided to change regbank between some versions. Third and last, each phy in a SoC has unique characteristics, so each phy (event if they are the same version) will have different PLL configuration parameters. Given all this I managed to conclude that Mark's phy is still an HDMI 2.0 phy but with the same register layout as previous 3D PHY's. I found at least 2 phys with the same register layout and only 1 phy which has a different layout, so I think majority wins here and we should let the default configuration function for HDMI 2.0 phys be the same one as the 3D. Short story: There is no way to correctly identify, at runtime, the phy version being used by the controller so we can't provide a default configuration function. We can, however assume that most of the HDMI 2.0 phys will have the 3D layout BUT each developer must confirm that the layout in its SoC is the expected one and if not, provide a custom configuration function. Best regards, Jose Miguel Abreu drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index ead1124..10c8d8c 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -2170,6 +2170,7 @@ static irqreturn_t dw_hdmi_irq(int irq, void *dev_id) .name = "DWC HDMI 2.0 TX PHY", .gen = 2, .has_svsret = true, + .configure = hdmi_phy_configure_dwc_hdmi_3d_tx, }, { .type = DW_HDMI_PHY_VENDOR_PHY, .name = "Vendor PHY",