diff options
author | Marek Belisko <marek@goldelico.com> | 2014-05-08 16:16:50 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2014-05-09 05:35:51 -0400 |
commit | 1f32450911dfa243b8ff79cef62d2ddaeeb3e033 (patch) | |
tree | 7ab32b95fd38136fdb6892e2e36726b00f8239a5 | |
parent | 02b7a32083b9930543663720758de249b4f6a2a3 (diff) |
omapdss: panel-tpo-td028ec1: Add DT support.
Signed-off-by: Marek Belisko <marek@goldelico.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r-- | Documentation/devicetree/bindings/video/toppoly,td028ttec1.txt | 30 | ||||
-rw-r--r-- | arch/arm/mach-omap2/display.c | 1 | ||||
-rw-r--r-- | drivers/video/fbdev/omap2/displays-new/panel-tpo-td028ttec1.c | 32 |
3 files changed, 62 insertions, 1 deletions
diff --git a/Documentation/devicetree/bindings/video/toppoly,td028ttec1.txt b/Documentation/devicetree/bindings/video/toppoly,td028ttec1.txt new file mode 100644 index 000000000000..7175dc3740ac --- /dev/null +++ b/Documentation/devicetree/bindings/video/toppoly,td028ttec1.txt | |||
@@ -0,0 +1,30 @@ | |||
1 | Toppoly TD028TTEC1 Panel | ||
2 | ======================== | ||
3 | |||
4 | Required properties: | ||
5 | - compatible: "toppoly,td028ttec1" | ||
6 | |||
7 | Optional properties: | ||
8 | - label: a symbolic name for the panel | ||
9 | |||
10 | Required nodes: | ||
11 | - Video port for DPI input | ||
12 | |||
13 | Example | ||
14 | ------- | ||
15 | |||
16 | lcd-panel: td028ttec1@0 { | ||
17 | compatible = "toppoly,td028ttec1"; | ||
18 | reg = <0>; | ||
19 | spi-max-frequency = <100000>; | ||
20 | spi-cpol; | ||
21 | spi-cpha; | ||
22 | |||
23 | label = "lcd"; | ||
24 | port { | ||
25 | lcd_in: endpoint { | ||
26 | remote-endpoint = <&dpi_out>; | ||
27 | }; | ||
28 | }; | ||
29 | }; | ||
30 | |||
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c index 16d33d831287..66a2ee030b21 100644 --- a/arch/arm/mach-omap2/display.c +++ b/arch/arm/mach-omap2/display.c | |||
@@ -566,6 +566,7 @@ static const char * const dss_compat_conv_list[] __initconst = { | |||
566 | "svideo-connector", | 566 | "svideo-connector", |
567 | "ti,tfp410", | 567 | "ti,tfp410", |
568 | "ti,tpd12s015", | 568 | "ti,tpd12s015", |
569 | "toppoly,td028ttec1", | ||
569 | }; | 570 | }; |
570 | 571 | ||
571 | /* prepend compatible string with "omapdss," */ | 572 | /* prepend compatible string with "omapdss," */ |
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..5b3466e953b2 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,6 +499,7 @@ 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 | ||