aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorInki Dae <inki.dae@samsung.com>2014-05-09 03:46:10 -0400
committerInki Dae <daeinki@gmail.com>2014-06-01 13:07:08 -0400
commite2a562dce87c34c44b1981dea31f93b0eb50614c (patch)
tree7aeeefbecda23b4a5f58a73835cd207220276c10
parent9a8e1cb036b35d61089d374db2d4294afac9be43 (diff)
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>
-rw-r--r--drivers/gpu/drm/exynos/exynos_hdmi.c30
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 = {
2242 .unbind = hdmi_unbind, 2242 .unbind = hdmi_unbind,
2243}; 2243};
2244 2244
2245static struct device_node *hdmi_legacy_ddc_dt_binding(struct device *dev)
2246{
2247 const char *compatible_str = "samsung,exynos4210-hdmiddc";
2248 struct device_node *np;
2249
2250 np = of_find_compatible_node(NULL, NULL, compatible_str);
2251 if (np)
2252 return of_get_next_parent(np);
2253
2254 return NULL;
2255}
2256
2257static struct device_node *hdmi_legacy_phy_dt_binding(struct device *dev)
2258{
2259 const char *compatible_str = "samsung,exynos4212-hdmiphy";
2260
2261 return of_find_compatible_node(NULL, NULL, compatible_str);
2262}
2263
2245static int hdmi_probe(struct platform_device *pdev) 2264static int hdmi_probe(struct platform_device *pdev)
2246{ 2265{
2247 struct device_node *ddc_node, *phy_node; 2266 struct device_node *ddc_node, *phy_node;
@@ -2297,18 +2316,28 @@ static int hdmi_probe(struct platform_device *pdev)
2297 return ret; 2316 return ret;
2298 } 2317 }
2299 2318
2319 ddc_node = hdmi_legacy_ddc_dt_binding(dev);
2320 if (ddc_node)
2321 goto out_get_ddc_adpt;
2322
2300 /* DDC i2c driver */ 2323 /* DDC i2c driver */
2301 ddc_node = of_parse_phandle(dev->of_node, "ddc", 0); 2324 ddc_node = of_parse_phandle(dev->of_node, "ddc", 0);
2302 if (!ddc_node) { 2325 if (!ddc_node) {
2303 DRM_ERROR("Failed to find ddc node in device tree\n"); 2326 DRM_ERROR("Failed to find ddc node in device tree\n");
2304 return -ENODEV; 2327 return -ENODEV;
2305 } 2328 }
2329
2330out_get_ddc_adpt:
2306 hdata->ddc_adpt = of_find_i2c_adapter_by_node(ddc_node); 2331 hdata->ddc_adpt = of_find_i2c_adapter_by_node(ddc_node);
2307 if (!hdata->ddc_adpt) { 2332 if (!hdata->ddc_adpt) {
2308 DRM_ERROR("Failed to get ddc i2c adapter by node\n"); 2333 DRM_ERROR("Failed to get ddc i2c adapter by node\n");
2309 return -ENODEV; 2334 return -ENODEV;
2310 } 2335 }
2311 2336
2337 phy_node = hdmi_legacy_phy_dt_binding(dev);
2338 if (phy_node)
2339 goto out_get_phy_port;
2340
2312 /* hdmiphy i2c driver */ 2341 /* hdmiphy i2c driver */
2313 phy_node = of_parse_phandle(dev->of_node, "phy", 0); 2342 phy_node = of_parse_phandle(dev->of_node, "phy", 0);
2314 if (!phy_node) { 2343 if (!phy_node) {
@@ -2317,6 +2346,7 @@ static int hdmi_probe(struct platform_device *pdev)
2317 goto err_ddc; 2346 goto err_ddc;
2318 } 2347 }
2319 2348
2349out_get_phy_port:
2320 if (drv_data->is_apb_phy) { 2350 if (drv_data->is_apb_phy) {
2321 hdata->regs_hdmiphy = of_iomap(phy_node, 0); 2351 hdata->regs_hdmiphy = of_iomap(phy_node, 0);
2322 if (!hdata->regs_hdmiphy) { 2352 if (!hdata->regs_hdmiphy) {