aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/omap2/dss/dss.h3
-rw-r--r--drivers/video/omap2/dss/hdmi.c35
-rw-r--r--drivers/video/omap2/dss/hdmi_panel.c29
3 files changed, 39 insertions, 28 deletions
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 3682e3f78426..ea39a994d1fd 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -484,7 +484,8 @@ static inline unsigned long hdmi_get_pixel_clock(void)
484#endif 484#endif
485int omapdss_hdmi_display_enable(struct omap_dss_device *dssdev); 485int omapdss_hdmi_display_enable(struct omap_dss_device *dssdev);
486void omapdss_hdmi_display_disable(struct omap_dss_device *dssdev); 486void omapdss_hdmi_display_disable(struct omap_dss_device *dssdev);
487void omapdss_hdmi_display_set_timing(struct omap_dss_device *dssdev); 487void omapdss_hdmi_display_set_timing(struct omap_dss_device *dssdev,
488 struct omap_video_timings *timings);
488int omapdss_hdmi_display_check_timing(struct omap_dss_device *dssdev, 489int omapdss_hdmi_display_check_timing(struct omap_dss_device *dssdev,
489 struct omap_video_timings *timings); 490 struct omap_video_timings *timings);
490int omapdss_hdmi_read_edid(u8 *buf, int len); 491int omapdss_hdmi_read_edid(u8 *buf, int len);
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index a65dafaa0d72..964a19500c0e 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -459,7 +459,6 @@ static void hdmi_compute_pll(struct omap_dss_device *dssdev, int phy,
459static int hdmi_power_on(struct omap_dss_device *dssdev) 459static int hdmi_power_on(struct omap_dss_device *dssdev)
460{ 460{
461 int r; 461 int r;
462 const struct hdmi_config *timing;
463 struct omap_video_timings *p; 462 struct omap_video_timings *p;
464 unsigned long phy; 463 unsigned long phy;
465 464
@@ -469,22 +468,10 @@ static int hdmi_power_on(struct omap_dss_device *dssdev)
469 468
470 dss_mgr_disable(dssdev->manager); 469 dss_mgr_disable(dssdev->manager);
471 470
472 p = &dssdev->panel.timings; 471 p = &hdmi.ip_data.cfg.timings;
473 472
474 DSSDBG("hdmi_power_on x_res= %d y_res = %d\n", 473 DSSDBG("hdmi_power_on x_res= %d y_res = %d\n", p->x_res, p->y_res);
475 dssdev->panel.timings.x_res,
476 dssdev->panel.timings.y_res);
477 474
478 timing = hdmi_get_timings();
479 if (timing == NULL) {
480 /* HDMI code 4 corresponds to 640 * 480 VGA */
481 hdmi.ip_data.cfg.cm.code = 4;
482 /* DVI mode 1 corresponds to HDMI 0 to DVI */
483 hdmi.ip_data.cfg.cm.mode = HDMI_DVI;
484 hdmi.ip_data.cfg = vesa_timings[0];
485 } else {
486 hdmi.ip_data.cfg = *timing;
487 }
488 phy = p->pixel_clock; 475 phy = p->pixel_clock;
489 476
490 hdmi_compute_pll(dssdev, phy, &hdmi.ip_data.pll_data); 477 hdmi_compute_pll(dssdev, phy, &hdmi.ip_data.pll_data);
@@ -521,7 +508,7 @@ static int hdmi_power_on(struct omap_dss_device *dssdev)
521 dispc_enable_gamma_table(0); 508 dispc_enable_gamma_table(0);
522 509
523 /* tv size */ 510 /* tv size */
524 dss_mgr_set_timings(dssdev->manager, &dssdev->panel.timings); 511 dss_mgr_set_timings(dssdev->manager, p);
525 512
526 r = hdmi.ip_data.ops->video_enable(&hdmi.ip_data); 513 r = hdmi.ip_data.ops->video_enable(&hdmi.ip_data);
527 if (r) 514 if (r)
@@ -568,13 +555,18 @@ int omapdss_hdmi_display_check_timing(struct omap_dss_device *dssdev,
568 555
569} 556}
570 557
571void omapdss_hdmi_display_set_timing(struct omap_dss_device *dssdev) 558void omapdss_hdmi_display_set_timing(struct omap_dss_device *dssdev,
559 struct omap_video_timings *timings)
572{ 560{
573 struct hdmi_cm cm; 561 struct hdmi_cm cm;
562 const struct hdmi_config *t;
574 563
575 cm = hdmi_get_code(&dssdev->panel.timings); 564 cm = hdmi_get_code(timings);
576 hdmi.ip_data.cfg.cm.code = cm.code; 565 hdmi.ip_data.cfg.cm = cm;
577 hdmi.ip_data.cfg.cm.mode = cm.mode; 566
567 t = hdmi_get_timings();
568 if (t != NULL)
569 hdmi.ip_data.cfg = *t;
578 570
579 if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) { 571 if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) {
580 int r; 572 int r;
@@ -585,7 +577,7 @@ void omapdss_hdmi_display_set_timing(struct omap_dss_device *dssdev)
585 if (r) 577 if (r)
586 DSSERR("failed to power on device\n"); 578 DSSERR("failed to power on device\n");
587 } else { 579 } else {
588 dss_mgr_set_timings(dssdev->manager, &dssdev->panel.timings); 580 dss_mgr_set_timings(dssdev->manager, &t->timings);
589 } 581 }
590} 582}
591 583
@@ -930,6 +922,7 @@ static int __init omapdss_hdmihw_probe(struct platform_device *pdev)
930 hdmi.ip_data.core_av_offset = HDMI_CORE_AV; 922 hdmi.ip_data.core_av_offset = HDMI_CORE_AV;
931 hdmi.ip_data.pll_offset = HDMI_PLLCTRL; 923 hdmi.ip_data.pll_offset = HDMI_PLLCTRL;
932 hdmi.ip_data.phy_offset = HDMI_PHY; 924 hdmi.ip_data.phy_offset = HDMI_PHY;
925
933 mutex_init(&hdmi.ip_data.lock); 926 mutex_init(&hdmi.ip_data.lock);
934 927
935 hdmi_panel_init(); 928 hdmi_panel_init();
diff --git a/drivers/video/omap2/dss/hdmi_panel.c b/drivers/video/omap2/dss/hdmi_panel.c
index e10844faadf9..2feb2cdfb60f 100644
--- a/drivers/video/omap2/dss/hdmi_panel.c
+++ b/drivers/video/omap2/dss/hdmi_panel.c
@@ -41,17 +41,32 @@ static struct {
41 41
42static int hdmi_panel_probe(struct omap_dss_device *dssdev) 42static int hdmi_panel_probe(struct omap_dss_device *dssdev)
43{ 43{
44 /* Initialize default timings to VGA in DVI mode */
45 const struct omap_video_timings default_timings = {
46 .x_res = 640,
47 .y_res = 480,
48 .pixel_clock = 25175,
49 .hsw = 96,
50 .hfp = 16,
51 .hbp = 48,
52 .vsw = 2,
53 .vfp = 11,
54 .vbp = 31,
55
56 .vsync_level = OMAPDSS_SIG_ACTIVE_LOW,
57 .hsync_level = OMAPDSS_SIG_ACTIVE_LOW,
58
59 .interlace = false,
60 };
61
44 DSSDBG("ENTER hdmi_panel_probe\n"); 62 DSSDBG("ENTER hdmi_panel_probe\n");
45 63
46 dssdev->panel.timings = (struct omap_video_timings) 64 dssdev->panel.timings = default_timings;
47 { 640, 480, 25175, 96, 16, 48, 2, 11, 31,
48 OMAPDSS_SIG_ACTIVE_LOW, OMAPDSS_SIG_ACTIVE_LOW,
49 false,
50 };
51 65
52 DSSDBG("hdmi_panel_probe x_res= %d y_res = %d\n", 66 DSSDBG("hdmi_panel_probe x_res= %d y_res = %d\n",
53 dssdev->panel.timings.x_res, 67 dssdev->panel.timings.x_res,
54 dssdev->panel.timings.y_res); 68 dssdev->panel.timings.y_res);
69
55 return 0; 70 return 0;
56} 71}
57 72
@@ -228,6 +243,8 @@ static int hdmi_panel_enable(struct omap_dss_device *dssdev)
228 goto err; 243 goto err;
229 } 244 }
230 245
246 omapdss_hdmi_display_set_timing(dssdev, &dssdev->panel.timings);
247
231 r = omapdss_hdmi_display_enable(dssdev); 248 r = omapdss_hdmi_display_enable(dssdev);
232 if (r) { 249 if (r) {
233 DSSERR("failed to power on\n"); 250 DSSERR("failed to power on\n");
@@ -336,8 +353,8 @@ static void hdmi_set_timings(struct omap_dss_device *dssdev,
336 */ 353 */
337 hdmi_panel_audio_disable(dssdev); 354 hdmi_panel_audio_disable(dssdev);
338 355
356 omapdss_hdmi_display_set_timing(dssdev, timings);
339 dssdev->panel.timings = *timings; 357 dssdev->panel.timings = *timings;
340 omapdss_hdmi_display_set_timing(dssdev);
341 358
342 mutex_unlock(&hdmi.lock); 359 mutex_unlock(&hdmi.lock);
343} 360}