CHROMIUM: ARM: exynos: hack in machine file
authorPrathyush K <prathyush.k@samsung.com>
Thu, 14 Jun 2012 16:08:50 +0000 (21:38 +0530)
committerOlof Johansson <olofj@chromium.org>
Wed, 20 Jun 2012 18:49:59 +0000 (11:49 -0700)
This is an extension of Olof's patch:
"HACK: ARM: exynos: hack in daisy panel init for now" from chromeos-3.4

This includes support for DRM and EDP as well. This should be removed once
resolution and other paramters are passed from device tree.

Change-Id: I1359b0180a2b93088017b9a0820745fe86d926b4
Signed-off-by: Prathyush K <prathyush.k@samsung.com>
arch/arm/mach-exynos/mach-exynos5-dt.c

index e75adcb..1ee0351 100644 (file)
@@ -278,6 +278,24 @@ static struct platform_device exynos_drm_device = {
 static void lcd_set_power(struct plat_lcd_data *pd,
                        unsigned int power)
 {
+       if (of_machine_is_compatible("google,daisy") ||
+                       of_machine_is_compatible("google,snow")) {
+               struct regulator *lcd_fet;
+
+               lcd_fet = regulator_get(NULL, "lcd_vdd");
+               if (!IS_ERR(lcd_fet)) {
+                       if (power)
+                               regulator_enable(lcd_fet);
+                       else
+                               regulator_disable(lcd_fet);
+
+                       regulator_put(lcd_fet);
+               }
+       }
+
+       /* TODO(dianders): GPX1(5) isn't reset for snow.  Fix to hold high? */
+
+
        /* reset */
        gpio_request_one(EXYNOS5_GPX1(5), GPIOF_OUT_INIT_HIGH, "GPX1");
 
@@ -298,6 +316,26 @@ static void lcd_set_power(struct plat_lcd_data *pd,
                gpio_free(EXYNOS5_GPX1(5));
        }
        mdelay(20);
+
+
+       /* Turn on regulator for backlight */
+       if (of_machine_is_compatible("google,daisy") ||
+                       of_machine_is_compatible("google,snow")) {
+               struct regulator *backlight_fet;
+
+               backlight_fet = regulator_get(NULL, "vcd_led");
+               if (!IS_ERR(backlight_fet)) {
+                       if (power)
+                               regulator_enable(backlight_fet);
+                       else
+                               regulator_disable(backlight_fet);
+
+                       regulator_put(backlight_fet);
+               }
+               /* Wait 10 ms between regulator on and PWM start per spec */
+               mdelay(10);
+       }
+
        /*
         * Request lcd_bl_en GPIO for smdk5250_bl_notify().
         * TODO: Fix this so we are not at risk of requesting the GPIO
@@ -720,6 +758,46 @@ static void __init exynos5250_dt_machine_init(void)
 
        samsung_bl_set(&smdk5250_bl_gpio_info, &smdk5250_bl_data);
 
+       /*
+        * HACK ALERT! TODO: FIXME!
+        *
+        * We're going to hack in Daisy LCD info here for bringup purposes.
+        * Lots of things wrong with what we're doing here, but it works for
+        * bringup purposes.
+        */
+
+       if (of_machine_is_compatible("google,daisy")) {
+#ifdef CONFIG_DRM_EXYNOS_FIMD
+               smdk5250_lcd1_pdata.panel.timing.xres = 1366;
+               smdk5250_lcd1_pdata.panel.timing.yres = 768;
+               smdk5250_lcd1_pdata.panel_type = MIPI_LCD;
+#else
+               smdk5250_fb_win0.win_mode.xres = 1366;
+               smdk5250_fb_win0.win_mode.yres = 768;
+               smdk5250_fb_win0.virtual_x = 1366;
+               smdk5250_fb_win0.virtual_y = 768 * 2;
+
+               smdk5250_fb_win1.win_mode.xres = 1366;
+               smdk5250_fb_win1.win_mode.yres = 768;
+               smdk5250_fb_win1.virtual_x = 1366;
+               smdk5250_fb_win1.virtual_y = 768 * 2;
+
+               smdk5250_fb_win2.win_mode.xres = 1366;
+               smdk5250_fb_win2.win_mode.yres = 768;
+               smdk5250_fb_win2.virtual_x = 1366;
+               smdk5250_fb_win2.virtual_y = 768 * 2;
+#endif
+               dsim_lcd_info.lcd_size.width = 1366;
+               dsim_lcd_info.lcd_size.height = 768;
+       } else if (of_machine_is_compatible("google,snow")) {
+#ifdef CONFIG_DRM_EXYNOS_FIMD
+               smdk5250_lcd1_pdata.panel.timing = snow_fb_window;
+               smdk5250_lcd1_pdata.panel_type = DP_LCD;
+               smdk5250_lcd1_pdata.clock_rate = 267 * 1000 * 1000;
+               smdk5250_lcd1_pdata.vidcon1 = 0;
+#endif
+       }
+
        if (gpio_request_one(EXYNOS5_GPX2(6), GPIOF_OUT_INIT_HIGH,
                "HOST_VBUS_CONTROL")) {
                printk(KERN_ERR "failed to request gpio_host_vbus\n");
@@ -744,7 +822,10 @@ static void __init exynos5250_dt_machine_init(void)
                                exynos5250_auxdata_lookup, NULL);
 
 #ifdef CONFIG_DRM_EXYNOS_FIMD
-       exynos_fimd_gpio_setup_24bpp();
+       if (of_machine_is_compatible("google,snow"))
+               exynos_dp_gpio_setup_24bpp();
+       else
+               exynos_fimd_gpio_setup_24bpp();
 #endif
        s5p_tv_setup();