/*
- * 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;
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);
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;
return r;
}
-static void h2_panel_disable(struct lcd_panel *panel)
+static void h2_panel_disable(void)
{
DBGENTER(1);
* 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,
};