aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/dss/hdmi.c
diff options
context:
space:
mode:
authorArchit Taneja <archit@ti.com>2012-08-08 07:20:42 -0400
committerArchit Taneja <archit@ti.com>2012-08-15 06:12:43 -0400
commit7849398fa28c21dad24292b838b059a862f99f16 (patch)
tree214847fc07fa918b3d269f17c1c9133ae9698e86 /drivers/video/omap2/dss/hdmi.c
parent55cd63acf6855cd45a183fdfca6d22450b8d1d47 (diff)
OMAPDSS: HDMI: Use our own omap_video_timings field when setting interface timings
The hdmi driver currently updates only the 'code' member of hdmi_config when the op omapdss_hdmi_display_set_timing() is called by the hdmi panel driver. The 'timing' field of hdmi_config is updated only when hdmi_power_on is called. It makes more sense to configure the whole hdmi_config field in the set_timing op called by the panel driver. This way, we don't need to call both functions to ensure that our hdmi_config is configured correctly. Also, we don't need to calculate hdmi_config during hdmi_power_on, or rely on the omap_video_timings in the panel's omap_dss_device struct. The default timings of the hdmi panel are represented in a cleaner form. Since the hdmi output is now configured by it's own copy of timings (in hdmi.ip_data.cfg), the panel driver needs to set it to a valid value before enabling hdmi output. We now call omapdss_hdmi_set_timing() before enabling hdmi output, this is done to atleast have the hdmi output configured to the panel's default timings if the DSS user didn't call panel driver's set_timings() op explicitly. Signed-off-by: Archit Taneja <archit@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss/hdmi.c')
-rw-r--r--drivers/video/omap2/dss/hdmi.c35
1 files changed, 14 insertions, 21 deletions
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();