From patchwork Sat Sep 30 01:46:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: crj X-Patchwork-Id: 9979005 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 849EF60311 for ; Sat, 30 Sep 2017 01:46:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 75D19297A4 for ; Sat, 30 Sep 2017 01:46:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6AAD5298AA; Sat, 30 Sep 2017 01:46:49 +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.7 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB 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 3685B297A4 for ; Sat, 30 Sep 2017 01:46:48 +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=l+XpoZcfy02iK+tAmxg511/GeHf+zRX+pTlsK5eml9Q=; b=oRzi9kmRgahq3MBz/TbAoVr0c+ jn+jpAFOsXoBJSgNMdt2ndHOg6db7yK8BTF7R7+BJpd1hcTFJaIDtVCcEBhlXR9Tp4qwpPCZSWyEJ f14kXvRpdoX9Nf3nSeMaBcMrS/5Fmh5alp8K6aKDhbcsDeRmYgBB1mBSVEmilzfumbHG6tJyNma2e wJRnHa8IpgMF+WLA3mfEnnF9KWSwiSTn7IoCN2KK7iZ9vSvmYKeTapNsI2HpwwJoEbhJsmfL4wjqO ZjBlnb2XXKDzKSM12cPMO1DsAfPcywg5eXayUxczfkwgPGlO4HU+ObiQIxXeSILiv7MOmtMHZe49T J/1IpHfA==; 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 1dy6rf-0000NI-TE; Sat, 30 Sep 2017 01:46:47 +0000 Received: from regular1.263xmail.com ([211.150.99.134]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dy6rc-0000A1-R4 for linux-rockchip@lists.infradead.org; Sat, 30 Sep 2017 01:46:46 +0000 Received: from algea.cao?rock-chips.com (unknown [192.168.167.12]) by regular1.263xmail.com (Postfix) with ESMTP id 5860B911D; Sat, 30 Sep 2017 09:46:22 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.263.net (Postfix) with ESMTPA id B6A163B2; Sat, 30 Sep 2017 09:46:19 +0800 (CST) X-RL-SENDER: algea.cao@rock-chips.com X-FST-TO: daniel.vetter@intel.com X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: algea.cao@rock-chips.com X-UNIQUE-TAG: <0185fcb9ab105afee0920ac113c8a12f> X-ATTACHMENT-NUM: 0 X-SENDER: algea.cao@rock-chips.com X-DNS-TYPE: 0 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (Postfix) whith ESMTP id 1644C744LD; Sat, 30 Sep 2017 09:46:22 +0800 (CST) From: Algea Cao To: daniel.vetter@intel.com, jani.nikula@linux.intel.com, seanpaul@chromium.org, airlied@linux.ie, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org Subject: [PATCH v2 7/7] drm: bridge: dw-hdmi: get phy ops by device type Date: Sat, 30 Sep 2017 09:46:16 +0800 Message-Id: <1506735976-153815-1-git-send-email-algea.cao@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1506735713-147081-0> References: <1506735713-147081-0> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170929_184645_276486_6049F405 X-CRM114-Status: UNSURE ( 7.45 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Algea Cao , yang.zheng@rock-chips.com, kever.yang@rock-chips.com, mark.yao@rock-chips.com MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add device type to distinguish different chips.Different chips use different phy ops, get them by device type. Signed-off-by: Algea Cao --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index 34eeaf6..b414aef 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -144,6 +144,7 @@ struct dw_hdmi { const struct dw_hdmi_plat_data *plat_data; int vic; + enum dw_hdmi_devtype dev_type; u8 edid[HDMI_EDID_LEN]; bool cable_plugin; @@ -2202,7 +2203,9 @@ static int dw_hdmi_detect_phy(struct dw_hdmi *hdmi) phy_type = hdmi_readb(hdmi, HDMI_CONFIG2_ID); - if (phy_type == DW_HDMI_PHY_VENDOR_PHY) { + if (phy_type == DW_HDMI_PHY_VENDOR_PHY || + hdmi->dev_type == RK3328_HDMI || + hdmi->dev_type == RK3228_HDMI) { /* Vendor PHYs require support from the glue layer. */ if (!hdmi->plat_data->phy_ops || !hdmi->plat_data->phy_name) { dev_err(hdmi->dev, @@ -2298,6 +2301,7 @@ __dw_hdmi_probe(struct platform_device *pdev, if (!hdmi) return ERR_PTR(-ENOMEM); + hdmi->dev_type = plat_data->dev_type; hdmi->plat_data = plat_data; hdmi->dev = dev; hdmi->sample_rate = 48000;