diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2013-07-30 03:37:34 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2014-03-19 05:03:10 -0400 |
commit | 0b8879f4714b6d372f240555d8366c8c3ea45c32 (patch) | |
tree | ad860be68444a94e59913587e425bb6cce714ff2 /drivers/video | |
parent | 5e4c89c018751e831b2687b926bd956a16a4a777 (diff) |
OMAPDSS: hdmi-connector: Add DT support
Add DT support for hdmi-connector.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Archit Taneja <archit@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/omap2/displays-new/connector-hdmi.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/video/omap2/displays-new/connector-hdmi.c b/drivers/video/omap2/displays-new/connector-hdmi.c index 9abe2c039ae9..2e026eab2dd0 100644 --- a/drivers/video/omap2/displays-new/connector-hdmi.c +++ b/drivers/video/omap2/displays-new/connector-hdmi.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/slab.h> | 12 | #include <linux/slab.h> |
13 | #include <linux/module.h> | 13 | #include <linux/module.h> |
14 | #include <linux/platform_device.h> | 14 | #include <linux/platform_device.h> |
15 | #include <linux/of.h> | ||
15 | 16 | ||
16 | #include <drm/drm_edid.h> | 17 | #include <drm/drm_edid.h> |
17 | 18 | ||
@@ -301,6 +302,23 @@ static int hdmic_probe_pdata(struct platform_device *pdev) | |||
301 | return 0; | 302 | return 0; |
302 | } | 303 | } |
303 | 304 | ||
305 | static int hdmic_probe_of(struct platform_device *pdev) | ||
306 | { | ||
307 | struct panel_drv_data *ddata = platform_get_drvdata(pdev); | ||
308 | struct device_node *node = pdev->dev.of_node; | ||
309 | struct omap_dss_device *in; | ||
310 | |||
311 | in = omapdss_of_find_source_for_first_ep(node); | ||
312 | if (IS_ERR(in)) { | ||
313 | dev_err(&pdev->dev, "failed to find video source\n"); | ||
314 | return PTR_ERR(in); | ||
315 | } | ||
316 | |||
317 | ddata->in = in; | ||
318 | |||
319 | return 0; | ||
320 | } | ||
321 | |||
304 | static int hdmic_probe(struct platform_device *pdev) | 322 | static int hdmic_probe(struct platform_device *pdev) |
305 | { | 323 | { |
306 | struct panel_drv_data *ddata; | 324 | struct panel_drv_data *ddata; |
@@ -318,6 +336,10 @@ static int hdmic_probe(struct platform_device *pdev) | |||
318 | r = hdmic_probe_pdata(pdev); | 336 | r = hdmic_probe_pdata(pdev); |
319 | if (r) | 337 | if (r) |
320 | return r; | 338 | return r; |
339 | } else if (pdev->dev.of_node) { | ||
340 | r = hdmic_probe_of(pdev); | ||
341 | if (r) | ||
342 | return r; | ||
321 | } else { | 343 | } else { |
322 | return -ENODEV; | 344 | return -ENODEV; |
323 | } | 345 | } |
@@ -359,12 +381,20 @@ static int __exit hdmic_remove(struct platform_device *pdev) | |||
359 | return 0; | 381 | return 0; |
360 | } | 382 | } |
361 | 383 | ||
384 | static const struct of_device_id hdmic_of_match[] = { | ||
385 | { .compatible = "omapdss,hdmi-connector", }, | ||
386 | {}, | ||
387 | }; | ||
388 | |||
389 | MODULE_DEVICE_TABLE(of, hdmic_of_match); | ||
390 | |||
362 | static struct platform_driver hdmi_connector_driver = { | 391 | static struct platform_driver hdmi_connector_driver = { |
363 | .probe = hdmic_probe, | 392 | .probe = hdmic_probe, |
364 | .remove = __exit_p(hdmic_remove), | 393 | .remove = __exit_p(hdmic_remove), |
365 | .driver = { | 394 | .driver = { |
366 | .name = "connector-hdmi", | 395 | .name = "connector-hdmi", |
367 | .owner = THIS_MODULE, | 396 | .owner = THIS_MODULE, |
397 | .of_match_table = hdmic_of_match, | ||
368 | }, | 398 | }, |
369 | }; | 399 | }; |
370 | 400 | ||