summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorXinyu Chen <muddog@muddog-desktop.(none)>2008-04-03 10:44:39 +0800
committerDaniel Schaeffer <daniel.schaeffer@timesys.com>2008-08-25 15:20:58 -0400
commitdc8cddc49647cef249c37f8f65f5f1c8ca5572e6 (patch)
treea2e93eae12e3060ac98e2467a582e8286e670b6e /drivers
parentedff13cb4f5656b5201ecacc19fb42c91a12f962 (diff)
ENGR00058723 MX35 IPU and LCD
Change IPU internal RAM param base address. Enable CLAA WVGA LCD Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mxc/ipu/ipu_ic.c29
-rw-r--r--drivers/video/mxc/Kconfig4
-rw-r--r--drivers/video/mxc/Makefile1
-rw-r--r--drivers/video/mxc/mxcfb_claa_wvga.c219
4 files changed, 245 insertions, 8 deletions
diff --git a/drivers/mxc/ipu/ipu_ic.c b/drivers/mxc/ipu/ipu_ic.c
index 83fc349deb10..70f410819e12 100644
--- a/drivers/mxc/ipu/ipu_ic.c
+++ b/drivers/mxc/ipu/ipu_ic.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2005-2007 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright 2005-2008 Freescale Semiconductor, Inc. All Rights Reserved.
*/
/*
@@ -35,6 +35,7 @@ enum {
IC_TASK_POST_PROCESSOR
};
+extern int g_ipu_hw_rev;
static void _init_csc(uint8_t ic_task, ipu_color_space_t in_format,
ipu_color_space_t out_format);
static bool _calc_resize_coeffs(uint32_t inSize, uint32_t outSize,
@@ -421,14 +422,26 @@ static void _init_csc(uint8_t ic_task, ipu_color_space_t in_format,
uint32_t param[2];
uint32_t address = 0;
- if (ic_task == IC_TASK_VIEWFINDER) {
- address = 0x5A5 << 3;
- } else if (ic_task == IC_TASK_ENCODER) {
- address = 0x2D1 << 3;
- } else if (ic_task == IC_TASK_POST_PROCESSOR) {
- address = 0x87C << 3;
+ if (g_ipu_hw_rev > 1) {
+ if (ic_task == IC_TASK_VIEWFINDER) {
+ address = 0x645 << 3;
+ } else if (ic_task == IC_TASK_ENCODER) {
+ address = 0x321 << 3;
+ } else if (ic_task == IC_TASK_POST_PROCESSOR) {
+ address = 0x96C << 3;
+ } else {
+ BUG();
+ }
} else {
- BUG();
+ if (ic_task == IC_TASK_VIEWFINDER) {
+ address = 0x5a5 << 3;
+ } else if (ic_task == IC_TASK_ENCODER) {
+ address = 0x2d1 << 3;
+ } else if (ic_task == IC_TASK_POST_PROCESSOR) {
+ address = 0x87c << 3;
+ } else {
+ BUG();
+ }
}
if ((in_format == YCbCr) && (out_format == RGB)) {
diff --git a/drivers/video/mxc/Kconfig b/drivers/video/mxc/Kconfig
index aeaf4ba914d2..70cbbca62a8d 100644
--- a/drivers/video/mxc/Kconfig
+++ b/drivers/video/mxc/Kconfig
@@ -28,6 +28,10 @@ config FB_MXC_TVOUT_TVE
depends on FB_MXC_SYNC_PANEL
depends on MXC_IPU_V3
+config FB_MXC_CLAA_WVGA_SYNC_PANEL
+ depends on FB_MXC_SYNC_PANEL
+ tristate "CLAA WVGA Panel"
+
config FB_MXC_TVOUT
bool "FS453 TV Out Encoder"
depends on FB_MXC_SYNC_PANEL
diff --git a/drivers/video/mxc/Makefile b/drivers/video/mxc/Makefile
index 0799d99787d8..4b7042108f5a 100644
--- a/drivers/video/mxc/Makefile
+++ b/drivers/video/mxc/Makefile
@@ -15,6 +15,7 @@ endif
obj-$(CONFIG_FB_MXC_SHARP_128_PANEL) += mxcfb_sharp_128x128.o
endif
obj-$(CONFIG_FB_MXC_EPSON_VGA_SYNC_PANEL) += mxcfb_epson_vga.o
+obj-$(CONFIG_FB_MXC_CLAA_WVGA_SYNC_PANEL) += mxcfb_claa_wvga.o
obj-$(CONFIG_FB_MXC_TVOUT_CH7024) += ch7024.o
obj-$(CONFIG_FB_MXC_TVOUT_TVE) += tve.o
diff --git a/drivers/video/mxc/mxcfb_claa_wvga.c b/drivers/video/mxc/mxcfb_claa_wvga.c
new file mode 100644
index 000000000000..9ce25d48d6cb
--- /dev/null
+++ b/drivers/video/mxc/mxcfb_claa_wvga.c
@@ -0,0 +1,219 @@
+/*
+ * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
+ */
+
+/*
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+/*!
+ * @defgroup Framebuffer Framebuffer Driver for SDC and ADC.
+ */
+
+/*!
+ * @file mxcfb_claa_wvga.c
+ *
+ * @brief MXC Frame buffer driver for SDC
+ *
+ * @ingroup Framebuffer
+ */
+
+/*!
+ * Include files
+ */
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/console.h>
+#include <linux/delay.h>
+#include <linux/errno.h>
+#include <linux/fb.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/regulator/regulator.h>
+#include <asm/arch/mxcfb.h>
+
+static void lcd_poweron(void);
+static void lcd_poweroff(void);
+
+static struct platform_device *plcd_dev;
+static struct regulator *io_reg;
+static int lcd_on;
+
+static struct fb_videomode video_modes[] = {
+ {
+ /* 800x480 @ 55 Hz , pixel clk @ 25MHz */
+ "CLAA-WVGA", 55, 800, 480, 40000, 80, 0, 10, 0, 20, 10,
+ FB_SYNC_OE_ACT_HIGH,
+ FB_VMODE_NONINTERLACED,
+ 0,},
+};
+
+static void lcd_init_fb(struct fb_info *info)
+{
+ struct fb_var_screeninfo var;
+
+ memset(&var, 0, sizeof(var));
+
+ fb_videomode_to_var(&var, &video_modes[0]);
+
+ var.activate = FB_ACTIVATE_ALL;
+ var.yres_virtual = var.yres * 2;
+
+ acquire_console_sem();
+ info->flags |= FBINFO_MISC_USEREVENT;
+ fb_set_var(info, &var);
+ info->flags &= ~FBINFO_MISC_USEREVENT;
+ release_console_sem();
+}
+
+static int lcd_fb_event(struct notifier_block *nb, unsigned long val, void *v)
+{
+ struct fb_event *event = v;
+
+ if (strcmp(event->info->fix.id, "DISP3 BG")) {
+ return 0;
+ }
+
+ switch (val) {
+ case FB_EVENT_FB_REGISTERED:
+ lcd_init_fb(event->info);
+ lcd_poweron();
+ break;
+ case FB_EVENT_BLANK:
+ if ((event->info->var.xres != 800) ||
+ (event->info->var.yres != 480)) {
+ break;
+ }
+ if (*((int *)event->data) == FB_BLANK_UNBLANK) {
+ lcd_poweron();
+ } else {
+ lcd_poweroff();
+ }
+ break;
+ }
+ return 0;
+}
+
+static struct notifier_block nb = {
+ .notifier_call = lcd_fb_event,
+};
+
+/*!
+ * This function is called whenever the SPI slave device is detected.
+ *
+ * @param spi the SPI slave device
+ *
+ * @return Returns 0 on SUCCESS and error on FAILURE.
+ */
+static int __devinit lcd_probe(struct platform_device *pdev)
+{
+ int i;
+ struct mxc_lcd_platform_data *plat = pdev->dev.platform_data;
+
+ if (plat) {
+ if (plat->reset)
+ plat->reset();
+
+ io_reg = regulator_get(&pdev->dev, plat->io_reg);
+ regulator_enable(io_reg);
+ }
+
+ for (i = 0; i < num_registered_fb; i++) {
+ if (strcmp(registered_fb[i]->fix.id, "DISP3 BG") == 0) {
+ lcd_init_fb(registered_fb[i]);
+ fb_show_logo(registered_fb[i], 0);
+ lcd_poweron();
+ } else if (strcmp(registered_fb[i]->fix.id, "DISP3 FG") == 0) {
+ lcd_init_fb(registered_fb[i]);
+ }
+ }
+
+ fb_register_client(&nb);
+
+ plcd_dev = pdev;
+
+ return 0;
+}
+
+static int __devexit lcd_remove(struct platform_device *pdev)
+{
+ fb_unregister_client(&nb);
+ lcd_poweroff();
+ regulator_put(io_reg, &pdev->dev);
+
+ return 0;
+}
+
+#ifdef CONFIG_PM
+static int lcd_suspend(struct platform_device *pdev, pm_message_t state)
+{
+ return 0;
+}
+
+static int lcd_resume(struct platform_device *pdev)
+{
+ return 0;
+}
+#else
+#define lcd_suspend NULL
+#define lcd_resume NULL
+#endif
+
+/*!
+ * platform driver structure for CLAA WVGA
+ */
+static struct platform_driver lcd_driver = {
+ .driver = {
+ .name = "lcd_claa"},
+ .probe = lcd_probe,
+ .remove = __devexit_p(lcd_remove),
+ .suspend = lcd_suspend,
+ .resume = lcd_resume,
+};
+
+/*
+ * Send Power On commands to L4F00242T03
+ *
+ */
+static void lcd_poweron(void)
+{
+ if (lcd_on)
+ return;
+
+ dev_dbg(&plcd_dev->dev, "turning on LCD\n");
+ regulator_enable(io_reg);
+ lcd_on = 1;
+}
+
+/*
+ * Send Power Off commands to L4F00242T03
+ *
+ */
+static void lcd_poweroff(void)
+{
+ lcd_on = 0;
+ dev_dbg(&plcd_dev->dev, "turning off LCD\n");
+ regulator_disable(io_reg);
+}
+
+static int __init claa_lcd_init(void)
+{
+ return platform_driver_register(&lcd_driver);
+}
+
+static void __exit claa_lcd_exit(void)
+{
+ platform_driver_unregister(&lcd_driver);
+}
+
+module_init(claa_lcd_init);
+module_exit(claa_lcd_exit);
+
+MODULE_AUTHOR("Freescale Semiconductor, Inc.");
+MODULE_DESCRIPTION("CLAA WVGA LCD init driver");
+MODULE_LICENSE("GPL");