ARM HDLCD: Changes to get HDLCD working with 've-updates'
authorJon Medhurst <tixy@linaro.org>
Thu, 4 Oct 2012 11:38:06 +0000 (12:38 +0100)
committerJon Medhurst <tixy@linaro.org>
Mon, 1 Jul 2013 10:04:26 +0000 (11:04 +0100)
Signed-off-by: Jon Medhurst <tixy@linaro.org>
drivers/video/arm-hdlcd.c

index 9600c70209b268d2d84e229bd7c4db70d3c48b23..bd5fe68684a33f080515d95fd7905c52993f826b 100644 (file)
@@ -33,9 +33,6 @@
 
 #include "edid.h"
 
-/* set the DVI output mode using the firmware */
-extern int set_dvi_mode(int mode);
-
 #ifdef CONFIG_SERIAL_AMBA_PCU_UART
 int get_edid(u8 *msgbuf);
 #else
@@ -221,31 +218,6 @@ static int hdlcd_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
        return hdlcd_set_bitfields(hdlcd, var);
 }
 
-static int hdlcd_set_output_mode(int xres, int yres)
-{
-       /* some firmware uses some stupid protocol: 5 bytes (only byte 1 used)
-          to send 3 bits of information (value between 0 - 5) */
-       u8 msgbuffer[5];
-
-       memset(msgbuffer, 0, sizeof(msgbuffer));
-
-       if (xres < 800 && yres < 600)
-               msgbuffer[0] = 0;       /* default resolution: 640 x 480 */
-       else if (xres < 1024 && yres < 768)
-               msgbuffer[0] = 1;       /* SVGA: 800 * 600 */
-       else if (xres < 1280 && yres < 1024)
-               msgbuffer[0] = 2;       /* XGA: 1024 * 768 */
-       else if (xres < 1600 && yres < 1200)
-               msgbuffer[0] = 3;       /* SXGA: 1280 * 1024 */
-       else if (xres < 1920 && yres <= 1200)
-               msgbuffer[0] = 4;       /* UXGA: 1600 * 1200 */
-       else
-               msgbuffer[0] = 5;       /* WUXGA: 1920 * 1200 */
-
-       return set_dvi_mode(msgbuffer[0]);
-}
-
-
 /* prototype */
 static int hdlcd_pan_display(struct fb_var_screeninfo *var,
        struct fb_info *info);
@@ -316,8 +288,6 @@ static int hdlcd_set_par(struct fb_info *info)
        WRITE_HDLCD_REG(HDLCD_REG_GREEN_SELECT, ((hdlcd->fb.var.green.length & 0xf) << 8) | hdlcd->fb.var.green.offset);
        WRITE_HDLCD_REG(HDLCD_REG_BLUE_SELECT, ((hdlcd->fb.var.blue.length & 0xf) << 8) | hdlcd->fb.var.blue.offset);
 
-       hdlcd_set_output_mode(hdlcd->fb.var.xres, hdlcd->fb.var.yres);
-
        clk_prepare(hdlcd->clk);
        clk_set_rate(hdlcd->clk, (1000000000 / hdlcd->fb.var.pixclock) * 1000);
        clk_enable(hdlcd->clk);
@@ -502,6 +472,8 @@ static int hdlcd_setup(struct hdlcd_device *hdlcd)
        u32 version;
        int err = -EFAULT;
 
+       hdlcd->fb.device = hdlcd->dev;
+
        hdlcd->clk = clk_get(hdlcd->dev, NULL);
        if (IS_ERR(hdlcd->clk)) {
                dev_err(hdlcd->dev, "HDLCD: unable to find clock data\n");