]> git.sur5r.net Git - u-boot/blobdiff - drivers/video/ipu_disp.c
Merge git://git.denx.de/u-boot-dm
[u-boot] / drivers / video / ipu_disp.c
index 48fee992a180029b4adbe30e53b9f39491acde79..5c7722962d7b448e42f42fa52ad79535cc5ab14d 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Porting to u-boot:
  *
@@ -7,15 +8,13 @@
  * Linux IPU driver for MX51:
  *
  * (C) Copyright 2005-2010 Freescale Semiconductor, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 /* #define DEBUG */
 
 #include <common.h>
 #include <linux/types.h>
-#include <asm/errno.h>
+#include <linux/errno.h>
 #include <asm/io.h>
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/sys_proto.h>
@@ -377,7 +376,7 @@ static struct dp_csc_param_t dp_csc_array[CSC_NUM][CSC_NUM] = {
 static enum csc_type_t fg_csc_type = CSC_NONE, bg_csc_type = CSC_NONE;
 static int color_key_4rgb = 1;
 
-void ipu_dp_csc_setup(int dp, struct dp_csc_param_t dp_csc_param,
+static void ipu_dp_csc_setup(int dp, struct dp_csc_param_t dp_csc_param,
                        unsigned char srm_mode_update)
 {
        u32 reg;
@@ -605,28 +604,15 @@ void ipu_dc_uninit(int dc_chan)
        }
 }
 
-int ipu_chan_is_interlaced(ipu_channel_t channel)
-{
-       if (channel == MEM_DC_SYNC)
-               return !!(__raw_readl(DC_WR_CH_CONF_1) &
-                         DC_WR_CH_CONF_FIELD_MODE);
-       else if ((channel == MEM_BG_SYNC) || (channel == MEM_FG_SYNC))
-               return !!(__raw_readl(DC_WR_CH_CONF_5) &
-                         DC_WR_CH_CONF_FIELD_MODE);
-       return 0;
-}
-
 void ipu_dp_dc_enable(ipu_channel_t channel)
 {
        int di;
        uint32_t reg;
        uint32_t dc_chan;
 
-       if (channel == MEM_FG_SYNC)
-               dc_chan = 5;
        if (channel == MEM_DC_SYNC)
                dc_chan = 1;
-       else if (channel == MEM_BG_SYNC)
+       else if ((channel == MEM_BG_SYNC) || (channel == MEM_FG_SYNC))
                dc_chan = 5;
        else
                return;
@@ -782,7 +768,7 @@ void ipu_init_dc_mappings(void)
        ipu_dc_map_config(4, 2, 21, 0xFC);
 }
 
-int ipu_pixfmt_to_map(uint32_t fmt)
+static int ipu_pixfmt_to_map(uint32_t fmt)
 {
        switch (fmt) {
        case IPU_PIX_FMT_GENERIC:
@@ -1130,7 +1116,7 @@ int32_t ipu_init_sync_panel(int disp, uint32_t pixel_clk,
                reg &= 0x0000FFFF;
                __raw_writel(reg, DI_STP_REP(disp, 6));
                __raw_writel(0, DI_STP_REP(disp, 7));
-               __raw_writel(0, DI_STP_REP(disp, 9));
+               __raw_writel(0, DI_STP_REP9(disp));
 
                /* Init template microcode */
                if (disp) {