diff options
author | Inki Dae <inki.dae@samsung.com> | 2014-05-09 16:46:10 +0900 |
---|---|---|
committer | Inki Dae <daeinki@gmail.com> | 2014-06-02 02:07:08 +0900 |
commit | e2a562dce87c34c44b1981dea31f93b0eb50614c (patch) | |
tree | 7aeeefbecda23b4a5f58a73835cd207220276c10 /drivers/gpu/drm/exynos/exynos_hdmi.c | |
parent | 9a8e1cb036b35d61089d374db2d4294afac9be43 (diff) | |
download | lwn-e2a562dce87c34c44b1981dea31f93b0eb50614c.tar.gz lwn-e2a562dce87c34c44b1981dea31f93b0eb50614c.zip |
drm/exynos: hdmi: consider legacy dt binding
This patch considers legacy dt binding, and resolves
the issue that the use of existing dtb is broken.
To resove the dt broken issue, this path tries to get
legacy dt nodes from existing dtb directly prior to
getting new dt nodes.
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/exynos/exynos_hdmi.c')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_hdmi.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index b03e721270aa..ed6176ebfbcd 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -2242,6 +2242,25 @@ static const struct component_ops hdmi_component_ops = { .unbind = hdmi_unbind, }; +static struct device_node *hdmi_legacy_ddc_dt_binding(struct device *dev) +{ + const char *compatible_str = "samsung,exynos4210-hdmiddc"; + struct device_node *np; + + np = of_find_compatible_node(NULL, NULL, compatible_str); + if (np) + return of_get_next_parent(np); + + return NULL; +} + +static struct device_node *hdmi_legacy_phy_dt_binding(struct device *dev) +{ + const char *compatible_str = "samsung,exynos4212-hdmiphy"; + + return of_find_compatible_node(NULL, NULL, compatible_str); +} + static int hdmi_probe(struct platform_device *pdev) { struct device_node *ddc_node, *phy_node; @@ -2297,18 +2316,28 @@ static int hdmi_probe(struct platform_device *pdev) return ret; } + ddc_node = hdmi_legacy_ddc_dt_binding(dev); + if (ddc_node) + goto out_get_ddc_adpt; + /* DDC i2c driver */ ddc_node = of_parse_phandle(dev->of_node, "ddc", 0); if (!ddc_node) { DRM_ERROR("Failed to find ddc node in device tree\n"); return -ENODEV; } + +out_get_ddc_adpt: hdata->ddc_adpt = of_find_i2c_adapter_by_node(ddc_node); if (!hdata->ddc_adpt) { DRM_ERROR("Failed to get ddc i2c adapter by node\n"); return -ENODEV; } + phy_node = hdmi_legacy_phy_dt_binding(dev); + if (phy_node) + goto out_get_phy_port; + /* hdmiphy i2c driver */ phy_node = of_parse_phandle(dev->of_node, "phy", 0); if (!phy_node) { @@ -2317,6 +2346,7 @@ static int hdmi_probe(struct platform_device *pdev) goto err_ddc; } +out_get_phy_port: if (drv_data->is_apb_phy) { hdata->regs_hdmiphy = of_iomap(phy_node, 0); if (!hdata->regs_hdmiphy) { |