summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/dc
diff options
context:
space:
mode:
authorShashank Sharma <shashanks@nvidia.com>2012-04-30 17:36:24 +0530
committerSimone Willett <swillett@nvidia.com>2012-05-01 14:32:44 -0700
commit9349cedf17f9b3c10760c8d48f831473f87a3a15 (patch)
treef2060015904c317fc4e0652b6e84fcaa01f0e194 /drivers/video/tegra/dc
parent6f7d0bdad55369cb9f24f682cf4088f5ee35d108 (diff)
video: tegra: dc: Set default videomode
Set default videomode during the dc probe. This patch enables HDMI during the probe only and fixes following issues: 1. Until Xinit there was no display on HDMI. 2. Framebuffer console on HDMI needs it to be enabled well before Xinit. Bug: 930136 Change-Id: Ieaf5c69eefa4a6584893425ad4fd772bcd91ea11 Signed-off-by: Shashank Sharma <shashanks@nvidia.com> Reviewed-on: http://git-master/r/99635 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
Diffstat (limited to 'drivers/video/tegra/dc')
-rw-r--r--drivers/video/tegra/dc/dc.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/drivers/video/tegra/dc/dc.c b/drivers/video/tegra/dc/dc.c
index 11e6281..7161d8b 100644
--- a/drivers/video/tegra/dc/dc.c
+++ b/drivers/video/tegra/dc/dc.c
@@ -64,6 +64,20 @@
#endif
static int no_vsync;
+static struct fb_videomode tegra_dc_hdmi_fallback_mode = {
+ .refresh = 60,
+ .xres = 640,
+ .yres = 480,
+ .pixclock = KHZ2PICOS(25200),
+ .hsync_len = 96, /* h_sync_width */
+ .vsync_len = 2, /* v_sync_width */
+ .left_margin = 48, /* h_back_porch */
+ .upper_margin = 33, /* v_back_porch */
+ .right_margin = 16, /* h_front_porch */
+ .lower_margin = 10, /* v_front_porch */
+ .vmode = 0,
+ .sync = 0,
+};
static void _tegra_dc_controller_disable(struct tegra_dc *dc);
@@ -2622,10 +2636,19 @@ static bool _tegra_dc_controller_reset_enable(struct tegra_dc *dc)
}
#endif
+static int _tegra_dc_set_default_videomode(struct tegra_dc *dc)
+{
+ return tegra_dc_set_fb_mode(dc, &tegra_dc_hdmi_fallback_mode, 0);
+}
+
static bool _tegra_dc_enable(struct tegra_dc *dc)
{
- if (dc->mode.pclk == 0)
- return false;
+ if (dc->mode.pclk == 0) {
+ /* DC enable called but no videomode is loaded.
+ Set fallback mode to enable driver with.*/
+ if (_tegra_dc_set_default_videomode(dc))
+ return false;
+ }
if (!dc->out)
return false;