]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
exynos: video: Drop the static lcd_base_addr variable
authorSimon Glass <sjg@chromium.org>
Mon, 22 Feb 2016 04:08:41 +0000 (21:08 -0700)
committerMinkyu Kang <mk7.kang@samsung.com>
Wed, 25 May 2016 04:25:17 +0000 (13:25 +0900)
Drop this and use parameters instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
drivers/video/exynos/exynos_fb.c
drivers/video/exynos/exynos_fb.h
drivers/video/exynos/exynos_fimd.c

index 90d203822f82236ab98cb48361198f577dcded4d..a3acdcc2d9b0dbd7e17dd1ddb944c607d3eb4754 100644 (file)
@@ -45,22 +45,9 @@ ushort *configuration_get_cmap(void)
 #endif
 }
 
-static void exynos_lcd_init_mem(void *lcdbase, struct vidinfo *vid)
+static void exynos_lcd_init(struct vidinfo *vid, ulong lcd_base)
 {
-       unsigned long palette_size;
-       unsigned int fb_size;
-
-       fb_size = vid->vl_row * vid->vl_col * (NBITS(vid->vl_bpix) >> 3);
-
-       palette_size = NBITS(vid->vl_bpix) == 8 ? 256 : 16;
-
-       exynos_fimd_lcd_init_mem((unsigned long)lcdbase,
-                       (unsigned long)fb_size, palette_size);
-}
-
-static void exynos_lcd_init(struct vidinfo *vid)
-{
-       exynos_fimd_lcd_init(vid);
+       exynos_fimd_lcd_init(vid, lcd_base);
 
        /* Enable flushing after LCD writes if requested */
        lcd_set_flush_dcache(1);
@@ -297,9 +284,7 @@ void lcd_ctrl_init(void *lcdbase)
        panel_width = panel_info.vl_width;
        panel_height = panel_info.vl_height;
 
-       exynos_lcd_init_mem(lcdbase, &panel_info);
-
-       exynos_lcd_init(&panel_info);
+       exynos_lcd_init(&panel_info, (ulong)lcdbase);
 }
 
 void lcd_enable(void)
index 2c2f94bd036bcfcd99632a133244420a48c4847f..833be6a62f011716b7dda55e10982149bbbf0949 100644 (file)
@@ -35,7 +35,7 @@ enum exynos_cpu_auto_cmd_rate {
 
 void exynos_fimd_lcd_init_mem(unsigned long screen_base, unsigned long fb_size,
        unsigned long palette_size);
-void exynos_fimd_lcd_init(vidinfo_t *vid);
+void exynos_fimd_lcd_init(struct vidinfo *vid, ulong lcd_base_address);
 unsigned long exynos_fimd_calc_fbsize(void);
 
 #endif
index e6fb5d1b20561266626ef9b4f5c4391087107944..a1de9ac38cdf9946fe5ba72332a8dd00962b9899 100644 (file)
 
 DECLARE_GLOBAL_DATA_PTR;
 
-static unsigned long *lcd_base_addr;
 static struct vidinfo *pvid;
 static struct exynos_fb *fimd_ctrl;
 
-void exynos_fimd_lcd_init_mem(u_long screen_base, u_long fb_size,
-               u_long palette_size)
-{
-       lcd_base_addr = (unsigned long *)screen_base;
-}
-
 static void exynos_fimd_set_dualrgb(unsigned int enabled)
 {
        unsigned int cfg = 0;
@@ -47,7 +40,8 @@ static void exynos_fimd_set_dualrgb(unsigned int enabled)
        writel(cfg, &fimd_ctrl->dualrgb);
 }
 
-static void exynos_fimd_set_dp_clkcon(unsigned int enabled)
+static void exynos_fimd_set_dp_clkcon(struct vidinfo *pvid,
+                                     unsigned int enabled)
 {
        unsigned int cfg = 0;
 
@@ -57,7 +51,7 @@ static void exynos_fimd_set_dp_clkcon(unsigned int enabled)
        writel(cfg, &fimd_ctrl->dp_mie_clkcon);
 }
 
-static void exynos_fimd_set_par(unsigned int win_id)
+static void exynos_fimd_set_par(struct vidinfo *pvid, unsigned int win_id)
 {
        unsigned int cfg = 0;
 
@@ -109,11 +103,13 @@ static void exynos_fimd_set_par(unsigned int win_id)
                        EXYNOS_VIDOSD(win_id));
 }
 
-static void exynos_fimd_set_buffer_address(unsigned int win_id)
+static void exynos_fimd_set_buffer_address(struct vidinfo *pvid,
+                                          unsigned int win_id,
+                                          ulong lcd_base_addr)
 {
        unsigned long start_addr, end_addr;
 
-       start_addr = (unsigned long)lcd_base_addr;
+       start_addr = lcd_base_addr;
        end_addr = start_addr + ((pvid->vl_col * (NBITS(pvid->vl_bpix) / 8)) *
                                pvid->vl_row);
 
@@ -289,7 +285,7 @@ void exynos_fimd_disable_sysmmu(void)
        }
 }
 
-void exynos_fimd_lcd_init(struct vidinfo *vid)
+void exynos_fimd_lcd_init(struct vidinfo *vid, ulong lcd_base_address)
 {
        unsigned int cfg = 0, rgb_mode;
        unsigned int offset;
@@ -367,10 +363,10 @@ void exynos_fimd_lcd_init(struct vidinfo *vid)
        writel(cfg, &fimd_ctrl->vidcon0);
 
        /* set par */
-       exynos_fimd_set_par(pvid->win_id);
+       exynos_fimd_set_par(pvid, pvid->win_id);
 
        /* set memory address */
-       exynos_fimd_set_buffer_address(pvid->win_id);
+       exynos_fimd_set_buffer_address(pvid, pvid->win_id, lcd_base_address);
 
        /* set buffer size */
        cfg = EXYNOS_VIDADDR_PAGEWIDTH(pvid->vl_col * NBITS(pvid->vl_bpix) / 8) |
@@ -393,7 +389,7 @@ void exynos_fimd_lcd_init(struct vidinfo *vid)
        /* window on */
        exynos_fimd_window_on(pvid->win_id);
 
-       exynos_fimd_set_dp_clkcon(pvid->dp_enabled);
+       exynos_fimd_set_dp_clkcon(pvid, pvid->dp_enabled);
 }
 
 unsigned long exynos_fimd_calc_fbsize(void)