diff --git a/arch/arm/mach-msm/Kconfig b/arch/arm/mach-msm/Kconfig index 9352489..fc1d2fd 100644 --- a/arch/arm/mach-msm/Kconfig +++ b/arch/arm/mach-msm/Kconfig @@ -3,6 +3,7 @@ if ARCH_MSM comment "MSM7200 Board Type" depends on ARCH_MSM + config MACH_HALIBUT depends on ARCH_MSM default y @@ -10,6 +11,13 @@ config MACH_HALIBUT help Support for the Qualcomm SURF7200A eval board. +config MACH_HTCKAISER + depends on ARCH_MSM + default y + bool "HTC Kaiser phone aka HTC TyTN II" + help + Support for HTC Kaiser phone. + config MSM_SMD depends on ARCH_MSM default y @@ -51,4 +59,9 @@ config MSM_HW3D Provides access to registers and interrupts needed by the userspace 3D library. +config KAISER_LCD + tristate "HTC Kaiser VSFB LCD support" + depends on MACH_HTCKAISER && LCD_CLASS_DEVICE + help + This driver provides support for HTC Kaiser LCD display. endif diff --git a/arch/arm/mach-msm/Makefile b/arch/arm/mach-msm/Makefile index 26c1df4..11d786d 100644 --- a/arch/arm/mach-msm/Makefile +++ b/arch/arm/mach-msm/Makefile @@ -3,9 +3,13 @@ obj-y += common.o obj-y += gpio.o generic_gpio.o obj-$(CONFIG_MACH_HALIBUT) += board-halibut.o keypad-halibut.o +obj-$(CONFIG_MACH_HTCKAISER) += board-htckaiser.o obj-$(CONFIG_MSM_SMD) += smd.o obj-$(CONFIG_MSM_SMD_TTY) += smd_tty.o obj-$(CONFIG_MSM_SMD_RPC_ROUTER) += smd_rpcrouter.o obj-$(CONFIG_MSM_SMD_QMI) += smd_qmi.o obj-$(CONFIG_MSM_HW3D) += hw3d.o + +obj-$(CONFIG_HTCKAISER_LCD) += htckaiser_lcd.o + diff --git a/arch/arm/mach-msm/board-htckaiser.c b/arch/arm/mach-msm/board-htckaiser.c new file mode 100644 index 0000000..b33250a --- /dev/null +++ b/arch/arm/mach-msm/board-htckaiser.c @@ -0,0 +1,140 @@ +/* linux/arch/arm/mach-msm/board-halibut.c +** +** Copyright (C) 2007 Google, Inc. +** Author: Brian Swetland +** +** This software is licensed under the terms of the GNU General Public +** License version 2, as published by the Free Software Foundation, and +** may be copied, distributed, and modified under those terms. +** +** 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. +** +*/ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include + +#define DECLARE_MSM_IOMAP +#include + +void msm_init_irq(void); +void msm_init_gpio(void); +void msm_pmrr_config(void); + +/*extern struct platform_device halibut_keypad_device; +** +**static struct resource smc91x_resources[] = { +** [0] = { +** .start = 0x9C004300, +** .end = 0x9C004400, +** .flags = IORESOURCE_MEM, +** }, +** [1] = { +** .start = MSM_GPIO_TO_INT(49), +** .end = MSM_GPIO_TO_INT(49), +** .flags = IORESOURCE_IRQ, +** }, +**}; +** +**static struct platform_device smc91x_device = { +** .name = "smc91x", +** .id = 0, +** .num_resources = ARRAY_SIZE(smc91x_resources), +** .resource = smc91x_resources, +**}; +*/ + +/* LCD stolen from htchermes.c from hh.org tree */ + +static struct platform_device htckaiser_lcd = { + .name = "vsfb", + .id = -1, + .dev = { + .platform_data = NULL, + }, +}; + +static void mddi0_panel_power(int on) +{ + printk("mddi0_panel_power(%d)\n", on); +} + +static struct msm_mddi_platform_data msm_mddi0_pdata = { + .panel_power = mddi0_panel_power, + .has_vsync_irq = 0, +}; + +static struct platform_device msm_mddi0_device = { + .name = "msm_mddi", + .id = 0, + .dev = { .platform_data = &msm_mddi0_pdata }, +}; + +static struct platform_device msm_serial0_device = { + .name = "msm_serial", + .id = 0, +}; + +/*static struct platform_device *devices[] __initdata = { +** &msm_serial0_device, +** &halibut_keypad_device, +** &msm_mddi0_device, +** &smc91x_device, +**}; +*/ + +extern struct sys_timer msm_timer; + +static void __init halibut_init_irq(void) +{ + printk("halibut_init_irq()\n"); + msm_init_irq(); +} + +/*static void __init halibut_init(void) +**{ +** printk("halibut_init()\n"); +** msm_init_gpio(); +** platform_add_devices(devices, ARRAY_SIZE(devices)); +** msm_add_devices(); +**} +*/ +static void __init halibut_map_io(void) +{ + printk("halibut_init_map_io()\n"); + msm_pmrr_config(); + iotable_init(msm_io_desc, ARRAY_SIZE(msm_io_desc)); +} + +MACHINE_START(HALIBUT, "Halibut Board (QCT SURF7200A)") +/* Maintainer: Brian Swetland */ + +/* this is broken... can we just opt out of specifying something here? */ + .phys_io = 0x80000000, + .io_pg_offst = ((0x80000000) >> 18) & 0xfffc, + + .boot_params = 0x10000100, + .map_io = halibut_map_io, + .init_irq = halibut_init_irq, +/* .init_machine = halibut_init,*/ + .timer = &msm_timer, +MACHINE_END diff --git a/arch/arm/mach-msm/htckaiser_lcd.c b/arch/arm/mach-msm/htckaiser_lcd.c new file mode 100644 index 0000000..e75ceb6 --- /dev/null +++ b/arch/arm/mach-msm/htckaiser_lcd.c @@ -0,0 +1,69 @@ +/* + * htckaiser_lcd.c + * + * Based on the code + * (c) 2006 Ian Molton + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License. + * + */ + +#include +#include +#include +#include + +static struct fb_var_screeninfo htckaiser_vsfb_var = { + .xres = 240, + .yres = 320, + .xres_virtual = 240, + .yres_virtual = 320, + .bits_per_pixel = 16, + .red = { 11, 5, 0 }, + .green = { 5, 6, 0 }, + .blue = { 0, 5, 0 }, + .activate = FB_ACTIVATE_NOW, + .height = -1, + .width = -1, + .vmode = FB_VMODE_NONINTERLACED, +}; + +static struct fb_fix_screeninfo htckaiser_vsfb_fix = { + .id = "vsfb", + .smem_start = 0x10000000, + .smem_len = 240*320*2, + .type = FB_TYPE_PACKED_PIXELS, + .visual = FB_VISUAL_TRUECOLOR, + .line_length = 240*2, + .accel = FB_ACCEL_NONE, +}; + +static struct vsfb_deviceinfo htckaiser_vsfb_deviceinfo = { + .fix = &htckaiser_vsfb_fix, + .var = &htckaiser_vsfb_var, +}; + +static struct platform_device htckaiser_vsfb_device = { + .name = "vsfb", + .id = -1, + .dev = { + .platform_data = &htckaiser_vsfb_deviceinfo, + }, +}; + +static int htckaiser_lcd_init (void) { + + if (!machine_is_htckaiser ()) + return -ENODEV; + + platform_device_register(&htckaiser_vsfb_device); + + return 0; +} + +module_init (htckaiser_lcd_init); + +MODULE_DESCRIPTION("HTC Kaiser LCD driver"); +MODULE_LICENSE("GPL"); + diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index eeee342..de6343a 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -1867,8 +1867,26 @@ config FB_VIRTUAL module will be called vfb. In order to load it, you must use the vfb_enable=1 option. + If unsure, say N. + + + + +config FB_VSFB + tristate "Very Simple FrameBuffer (vsfb) driver" + depends on FB + select FB_CFB_FILLRECT + select FB_CFB_COPYAREA + select FB_CFB_IMAGEBLIT + ---help--- + This is a very simple framebuffer device intended for either + testing devices for which no proper video driver exists or for + use on very simple framebuffers that have been set up by 'bios like' + bootloaders that reserve a block of linear memory for a framebuffer. + If unsure, say N. + if VT source "drivers/video/console/Kconfig" endif diff --git a/drivers/video/Makefile b/drivers/video/Makefile index 6118b2b..9db0758 100644 --- a/drivers/video/Makefile +++ b/drivers/video/Makefile @@ -123,6 +123,7 @@ obj-$(CONFIG_FB_OF) += offb.o # the test framebuffer is last obj-$(CONFIG_FB_VIRTUAL) += vfb.o +obj-$(CONFIG_FB_VSFB) += vsfb.o #video output switch sysfs driver obj-$(CONFIG_VIDEO_OUTPUT_CONTROL) += output.o diff --git a/drivers/video/vsfb.c b/drivers/video/vsfb.c new file mode 100644 index 0000000..61dcf1a --- /dev/null +++ b/drivers/video/vsfb.c @@ -0,0 +1,117 @@ +/* + * linux/drivers/video/vsfb.c + * + * Copyright (C) 2003 Ian Molton + * + * Based on acornfb by Russell King + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Frame buffer code for Simple platforms + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +static struct fb_info fb_info; +static u32 colreg[17]; + + +static int +vsfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, + u_int trans, struct fb_info *info) +{ + if (regno > 16) + return 1; + + ((u32 *)(info->pseudo_palette))[regno] = (red & 0xf800) | ((green & 0xfc00) >> 5) | ((blue & 0xf800) >> 11); + + return 0; +} + +static struct fb_ops vsfb_ops = { + .owner = THIS_MODULE, + .fb_setcolreg = vsfb_setcolreg, + .fb_fillrect = cfb_fillrect, + .fb_copyarea = cfb_copyarea, + .fb_imageblit = cfb_imageblit, +}; + +static int vsfb_probe(struct platform_device *pdev) { + struct vsfb_deviceinfo *vsfb; + + vsfb = pdev->dev.platform_data; + if(!vsfb) + return -ENODEV; + + memcpy (&fb_info.fix, vsfb->fix, sizeof(struct fb_fix_screeninfo)); + memcpy (&fb_info.var, vsfb->var, sizeof(struct fb_var_screeninfo)); + + fb_info.fbops = &vsfb_ops; + fb_info.flags = FBINFO_FLAG_DEFAULT; + fb_info.pseudo_palette = colreg; + fb_alloc_cmap(&fb_info.cmap, 16, 0); + + /* Try to grab our phys memory space... */ + if (!(request_mem_region(fb_info.fix.smem_start, fb_info.fix.smem_len, "vsfb"))){ + return -ENOMEM; + } + + /* Try to map this so we can access it */ + fb_info.screen_base = ioremap(fb_info.fix.smem_start, fb_info.fix.smem_len); + if (!fb_info.screen_base) { + release_mem_region(fb_info.fix.smem_start, fb_info.fix.smem_len); + return -EIO; + } + + printk(KERN_INFO "vsfb: framebuffer at 0x%lx, mapped to 0x%p, size %dk\n", fb_info.fix.smem_start, fb_info.screen_base, fb_info.fix.smem_len/1024); + + if (register_framebuffer(&fb_info) < 0){ + iounmap(fb_info.screen_base); + release_mem_region(fb_info.fix.smem_start, fb_info.fix.smem_len); + + return -EINVAL; + } + + return 0; +} + +struct platform_driver vsfb_driver = { + .driver = { + .name = "vsfb", + }, + .probe = vsfb_probe, +}; + +static int __init vsfb_init(void) +{ + return platform_driver_register (&vsfb_driver); + return 0; +} + +module_init(vsfb_init); + +MODULE_AUTHOR("Ian Molton f2s.com>"); +MODULE_DESCRIPTION("Very Simple framebuffer driver"); +MODULE_LICENSE("GPL"); diff --git a/include/config/fb/vsfb.h b/include/config/fb/vsfb.h new file mode 100644 index 0000000..e69de29 diff --git a/include/linux/vsfb.h b/include/linux/vsfb.h new file mode 100644 index 0000000..070fa50 --- /dev/null +++ b/include/linux/vsfb.h @@ -0,0 +1,23 @@ +/* + * vsfb.h + * + * (c) 2006 Ian Molton f2s.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + */ + +#ifndef _VSFB_H_INCLUDED +#define _VSFB_H_INCLUDED + +#include + +struct vsfb_deviceinfo +{ + struct fb_var_screeninfo *var; + struct fb_fix_screeninfo *fix; +}; + +#endif