]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/video/exynos_fb.c
ddr: altera: sdram: Add missing kerneldoc
[karo-tx-uboot.git] / drivers / video / exynos_fb.c
index e1e0d802f657279585a50f2410e02784d49034cd..8f3b8263dab6e8a328e3056b413620ef7e3e241c 100644 (file)
@@ -19,6 +19,7 @@
 #include <asm/arch/mipi_dsim.h>
 #include <asm/arch/dp_info.h>
 #include <asm/arch/system.h>
+#include <asm/gpio.h>
 #include <asm-generic/errno.h>
 
 #include "exynos_fb.h"
@@ -27,20 +28,25 @@ DECLARE_GLOBAL_DATA_PTR;
 
 static unsigned int panel_width, panel_height;
 
-/*
- * board_init_f(arch/arm/lib/board.c) calls lcd_setmem() which needs
- * panel_info.vl_col, panel_info.vl_row and panel_info.vl_bpix to reserve
- * FB memory at a very early stage, i.e even before exynos_fimd_parse_dt()
- * is called. So, we are forced to statically assign it.
- */
 #ifdef CONFIG_OF_CONTROL
 vidinfo_t panel_info  = {
-       .vl_col = LCD_XRES,
-       .vl_row = LCD_YRES,
-       .vl_bpix = LCD_COLOR16,
+       /*
+        * Insert a value here so that we don't end up in the BSS
+        * Reference: drivers/video/tegra.c
+        */
+       .vl_col = -1,
 };
 #endif
 
+ushort *configuration_get_cmap(void)
+{
+#if defined(CONFIG_LCD_LOGO)
+       return bmp_logo_palette;
+#else
+       return NULL;
+#endif
+}
+
 static void exynos_lcd_init_mem(void *lcdbase, vidinfo_t *vid)
 {
        unsigned long palette_size;
@@ -62,57 +68,45 @@ static void exynos_lcd_init(vidinfo_t *vid)
        lcd_set_flush_dcache(1);
 }
 
-void __exynos_cfg_lcd_gpio(void)
+__weak void exynos_cfg_lcd_gpio(void)
 {
 }
-void exynos_cfg_lcd_gpio(void)
-       __attribute__((weak, alias("__exynos_cfg_lcd_gpio")));
 
-void __exynos_backlight_on(unsigned int onoff)
+__weak void exynos_backlight_on(unsigned int onoff)
 {
 }
-void exynos_backlight_on(unsigned int onoff)
-       __attribute__((weak, alias("__exynos_cfg_lcd_gpio")));
 
-void __exynos_reset_lcd(void)
+__weak void exynos_reset_lcd(void)
 {
 }
-void exynos_reset_lcd(void)
-       __attribute__((weak, alias("__exynos_reset_lcd")));
 
-void __exynos_lcd_power_on(void)
+__weak void exynos_lcd_power_on(void)
 {
 }
-void exynos_lcd_power_on(void)
-       __attribute__((weak, alias("__exynos_lcd_power_on")));
 
-void __exynos_cfg_ldo(void)
+__weak void exynos_cfg_ldo(void)
 {
 }
-void exynos_cfg_ldo(void)
-       __attribute__((weak, alias("__exynos_cfg_ldo")));
 
-void __exynos_enable_ldo(unsigned int onoff)
+__weak void exynos_enable_ldo(unsigned int onoff)
 {
 }
-void exynos_enable_ldo(unsigned int onoff)
-       __attribute__((weak, alias("__exynos_enable_ldo")));
 
-void __exynos_backlight_reset(void)
+__weak void exynos_backlight_reset(void)
 {
 }
-void exynos_backlight_reset(void)
-       __attribute__((weak, alias("__exynos_backlight_reset")));
 
-int __exynos_lcd_misc_init(vidinfo_t *vid)
+__weak int exynos_lcd_misc_init(vidinfo_t *vid)
 {
        return 0;
 }
-int exynos_lcd_misc_init(vidinfo_t *vid)
-       __attribute__((weak, alias("__exynos_lcd_misc_init")));
 
 static void lcd_panel_on(vidinfo_t *vid)
 {
+       struct gpio_desc pwm_out_gpio;
+       struct gpio_desc bl_en_gpio;
+       unsigned int node;
+
        udelay(vid->init_delay);
 
        exynos_backlight_reset();
@@ -132,6 +126,22 @@ static void lcd_panel_on(vidinfo_t *vid)
 
        exynos_backlight_on(1);
 
+#ifdef CONFIG_OF_CONTROL
+       node = fdtdec_next_compatible(gd->fdt_blob, 0,
+                                               COMPAT_SAMSUNG_EXYNOS_FIMD);
+       if (node <= 0) {
+               debug("FIMD: Can't get device node for FIMD\n");
+               return;
+       }
+       gpio_request_by_name_nodev(gd->fdt_blob, node, "samsung,pwm-out-gpio",
+                                  0, &pwm_out_gpio,
+                                  GPIOD_IS_OUT | GPIOD_IS_OUT_ACTIVE);
+
+       gpio_request_by_name_nodev(gd->fdt_blob, node, "samsung,bl-en-gpio", 0,
+                                  &bl_en_gpio,
+                                  GPIOD_IS_OUT | GPIOD_IS_OUT_ACTIVE);
+
+#endif
        exynos_cfg_ldo();
 
        exynos_enable_ldo(1);
@@ -141,7 +151,7 @@ static void lcd_panel_on(vidinfo_t *vid)
 }
 
 #ifdef CONFIG_OF_CONTROL
-int exynos_fimd_parse_dt(const void *blob)
+int exynos_lcd_early_init(const void *blob)
 {
        unsigned int node;
        node = fdtdec_next_compatible(blob, 0, COMPAT_SAMSUNG_EXYNOS_FIMD);
@@ -286,8 +296,6 @@ void lcd_ctrl_init(void *lcdbase)
        set_lcd_clk();
 
 #ifdef CONFIG_OF_CONTROL
-       if (exynos_fimd_parse_dt(gd->fdt_blob))
-               debug("Can't get proper panel info\n");
 #ifdef CONFIG_EXYNOS_MIPI_DSIM
        exynos_init_dsim_platform_data(&panel_info);
 #endif