]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/video/omap/lcd_h2.c
[PATCH] ARM: OMAP: FB support for OMAP2
[linux-2.6-omap-h63xx.git] / drivers / video / omap / lcd_h2.c
index 981cf1e23415df7ec9622ba62aa0d8eb5a8a8d12..1021739b342984dc05197105a3ac037b6a191573 100644 (file)
@@ -1,7 +1,7 @@
 /*
- * File: drivers/video/omap_new/lcd-h2.c
+ * File: drivers/video/omap/lcd-h2.c
  *
- * LCD panel support for the TI OMAP H2 board 
+ * LCD panel support for the TI OMAP H2 board
  *
  * Copyright (C) 2004 Nokia Corporation
  * Author: Imre Deak <imre.deak@nokia.com>
 #include <linux/module.h>
 
 #include <asm/arch/mux.h>
+#include <asm/arch/omapfb.h>
 
-#include "omapfb.h"
-
-// #define OMAPFB_DBG 1
+/* #define OMAPFB_DBG 1 */
 
 #include "debug.h"
 #include "../drivers/ssi/omap-uwire.h"
 
+#define MODULE_NAME            "omapfb-lcd_h2"
 #define TSC2101_UWIRE_CS       1
 
+#define pr_err(fmt, args...) printk(KERN_ERR MODULE_NAME ": " fmt, ## args)
+
 static int tsc2101_write_reg(int page, int reg, u16 data)
 {
        u16     cmd;
@@ -45,13 +47,14 @@ static int tsc2101_write_reg(int page, int reg, u16 data)
        if (omap_uwire_data_transfer(TSC2101_UWIRE_CS, cmd, 16, 0, NULL, 1))
                r = -1;
        else
-               r = omap_uwire_data_transfer(TSC2101_UWIRE_CS, data, 16, 0, NULL, 0);
+               r = omap_uwire_data_transfer(TSC2101_UWIRE_CS, data, 16, 0,
+                                            NULL, 0);
 
        DBGLEAVE(1);
        return r;
 }
 
-static int h2_panel_init(struct lcd_panel *panel)
+static int h2_panel_init(struct omapfb_device *fbdev)
 {
        unsigned long uwire_flags;
        DBGENTER(1);
@@ -66,13 +69,13 @@ static int h2_panel_init(struct lcd_panel *panel)
        return 0;
 }
 
-static void h2_panel_cleanup(struct lcd_panel *panel)
+static void h2_panel_cleanup(void)
 {
        DBGENTER(1);
        DBGLEAVE(1);
 }
 
-static int h2_panel_enable(struct lcd_panel *panel)
+static int h2_panel_enable(void)
 {
        int r;
 
@@ -87,7 +90,7 @@ static int h2_panel_enable(struct lcd_panel *panel)
        return r;
 }
 
-static void h2_panel_disable(struct lcd_panel *panel)
+static void h2_panel_disable(void)
 {
        DBGENTER(1);
 
@@ -95,39 +98,36 @@ static void h2_panel_disable(struct lcd_panel *panel)
         * page2, GPIO config reg, GPIO(0,1) to out and deasserted
         */
        if (tsc2101_write_reg(2, 0x23, 0x8800))
-               PRNERR("failed to disable LCD panel\n");
+               pr_err("failed to disable LCD panel\n");
 
        DBGLEAVE(1);
 }
 
-static unsigned long h2_panel_get_caps(struct lcd_panel *panel)
+static unsigned long h2_panel_get_caps(void)
 {
        return 0;
 }
 
-static struct lcdc_video_mode mode240x320 = {
-       .x_res = 240,
-       .y_res = 320,
-       .pixel_clock = 12500,
-       .bpp = 16,
-       .hsw = 12,
-       .hfp = 14,
-       .hbp = 72 - 12,
-       .vsw = 1,
-       .vfp = 1,
-       .vbp = 0,
-       .pcd = 12,
-};
-
 struct lcd_panel h2_panel = {
-       .name       = "h2",
-       .config     = LCD_PANEL_TFT,
-       .video_mode = &mode240x320,
-       
-       .init    = h2_panel_init,
-       .cleanup = h2_panel_cleanup,
-       .enable  = h2_panel_enable,
-       .disable = h2_panel_disable,
-       .get_caps= h2_panel_get_caps,
+       .name           = "h2",
+       .config         = OMAP_LCDC_PANEL_TFT,
+
+       .bpp            = 16,
+       .data_lines     = 16,
+       .x_res          = 240,
+       .y_res          = 320,
+       .pixel_clock    = 5000,
+       .hsw            = 12,
+       .hfp            = 12,
+       .hbp            = 46,
+       .vsw            = 1,
+       .vfp            = 1,
+       .vbp            = 0,
+
+       .init           = h2_panel_init,
+       .cleanup        = h2_panel_cleanup,
+       .enable         = h2_panel_enable,
+       .disable        = h2_panel_disable,
+       .get_caps       = h2_panel_get_caps,
 };