]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
h63xx: lcd support
authorMika Laitio <lamikr@pilppa.org>
Mon, 19 Jan 2009 23:00:29 +0000 (01:00 +0200)
committerMika Laitio <lamikr@pilppa.org>
Mon, 19 Jan 2009 23:00:29 +0000 (01:00 +0200)
arch/arm/mach-omap1/board-h6300.c
arch/arm/plat-omap/dma.c
drivers/video/omap/Makefile
drivers/video/omap/lcd_h6300.c [new file with mode: 0644]

index bca54d26befb90e17dc3432bcf692c555eaafdfa..6e73ef55bb4d3efa9a566453e0ff8fbb3b492179 100644 (file)
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/delay.h>
-
 #include <linux/input.h>
 
 #include <asm/hardware.h>
 #include <asm/mach/map.h>
 
 #include <asm/arch/gpio.h>
-
 #include <asm/arch/tc.h>
+#include <asm/arch/usb.h>
 #include <asm/arch/common.h>
 
+static struct platform_device h6300_lcd_device = {
+       .name   = "lcd_h6300",
+       .id     = -1,
+};
+
+static struct platform_device *h6300_devices[] __initdata = {
+       &h6300_lcd_device,
+};
+
+static struct omap_lcd_config h6300_lcd_config __initdata = {
+       .ctrl_name      = "internal",
+};
+
+static struct omap_board_config_kernel h6300_config[] = {
+       { OMAP_TAG_LCD,         &h6300_lcd_config },
+};
+
 static void __init h6300_init_irq(void)
 {
        omap1_init_common_hw();
@@ -40,6 +55,14 @@ static void __init h6300_init_irq(void)
 
 static void __init h6300_init(void)
 {
+       int ret;
+       
+       ret = platform_add_devices(h6300_devices, ARRAY_SIZE(h6300_devices));
+       if (ret) {
+               printk(KERN_WARNING "Unable to add h6300 platform devices.");
+       }
+       omap_board_config       = h6300_config;
+       omap_board_config_size  = ARRAY_SIZE(h6300_config);
        omap_serial_init();
 }
 
index 5dac4230360d845daf2c02d2c1a4e6e16c16ffae..6eb66bfecea201eba2136fa2c4278bdb6ef67d0e 100644 (file)
@@ -30,6 +30,7 @@
 #include <asm/hardware.h>
 #include <asm/dma.h>
 #include <asm/io.h>
+#include <asm/mach-types.h>
 
 #include <asm/arch/tc.h>
 
@@ -1086,6 +1087,10 @@ static void set_b1_regs(void)
        }
 
        if (omap_dma_in_1510_mode()) {
+               u16 l = omap_readw(OMAP1510_DMA_LCD_CTRL);
+               l &= ~(1 << 6);
+               omap_writew (l, OMAP1510_DMA_LCD_CTRL);
+
                omap_writew(top >> 16, OMAP1510_DMA_LCD_TOP_F1_U);
                omap_writew(top, OMAP1510_DMA_LCD_TOP_F1_L);
                omap_writew(bottom >> 16, OMAP1510_DMA_LCD_BOT_F1_U);
index 725ea29c6713592902a5810cfb275388cb8e8eb6..dea546f6254d08b1ba8488e57cde77d186cb9f9c 100644 (file)
@@ -23,6 +23,7 @@ objs-$(CONFIG_ARCH_OMAP15XX)$(CONFIG_MACH_OMAP_INNOVATOR) += lcd_inn1510.o
 objs-y$(CONFIG_MACH_OMAP_OSK) += lcd_osk.o
 objs-y$(CONFIG_MACH_OMAP_PERSEUS2) += lcd_p2.o
 objs-y$(CONFIG_MACH_OMAP_APOLLON) += lcd_apollon.o
+objs-$(CONFIG_ARCH_OMAP15XX)$(CONFIG_MACH_OMAP_H6300) += lcd_h6300.o
 
 objs-y$(CONFIG_FB_OMAP_LCD_LPH8923) += lcd_lph8923.o
 
diff --git a/drivers/video/omap/lcd_h6300.c b/drivers/video/omap/lcd_h6300.c
new file mode 100644 (file)
index 0000000..d476fe6
--- /dev/null
@@ -0,0 +1,157 @@
+/*
+ * File: drivers/video/omap_new/lcd-h6300.c
+ *
+ * LCD panel support for the TI OMAP1510 based iPAQ h63xx series of mobile phones.
+ * (h6315, h6340 and h6365)
+ *
+ * Copyright (C) 2009 Mika Laitio
+ * Copyright (C) 2009 Husam Senussi
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <asm/io.h>
+
+#include <asm/arch/omapfb.h>
+
+/* #define OMAPFB_DBG 1 */
+
+#include "debug.h"
+
+//static struct clk *h6300_lcd_ck;
+
+static int h6300_panel_init(struct omapfb_device *fbdev)
+{
+       DBGENTER(1);
+/*
+       if ((h6300_lcd_ck = clk_get (NULL, "lcd_ck")) == NULL) {
+               printk(KERN_ERR "Unable to get the clock LCD_CK!!!\n");
+               return -EPERM;
+       } clk_enable(h6300_lcd_ck);
+*/
+       DBGLEAVE(1);
+       printk(KERN_INFO "lcd_h6300.c: h6300_panel_init() done\n");
+       return 0;
+}
+
+static void h6300_panel_cleanup(void)
+{
+       DBGENTER(1);
+/*
+       if (h6300_lcd_ck) {
+               clk_disable(h6300_lcd_ck);
+               clk_put(h6300_lcd_ck);
+               h6300_lcd_ck = NULL;
+       }
+*/
+       DBGLEAVE(1);
+       printk(KERN_INFO "lcd_h6300.c: h6300_panel_cleanup() done\n");
+}
+
+static int h6300_panel_enable(void)
+{
+       DBGENTER(1);
+       DBGLEAVE(1);
+       printk(KERN_INFO "lcd_h6300.c: h6300_panel_enable() done\n");
+       return 0;
+}
+
+static void h6300_panel_disable(void)
+{
+       DBGENTER(1);
+       DBGLEAVE(1);
+       printk(KERN_INFO "lcd_h6300.c: h6300_panel_disable() done\n");  
+}
+
+static unsigned long h6300_panel_get_caps(void)
+{
+       printk(KERN_INFO "lcd_h6300.c: h6300_panel_get_caps() called\n");       
+       return 0;
+}
+
+struct lcd_panel h6300_panel = {
+       .name           = "h6300",
+       .config         = OMAP_LCDC_PANEL_TFT,
+
+       .bpp            = 16,
+       .data_lines     = 16,
+       .x_res          = 240,
+       .y_res          = 320,
+       .pixel_clock    = 21000,
+       .hsw            = 12,
+       .hfp            = 10,
+       .hbp            = 10,
+       .vsw            = 3,
+       .vfp            = 10,
+       .vbp            = 3,
+       .pcd            = 0,
+
+       .init           = h6300_panel_init,
+       .cleanup        = h6300_panel_cleanup,
+       .enable         = h6300_panel_enable,
+       .disable        = h6300_panel_disable,
+       .get_caps       = h6300_panel_get_caps,
+};
+
+static int h6300_panel_probe(struct platform_device *pdev)
+{
+       DBGENTER(1);
+       omapfb_register_panel(&h6300_panel);
+       return 0;
+}
+
+static int h6300_panel_remove(struct platform_device *pdev)
+{
+       DBGENTER(1);
+       return 0;
+}
+
+static int h6300_panel_suspend(struct platform_device *pdev, pm_message_t mesg)
+{
+       DBGENTER(1);
+       return 0;
+}
+
+static int h6300_panel_resume(struct platform_device *pdev)
+{
+       DBGENTER(1);
+       return 0;
+}
+
+struct platform_driver h6300_panel_driver = {
+       .probe          = h6300_panel_probe,
+       .remove         = h6300_panel_remove,
+       .suspend        = h6300_panel_suspend,
+       .resume         = h6300_panel_resume,
+       .driver         = {
+               .name   = "lcd_h6300",
+               .owner  = THIS_MODULE,
+       },
+};
+
+static int h6300_panel_drv_init(void)
+{
+       return platform_driver_register(&h6300_panel_driver);
+}
+
+static void h6300_panel_drv_cleanup(void)
+{
+       platform_driver_unregister(&h6300_panel_driver);
+}
+
+module_init(h6300_panel_drv_init);
+module_exit(h6300_panel_drv_cleanup);