From patchwork Mon Feb 5 14:34:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Heiko_St=C3=BCbner?= X-Patchwork-Id: 10200493 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 D7D89601A1 for ; Mon, 5 Feb 2018 14:35:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C7C9E2875A for ; Mon, 5 Feb 2018 14:35:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BBC1E2875C; Mon, 5 Feb 2018 14:35:25 +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.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham 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 40F2D2874E for ; Mon, 5 Feb 2018 14:35:25 +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=ijIUD9s9tVexDLy/o8nSOKMVCIgfyXU/A7AKfO1nZJY=; b=gfTTvqAuoJTnLFfzo7dCwvoYM/ pVjizorDg1vR5unWsVJsYbGj5H6NegrPImRpoGHLHU41rBsWZtsOKOgEuWw+jJPybzIXlQrv3TPIt mBWMHYzLiyQA3jSBUM/KdcvSF+yW8FhcBT1WR82V55VkK5p+qcVVL+1lOzLRT+qrv+TxfzapllHwc 6iiXBROyKXMOY8Rs1RoUX7ALvtzPmo7kOccx8oVHWdHG/jRhzuvimVd6zzuZ539CJHve054wZUvin gQvb4DO4mrEfAntQRK/8bKdJ2x57jv66MRlFl8CSrAGvAB5NM42nNuNdr5JbsC9giW8R6veYNSHRM V7QbnvEw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eihrg-00005y-5z; Mon, 05 Feb 2018 14:35:24 +0000 Received: from gloria.sntech.de ([95.129.55.99]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eihrb-0007gh-DU; Mon, 05 Feb 2018 14:35:21 +0000 Received: from ip9234b6d7.dynamic.kabel-deutschland.de ([146.52.182.215] helo=phil.fritz.box) by gloria.sntech.de with esmtpsa (TLS1.1:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1eihrC-0005IM-JT; Mon, 05 Feb 2018 15:34:54 +0100 From: Heiko Stuebner To: hjc@rock-chips.com, architt@codeaurora.org, a.hajda@samsung.com, kishon@ti.com Subject: [PATCH 3/9] drm/bridge: dw-hdmi: allow overriding of phy-type reading Date: Mon, 5 Feb 2018 15:34:29 +0100 Message-Id: <20180205143435.4723-4-heiko@sntech.de> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180205143435.4723-1-heiko@sntech.de> References: <20180205143435.4723-1-heiko@sntech.de> 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: mark.rutland@arm.com, Jose.Abreu@synopsys.com, algea.cao@rock-chips.com, Heiko Stuebner , devicetree@vger.kernel.org, airlied@linux.ie, dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, robh+dt@kernel.org, Laurent.pinchart@ideasonboard.com, linux-arm-kernel@lists.infradead.org, zhengyang@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 In some IP implementations the reading of the phy-type may be broken. One example are the Rockchip rk3228 and rk3328 socs that use a separate phy from Innosilicon but still report the HDMI20_TX type. So allow the glue driver to force a specific type, like the vendor-phy for these cases. Signed-off-by: Heiko Stuebner --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 4 +++- include/drm/bridge/dw_hdmi.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index a38db40ce990..7255fafce089 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -2200,7 +2200,9 @@ static int dw_hdmi_detect_phy(struct dw_hdmi *hdmi) unsigned int i; u8 phy_type; - phy_type = hdmi_readb(hdmi, HDMI_CONFIG2_ID); + phy_type = (hdmi->plat_data->phy_force_type) ? + hdmi->plat_data->phy_force_type : + hdmi_readb(hdmi, HDMI_CONFIG2_ID); if (phy_type == DW_HDMI_PHY_VENDOR_PHY) { /* Vendor PHYs require support from the glue layer. */ diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h index 182f83283e24..c5bc2804b29e 100644 --- a/include/drm/bridge/dw_hdmi.h +++ b/include/drm/bridge/dw_hdmi.h @@ -133,6 +133,7 @@ struct dw_hdmi_plat_data { const struct dw_hdmi_phy_ops *phy_ops; const char *phy_name; void *phy_data; + u8 phy_force_type; /* Synopsys PHY support */ const struct dw_hdmi_mpll_config *mpll_cfg;