]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
MX5: Make IPU display output and pixel format configurable
authorMarek Vasut <marek.vasut@gmail.com>
Wed, 5 Oct 2011 22:25:03 +0000 (00:25 +0200)
committerAnatolij Gustschin <agust@denx.de>
Thu, 13 Oct 2011 10:26:31 +0000 (12:26 +0200)
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Stefano Babic <sbabic@denx.de>
Tested-by: Stefano Babic <sbabic@denx.de>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
board/ttcontrol/vision2/vision2.c
drivers/video/mxc_ipuv3_fb.c
include/ipu_pixfmt.h

index ca0c100d1136da66ae37001aedfdce7e32d2624a..e496f64312559e9d94f0dbf120ed68fcf4663ee0 100644 (file)
 #include <mc13892.h>
 #include <linux/fb.h>
 
+#include <ipu_pixfmt.h>
+
 DECLARE_GLOBAL_DATA_PTR;
 
 static u32 system_rev;
 
-extern int mx51_fb_init(struct fb_videomode *mode);
-
 static struct fb_videomode nec_nl6448bc26_09c = {
        "NEC_NL6448BC26-09C",
        60,     /* Refresh */
@@ -610,7 +610,7 @@ void lcd_enable(void)
        gpio_set_value(2, 1);
        mxc_request_iomux(MX51_PIN_GPIO1_2, IOMUX_CONFIG_ALT0);
 
-       ret = mx51_fb_init(&nec_nl6448bc26_09c);
+       ret = mx51_fb_init(&nec_nl6448bc26_09c, 0, IPU_PIX_FMT_RGB666);
        if (ret)
                puts("LCD cannot be configured\n");
 }
index eafacef5306c1cda37f30c9542f6e1d5b7b86c84..1bee54c1a1f6bf469421b85ef35db28cbd7605bd 100644 (file)
@@ -44,7 +44,9 @@ static int mxcfb_unmap_video_memory(struct fb_info *fbi);
 
 /* graphics setup */
 static GraphicDevice panel;
-struct fb_videomode *gmode;
+static struct fb_videomode *gmode;
+static uint8_t gdisp;
+static uint32_t gpixfmt;
 
 void fb_videomode_to_var(struct fb_var_screeninfo *var,
                         const struct fb_videomode *mode)
@@ -499,7 +501,8 @@ static struct fb_info *mxcfb_init_fbinfo(void)
  *
  * @return      Appropriate error code to the kernel common code
  */
-static int mxcfb_probe(u32 interface_pix_fmt, struct fb_videomode *mode)
+static int mxcfb_probe(u32 interface_pix_fmt, uint8_t disp,
+                       struct fb_videomode *mode)
 {
        struct fb_info *fbi;
        struct mxcfb_info *mxcfbi;
@@ -523,7 +526,7 @@ static int mxcfb_probe(u32 interface_pix_fmt, struct fb_videomode *mode)
                mxcfbi->blank = FB_BLANK_POWERDOWN;
        }
 
-       mxcfbi->ipu_di = 0;
+       mxcfbi->ipu_di = disp;
 
        ipu_disp_set_global_alpha(mxcfbi->ipu_ch, 1, 0x80);
        ipu_disp_set_color_key(mxcfbi->ipu_ch, 0, 0);
@@ -581,7 +584,7 @@ void *video_hw_init(void)
        if (ret)
                puts("Error initializing IPU\n");
 
-       ret = mxcfb_probe(IPU_PIX_FMT_RGB666, gmode);
+       ret = mxcfb_probe(gpixfmt, gdisp, gmode);
        debug("Framebuffer at 0x%x\n", (unsigned int)panel.frameAdrs);
 
        return (void *)&panel;
@@ -596,9 +599,11 @@ void video_set_lut(unsigned int index, /* color number */
        return;
 }
 
-int mx51_fb_init(struct fb_videomode *mode)
+int mx51_fb_init(struct fb_videomode *mode, uint8_t disp, uint32_t pixfmt)
 {
        gmode = mode;
+       gdisp = disp;
+       gpixfmt = pixfmt;
 
        return 0;
 }
index 0497bff2d2bc2b8e82c63ade57623040547b5cce..656f605462ea66031e1247be7cd28cc8782fcf3f 100644 (file)
@@ -28,6 +28,9 @@
 #ifndef __IPU_PIXFMT_H__
 #define __IPU_PIXFMT_H__
 
+#include <linux/list.h>
+#include <linux/fb.h>
+
 /*  IPU Pixel format definitions */
 #define fourcc(a, b, c, d)\
        (((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24))
@@ -73,4 +76,6 @@
 #define IPU_PIX_FMT_YVU422P fourcc('Y', 'V', '1', '6') /*< 16 YVU 4:2:2 */
 #define IPU_PIX_FMT_YUV422P fourcc('4', '2', '2', 'P') /*< 16 YUV 4:2:2 */
 
+int mx51_fb_init(struct fb_videomode *mode, uint8_t disp, uint32_t pixfmt);
+
 #endif