All of lore.kernel.org
 help / color / mirror / Atom feed
From: Algea Cao <algea.cao@rock-chips.com>
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
Cc: kever.yang@rock-chips.com, mark.yao@rock-chips.com,
	yang.zheng@rock-chips.com, Algea Cao <algea.cao@rock-chips.com>
Subject: [PATCH v2 7/7] drm: bridge: dw-hdmi: get phy ops by device type
Date: Sat, 30 Sep 2017 09:46:16 +0800	[thread overview]
Message-ID: <1506735976-153815-1-git-send-email-algea.cao@rock-chips.com> (raw)
In-Reply-To: <1506735713-147081-0>

Add device type to distinguish different chips.Different chips
use different phy ops, get them by device type.

Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
---
 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;
-- 
2.7.4

      parent reply	other threads:[~2017-09-30  1:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1506735713-147081-0>
2017-09-30  1:43 ` [PATCH v2 1/7] drm/rockchip: dw_hdmi: update dw_hdmi_rockchip_dt_ids Algea Cao
2017-09-30  1:43 ` [PATCH v2 2/7] drm/rockchip: dw_hdmi: add device type Algea Cao
2017-10-03  9:52   ` Neil Armstrong
2017-10-03  9:52     ` Neil Armstrong
2017-09-30  1:44 ` [PATCH v2 3/7] drm: bridge: dw-hdmi: change hdmi phy hpd read function to export Algea Cao
2017-09-30  1:44 ` [PATCH v2 4/7] drm/rockchip: dw_hdmi: add inno hdmi phy ops Algea Cao
2017-12-09 17:09   ` Heiko Stuebner
2017-12-09 17:09     ` Heiko Stuebner
2017-09-30  1:45 ` [PATCH v2 5/7] drm/rockchip: dw_hdmi: add hclk_vio Algea Cao
2017-12-10 17:08   ` Heiko Stuebner
2017-12-10 17:08     ` Heiko Stuebner
2017-09-30  1:45 ` [PATCH v2 6/7] drm/rockchip: dw_hdmi: update dw-hdmi encoder enable Algea Cao
2017-09-30  1:46 ` Algea Cao [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1506735976-153815-1-git-send-email-algea.cao@rock-chips.com \
    --to=algea.cao@rock-chips.com \
    --cc=airlied@linux.ie \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=kever.yang@rock-chips.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mark.yao@rock-chips.com \
    --cc=seanpaul@chromium.org \
    --cc=yang.zheng@rock-chips.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.