Greetings, I've been working on supporting the omap850 / HTC Wizard platform. This is what I am using currently for FB support. Any comments, suggestions, or direction as to where this code should go would be appreciated. Thanks, Zebediah C. McClure
From 993df2d5d18132b5cd0ddb72de219e386e70dd64 Mon Sep 17 00:00:00 2001 In-Reply-To: <20081018131951.GN18573@xxxxxxxxxx> References: <20081018131951.GN18573@xxxxxxxxxx> From: Zebediah C. McClure <zmc@xxxxxxxxxx> Date: Sat, 24 Jan 2009 14:32:23 -0400 Subject: [PATCH] [HTCWIZARD] LCD Support. This is required for output on wizard. --- drivers/video/omap/Makefile | 1 + drivers/video/omap/lcd_htcwizard.c | 195 ++++++++++++++++++++++++++++++++++++ 2 files changed, 196 insertions(+), 0 deletions(-) create mode 100644 drivers/video/omap/lcd_htcwizard.c diff --git a/drivers/video/omap/Makefile b/drivers/video/omap/Makefile index ed13889..498e3b0 100644 --- a/drivers/video/omap/Makefile +++ b/drivers/video/omap/Makefile @@ -23,6 +23,7 @@ objs-y$(CONFIG_MACH_OMAP_PALMZ71) += lcd_palmz71.o objs-$(CONFIG_ARCH_OMAP16XX)$(CONFIG_MACH_OMAP_INNOVATOR) += lcd_inn1610.o 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_HTCWIZARD) += lcd_htcwizard.o omapfb-objs := $(objs-yy) diff --git a/drivers/video/omap/lcd_htcwizard.c b/drivers/video/omap/lcd_htcwizard.c new file mode 100644 index 0000000..1205c1c --- /dev/null +++ b/drivers/video/omap/lcd_htcwizard.c @@ -0,0 +1,195 @@ +/* + * File: drivers/video/omap/lcd-wizard.c + * + * LCD panel support for the HTC Wizard + * + * Copyright (C) linwizard.sourceforge.net + * Author: Angelo Arrifano <miknix@xxxxxxxxx> + * Based on lcd_h4 by Imre Deak <imre.deak@xxxxxxxxx> + * + * 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 <mach/omapfb.h> + +#define OMAP_LCDC_SUBPANEL 0xfffec014 + +static int htcwizard_panel_init(struct lcd_panel *panel, + struct omapfb_device *fbdev) +{ + return 0; +} + +static void htcwizard_panel_cleanup(struct lcd_panel *panel) +{ +} + +static int htcwizard_panel_enable(struct lcd_panel *panel) +{ + + return 0; +} + +static void htcwizard_panel_disable(struct lcd_panel *panel) +{ +} + +static unsigned long htcwizard_panel_get_caps(struct lcd_panel *panel) +{ + return 0; +} + +/* Not sure */ +struct lcd_panel htcwizard_panel1 = { + .name = "lcd1", + .config = OMAP_LCDC_PANEL_TFT | + OMAP_LCDC_INV_VSYNC | + OMAP_LCDC_INV_HSYNC | + OMAP_LCDC_HSVS_OPPOSITE, + + .bpp = 16, + .data_lines = 16, + .x_res = 240, + .y_res = 320, + .pixel_clock = 5500, + .hsw = 10, + .hfp = 10, + .hbp = 20, + .vsw = 2, + .vfp = 2, + .vbp = 3, + + .init = htcwizard_panel_init, + .cleanup = htcwizard_panel_cleanup, + .enable = htcwizard_panel_enable, + .disable = htcwizard_panel_disable, + .get_caps = htcwizard_panel_get_caps, +}; + +/* Found on HTC Wizards */ +struct lcd_panel htcwizard_panel2 = { + .name = "lcd2", + .config = OMAP_LCDC_PANEL_TFT | + OMAP_LCDC_INV_HSYNC | + OMAP_LCDC_INV_PIX_CLOCK, + .bpp = 16, + .data_lines = 16, + .x_res = 240, + .y_res = 320, + .pixel_clock = 6093, + .hsw = 10, + .hfp = 10, + .hbp = 20, + .vsw = 3, + .vfp = 2, + .vbp = 2, + + .init = htcwizard_panel_init, + .cleanup = htcwizard_panel_cleanup, + .enable = htcwizard_panel_enable, + .disable = htcwizard_panel_disable, + .get_caps = htcwizard_panel_get_caps, +}; + +/* Found on HTC Elfs */ +struct lcd_panel htcwizard_panel3 = { + .name = "lcd3", + .config = OMAP_LCDC_PANEL_TFT | + OMAP_LCDC_INV_HSYNC | + OMAP_LCDC_INV_PIX_CLOCK, + .bpp = 16, + .data_lines = 16, + .x_res = 240, + .y_res = 320, + .pcd = 18, + .hsw = 4, + .hfp = 8, + .hbp = 4, + .vsw = 3, + .vfp = 8, + .vbp = 5, + + .init = htcwizard_panel_init, + .cleanup = htcwizard_panel_cleanup, + .enable = htcwizard_panel_enable, + .disable = htcwizard_panel_disable, + .get_caps = htcwizard_panel_get_caps, +}; + + +static int htcwizard_panel_probe(struct platform_device *pdev) +{ + u32 type; + + type = omap_readl(OMAP_LCDC_SUBPANEL); + switch(type){ + case 0x5c00f000: + printk("LCD: Panel type 2\n"); + omapfb_register_panel(&htcwizard_panel2); + break; + case 0x5c000000: + printk("LCD: Panel type 1\n"); + omapfb_register_panel(&htcwizard_panel3); + break; + default: + printk("LCD: Unknown Panel type\n"); + omapfb_register_panel(&htcwizard_panel1); + } + + return 0; +} + +static int htcwizard_panel_remove(struct platform_device *pdev) +{ + return 0; +} + +static int htcwizard_panel_suspend(struct platform_device *pdev, pm_message_t mesg) +{ + return 0; +} + +static int htcwizard_panel_resume(struct platform_device *pdev) +{ + return 0; +} + +struct platform_driver htcwizard_panel_driver = { + .probe = htcwizard_panel_probe, + .remove = htcwizard_panel_remove, + .suspend = htcwizard_panel_suspend, + .resume = htcwizard_panel_resume, + .driver = { + .name = "lcd_htcwizard", + .owner = THIS_MODULE, + }, +}; + +static int htcwizard_panel_drv_init(void) +{ + return platform_driver_register(&htcwizard_panel_driver); +} + +static void htcwizard_panel_drv_cleanup(void) +{ + platform_driver_unregister(&htcwizard_panel_driver); +} + +module_init(htcwizard_panel_drv_init); +module_exit(htcwizard_panel_drv_cleanup); + -- 1.6.0.6
Attachment:
pgpix6Q7VHqSK.pgp
Description: PGP signature