aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2
diff options
context:
space:
mode:
authorMythri P K <mythripk@ti.com>2011-09-08 09:36:20 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-09-30 09:16:31 -0400
commit38863b7e1d22ca83614cf61ba73bd97a1355524d (patch)
treeb8f26657f37c3c513b42e88d625dd2ee9fd9154f /drivers/video/omap2
parent7b27da548389cede637653033211369a2c9678f7 (diff)
OMAP4: DSS2: HDMI: Use specific HDMI timings structure
As hdmi has few additional parameters such as vsync and hsync polarity which is missing in DSS timing structure, define HDMI timings structure for hdmi to use instead of OMAP DSS timing structure. Signed-off-by: Mythri P K <mythripk@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2')
-rw-r--r--drivers/video/omap2/dss/hdmi.c23
-rw-r--r--drivers/video/omap2/dss/hdmi.h15
2 files changed, 34 insertions, 4 deletions
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index 47e9f4abe322..c387bf47ee0e 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -534,6 +534,21 @@ static int read_edid(struct hdmi_ip_data *ip_data, u8 *pedid, u16 max_length)
534 return 0; 534 return 0;
535} 535}
536 536
537static void copy_hdmi_to_dss_timings(
538 const struct hdmi_video_timings *hdmi_timings,
539 struct omap_video_timings *timings)
540{
541 timings->x_res = hdmi_timings->x_res;
542 timings->y_res = hdmi_timings->y_res;
543 timings->pixel_clock = hdmi_timings->pixel_clock;
544 timings->hbp = hdmi_timings->hbp;
545 timings->hfp = hdmi_timings->hfp;
546 timings->hsw = hdmi_timings->hsw;
547 timings->vbp = hdmi_timings->vbp;
548 timings->vfp = hdmi_timings->vfp;
549 timings->vsw = hdmi_timings->vsw;
550}
551
537static int get_timings_index(void) 552static int get_timings_index(void)
538{ 553{
539 int code; 554 int code;
@@ -558,7 +573,7 @@ static struct hdmi_cm hdmi_get_code(struct omap_video_timings *timing)
558{ 573{
559 int i = 0, code = -1, temp_vsync = 0, temp_hsync = 0; 574 int i = 0, code = -1, temp_vsync = 0, temp_hsync = 0;
560 int timing_vsync = 0, timing_hsync = 0; 575 int timing_vsync = 0, timing_hsync = 0;
561 struct omap_video_timings temp; 576 struct hdmi_video_timings temp;
562 struct hdmi_cm cm = {-1}; 577 struct hdmi_cm cm = {-1};
563 DSSDBG("hdmi_get_code\n"); 578 DSSDBG("hdmi_get_code\n");
564 579
@@ -716,7 +731,8 @@ static void hdmi_read_edid(struct omap_video_timings *dp)
716 731
717 code = get_timings_index(); 732 code = get_timings_index();
718 733
719 *dp = cea_vesa_timings[code].timings; 734 copy_hdmi_to_dss_timings(&cea_vesa_timings[code].timings, dp);
735
720} 736}
721 737
722static void hdmi_core_init(struct hdmi_core_video_config *video_cfg, 738static void hdmi_core_init(struct hdmi_core_video_config *video_cfg,
@@ -1178,7 +1194,8 @@ static int hdmi_power_on(struct omap_dss_device *dssdev)
1178 hdmi_read_edid(p); 1194 hdmi_read_edid(p);
1179 } 1195 }
1180 code = get_timings_index(); 1196 code = get_timings_index();
1181 dssdev->panel.timings = cea_vesa_timings[code].timings; 1197 copy_hdmi_to_dss_timings(&cea_vesa_timings[code].timings,
1198 &dssdev->panel.timings);
1182 update_hdmi_timings(&hdmi.ip_data.cfg, p, code); 1199 update_hdmi_timings(&hdmi.ip_data.cfg, p, code);
1183 1200
1184 phy = p->pixel_clock; 1201 phy = p->pixel_clock;
diff --git a/drivers/video/omap2/dss/hdmi.h b/drivers/video/omap2/dss/hdmi.h
index d2913f8ee003..02342f6395c2 100644
--- a/drivers/video/omap2/dss/hdmi.h
+++ b/drivers/video/omap2/dss/hdmi.h
@@ -198,9 +198,22 @@ struct hdmi_reg { u16 idx; };
198#define REG_GET(base, idx, start, end) \ 198#define REG_GET(base, idx, start, end) \
199 FLD_GET(hdmi_read_reg(base, idx), start, end) 199 FLD_GET(hdmi_read_reg(base, idx), start, end)
200 200
201struct hdmi_video_timings {
202 u16 x_res;
203 u16 y_res;
204 /* Unit: KHz */
205 u32 pixel_clock;
206 u16 hsw;
207 u16 hfp;
208 u16 hbp;
209 u16 vsw;
210 u16 vfp;
211 u16 vbp;
212};
213
201/* HDMI timing structure */ 214/* HDMI timing structure */
202struct hdmi_timings { 215struct hdmi_timings {
203 struct omap_video_timings timings; 216 struct hdmi_video_timings timings;
204 int vsync_pol; 217 int vsync_pol;
205 int hsync_pol; 218 int hsync_pol;
206}; 219};