aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2010-09-03 03:20:20 -0400
committerPaul Mundt <lethal@linux-sh.org>2010-09-14 04:23:12 -0400
commit89712699d7bc9cc93602407e0e9bc2490b771400 (patch)
tree3b886177e517429bfc95566ebea10b7f5baaa76e
parent6e45746c36d5ab4c3486760e45a555263a0b9fac (diff)
fbdev: sh_mobile_hdmi: enable "external" mode
The SH-Mobile HDMI controller supports two configuration modes: using pre-programmed VICs and the "external" mode - specifying video parameters explicitly. The driver already contains code, necessary to configure HDMI manually, this patch actually enables it. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r--drivers/video/sh_mobile_hdmi.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/video/sh_mobile_hdmi.c b/drivers/video/sh_mobile_hdmi.c
index 27d76bcf8e07..a8cf9a510f30 100644
--- a/drivers/video/sh_mobile_hdmi.c
+++ b/drivers/video/sh_mobile_hdmi.c
@@ -205,6 +205,7 @@ enum hotplug_state {
205struct sh_hdmi { 205struct sh_hdmi {
206 void __iomem *base; 206 void __iomem *base;
207 enum hotplug_state hp_state; 207 enum hotplug_state hp_state;
208 bool preprogrammed_mode; /* use a pre-programmed VIC or the external mode */
208 struct clk *hdmi_clk; 209 struct clk *hdmi_clk;
209 struct device *dev; 210 struct device *dev;
210 struct fb_info *info; 211 struct fb_info *info;
@@ -282,7 +283,10 @@ static void hdmi_external_video_param(struct sh_hdmi *hdmi)
282 283
283 hdmi_write(hdmi, var->vsync_len, HDMI_EXTERNAL_V_DURATION); 284 hdmi_write(hdmi, var->vsync_len, HDMI_EXTERNAL_V_DURATION);
284 285
285 /* Set bit 0 of HDMI_EXTERNAL_VIDEO_PARAM_SETTINGS here for manual mode */ 286 /* Set bit 0 of HDMI_EXTERNAL_VIDEO_PARAM_SETTINGS here for external mode */
287 if (!hdmi->preprogrammed_mode)
288 hdmi_write(hdmi, sync | 1 | (voffset << 4),
289 HDMI_EXTERNAL_VIDEO_PARAM_SETTINGS);
286} 290}
287 291
288/** 292/**
@@ -633,6 +637,13 @@ static void sh_hdmi_read_edid(struct sh_hdmi *hdmi)
633 var->upper_margin, var->yres, var->lower_margin, var->vsync_len, 637 var->upper_margin, var->yres, var->lower_margin, var->vsync_len,
634 PICOS2KHZ(var->pixclock)); 638 PICOS2KHZ(var->pixclock));
635 639
640 if ((hdmi->var.xres == 720 && hdmi->var.yres == 480) ||
641 (hdmi->var.xres == 1280 && hdmi->var.yres == 720) ||
642 (hdmi->var.xres == 1920 && hdmi->var.yres == 1080))
643 hdmi->preprogrammed_mode = true;
644 else
645 hdmi->preprogrammed_mode = false;
646
636 hdmi_external_video_param(hdmi); 647 hdmi_external_video_param(hdmi);
637} 648}
638 649