diff options
Diffstat (limited to 'drivers/video/fbdev/omap2/displays-new/panel-tpo-td028ttec1.c')
-rw-r--r-- | drivers/video/fbdev/omap2/displays-new/panel-tpo-td028ttec1.c | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/drivers/video/fbdev/omap2/displays-new/panel-tpo-td028ttec1.c b/drivers/video/fbdev/omap2/displays-new/panel-tpo-td028ttec1.c index fae6adc005a7..728808bcceeb 100644 --- a/drivers/video/fbdev/omap2/displays-new/panel-tpo-td028ttec1.c +++ b/drivers/video/fbdev/omap2/displays-new/panel-tpo-td028ttec1.c | |||
@@ -206,7 +206,8 @@ static int td028ttec1_panel_enable(struct omap_dss_device *dssdev) | |||
206 | if (omapdss_device_is_enabled(dssdev)) | 206 | if (omapdss_device_is_enabled(dssdev)) |
207 | return 0; | 207 | return 0; |
208 | 208 | ||
209 | in->ops.dpi->set_data_lines(in, ddata->data_lines); | 209 | if (ddata->data_lines) |
210 | in->ops.dpi->set_data_lines(in, ddata->data_lines); | ||
210 | in->ops.dpi->set_timings(in, &ddata->videomode); | 211 | in->ops.dpi->set_timings(in, &ddata->videomode); |
211 | 212 | ||
212 | r = in->ops.dpi->enable(in); | 213 | r = in->ops.dpi->enable(in); |
@@ -389,6 +390,23 @@ static int td028ttec1_panel_probe_pdata(struct spi_device *spi) | |||
389 | return 0; | 390 | return 0; |
390 | } | 391 | } |
391 | 392 | ||
393 | static int td028ttec1_probe_of(struct spi_device *spi) | ||
394 | { | ||
395 | struct device_node *node = spi->dev.of_node; | ||
396 | struct panel_drv_data *ddata = dev_get_drvdata(&spi->dev); | ||
397 | struct omap_dss_device *in; | ||
398 | |||
399 | in = omapdss_of_find_source_for_first_ep(node); | ||
400 | if (IS_ERR(in)) { | ||
401 | dev_err(&spi->dev, "failed to find video source\n"); | ||
402 | return PTR_ERR(in); | ||
403 | } | ||
404 | |||
405 | ddata->in = in; | ||
406 | |||
407 | return 0; | ||
408 | } | ||
409 | |||
392 | static int td028ttec1_panel_probe(struct spi_device *spi) | 410 | static int td028ttec1_panel_probe(struct spi_device *spi) |
393 | { | 411 | { |
394 | struct panel_drv_data *ddata; | 412 | struct panel_drv_data *ddata; |
@@ -418,6 +436,10 @@ static int td028ttec1_panel_probe(struct spi_device *spi) | |||
418 | r = td028ttec1_panel_probe_pdata(spi); | 436 | r = td028ttec1_panel_probe_pdata(spi); |
419 | if (r) | 437 | if (r) |
420 | return r; | 438 | return r; |
439 | } else if (spi->dev.of_node) { | ||
440 | r = td028ttec1_probe_of(spi); | ||
441 | if (r) | ||
442 | return r; | ||
421 | } else { | 443 | } else { |
422 | return -ENODEV; | 444 | return -ENODEV; |
423 | } | 445 | } |
@@ -463,6 +485,13 @@ static int td028ttec1_panel_remove(struct spi_device *spi) | |||
463 | return 0; | 485 | return 0; |
464 | } | 486 | } |
465 | 487 | ||
488 | static const struct of_device_id td028ttec1_of_match[] = { | ||
489 | { .compatible = "omapdss,toppoly,td028ttec1", }, | ||
490 | {}, | ||
491 | }; | ||
492 | |||
493 | MODULE_DEVICE_TABLE(of, td028ttec1_of_match); | ||
494 | |||
466 | static struct spi_driver td028ttec1_spi_driver = { | 495 | static struct spi_driver td028ttec1_spi_driver = { |
467 | .probe = td028ttec1_panel_probe, | 496 | .probe = td028ttec1_panel_probe, |
468 | .remove = td028ttec1_panel_remove, | 497 | .remove = td028ttec1_panel_remove, |
@@ -470,11 +499,13 @@ static struct spi_driver td028ttec1_spi_driver = { | |||
470 | .driver = { | 499 | .driver = { |
471 | .name = "panel-tpo-td028ttec1", | 500 | .name = "panel-tpo-td028ttec1", |
472 | .owner = THIS_MODULE, | 501 | .owner = THIS_MODULE, |
502 | .of_match_table = td028ttec1_of_match, | ||
473 | }, | 503 | }, |
474 | }; | 504 | }; |
475 | 505 | ||
476 | module_spi_driver(td028ttec1_spi_driver); | 506 | module_spi_driver(td028ttec1_spi_driver); |
477 | 507 | ||
508 | MODULE_ALIAS("spi:toppoly,td028ttec1"); | ||
478 | MODULE_AUTHOR("H. Nikolaus Schaller <hns@goldelico.com>"); | 509 | MODULE_AUTHOR("H. Nikolaus Schaller <hns@goldelico.com>"); |
479 | MODULE_DESCRIPTION("Toppoly TD028TTEC1 panel driver"); | 510 | MODULE_DESCRIPTION("Toppoly TD028TTEC1 panel driver"); |
480 | MODULE_LICENSE("GPL"); | 511 | MODULE_LICENSE("GPL"); |