tegra:dc: Init default mode on HDMI
Shashank Sharma [Mon, 24 Sep 2012 10:41:18 +0000 (15:41 +0530)]
Set default videomode on DC before enabling HDMI.When running
framebuffer console on HDMI, a default mode must be set before
calling init, else tegra_dc_init will fail due to 0 pclk.

Bug 1046489
Signed-off-by: Shashank Sharma <shashanks@nvidia.com>
Change-Id: If9360a0d037e6dd9d1f205d8092b4da2a71ce5bf
Reviewed-on: http://git-master/r/134814
Reviewed-by: Mrutyunjay Sawant <msawant@nvidia.com>
Tested-by: Mrutyunjay Sawant <msawant@nvidia.com>

Rebase-Id: R5fae7cd666fdacac04858ef9f21ea6e0e9573c4f

arch/arm/mach-tegra/include/mach/dc.h
drivers/video/tegra/dc/dc.c
drivers/video/tegra/dc/hdmi.c
drivers/video/tegra/fb.c

index 53cffd9..ee30274 100644 (file)
@@ -601,6 +601,8 @@ void tegra_dc_blank(struct tegra_dc *dc);
 
 void tegra_dc_enable(struct tegra_dc *dc);
 void tegra_dc_disable(struct tegra_dc *dc);
+int tegra_dc_set_default_videomode(struct tegra_dc *dc);
+
 
 u32 tegra_dc_get_syncpt_id(const struct tegra_dc *dc, int i);
 u32 tegra_dc_incr_syncpt_max(struct tegra_dc *dc, int i);
index ff3091f..ed79510 100644 (file)
@@ -1724,6 +1724,11 @@ static int _tegra_dc_set_default_videomode(struct tegra_dc *dc)
        return false;
 }
 
+int tegra_dc_set_default_videomode(struct tegra_dc *dc)
+{
+       return _tegra_dc_set_default_videomode(dc);
+}
+
 static bool _tegra_dc_enable(struct tegra_dc *dc)
 {
        if (dc->mode.pclk == 0)
index 541dc5d..bea59b0 100644 (file)
@@ -1463,6 +1463,10 @@ static void tegra_dc_hdmi_detect_worker(struct work_struct *work)
                container_of(to_delayed_work(work), struct tegra_dc_hdmi_data, work);
        struct tegra_dc *dc = hdmi->dc;
 
+#ifdef CONFIG_FRAMEBUFFER_CONSOLE
+       /* Set default videomode on dc before enabling it*/
+       tegra_dc_set_default_videomode(dc);
+#endif
        tegra_dc_enable(dc);
        msleep(5);
        if (!tegra_dc_hdmi_detect(dc)) {
index 431e272..88511b4 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/slab.h>
 #include <linux/file.h>
 #include <linux/workqueue.h>
+#include <linux/console.h>
 
 #include <asm/atomic.h>
 
@@ -469,7 +470,13 @@ void tegra_fb_update_monspecs(struct tegra_fb_info *fb_info,
        }
 
        event.info = fb_info->info;
+#ifdef CONFIG_FRAMEBUFFER_CONSOLE
+       console_lock();
        fb_notifier_call_chain(FB_EVENT_NEW_MODELIST, &event);
+       console_unlock();
+#else
+       fb_notifier_call_chain(FB_EVENT_NEW_MODELIST, &event);
+#endif
        mutex_unlock(&fb_info->info->lock);
 }