Author: titmuss
Date: Fri Jan 2 09:13:47 2009
New Revision: 3657
URL: http://svn.slimdevices.com?rev=3657&root=Jive&view=rev
Log:
r3...@harrypotter (orig r3640): titmuss | 2008-12-29 23:30:54 +0000
Bug: N/A
Description:
Driver changes to suport vgg243271 lcd panel for jive refresh.
Added:
7.3/trunk/squeezeos/src/s3c2412/linux-2.6.22/drivers/video/backlight/vgg243271.c
Modified:
7.3/trunk/ (props changed)
7.3/trunk/squeezeos/src/s3c2412/linux-2.6.22/.config
7.3/trunk/squeezeos/src/s3c2412/linux-2.6.22/arch/arm/mach-s3c2412/mach-jive.c
7.3/trunk/squeezeos/src/s3c2412/linux-2.6.22/drivers/video/backlight/Kconfig
7.3/trunk/squeezeos/src/s3c2412/linux-2.6.22/drivers/video/backlight/Makefile
Propchange: 7.3/trunk/
------------------------------------------------------------------------------
--- svk:merge (original)
+++ svk:merge Fri Jan 2 09:13:47 2009
@@ -2,6 +2,7 @@
bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.1/branches/discovery-refactor:2596
bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.1/trunk:2920
bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.2/trunk:2921
+bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.3/private-branches/jive-refresh:3640
bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/7.0:2013
bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/SN:1083
bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/scrolling:1378
Modified: 7.3/trunk/squeezeos/src/s3c2412/linux-2.6.22/.config
URL:
http://svn.slimdevices.com/7.3/trunk/squeezeos/src/s3c2412/linux-2.6.22/.config?rev=3657&root=Jive&r1=3656&r2=3657&view=diff
==============================================================================
--- 7.3/trunk/squeezeos/src/s3c2412/linux-2.6.22/.config (original)
+++ 7.3/trunk/squeezeos/src/s3c2412/linux-2.6.22/.config Fri Jan 2 09:13:47
2009
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.22
-# Mon Apr 14 11:50:24 2008
+# Mon Dec 29 12:43:28 2008
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -54,7 +54,7 @@
# CONFIG_BLK_DEV_INITRD is not set
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_SYSCTL=y
-# CONFIG_EMBEDDED is not set
+CONFIG_EMBEDDED=y
CONFIG_UID16=y
CONFIG_SYSCTL_SYSCALL=y
CONFIG_KALLSYMS=y
@@ -581,10 +581,7 @@
#
# Userland interfaces
#
-CONFIG_INPUT_MOUSEDEV=y
-# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
-CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
-CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_MOUSEDEV is not set
# CONFIG_INPUT_JOYDEV is not set
# CONFIG_INPUT_TSDEV is not set
CONFIG_INPUT_EVDEV=y
@@ -616,6 +613,7 @@
#
CONFIG_SERIO=y
CONFIG_SERIO_SERPORT=y
+# CONFIG_SERIO_LIBPS2 is not set
# CONFIG_SERIO_RAW is not set
# CONFIG_GAMEPORT is not set
@@ -774,6 +772,7 @@
CONFIG_LCD_CLASS_DEVICE=y
CONFIG_LCD_ILI9320=y
CONFIG_LCD_VGG2432A4=y
+CONFIG_LCD_VGG243271=y
#
# Display device support
@@ -993,7 +992,8 @@
CONFIG_MINI_FO=y
# CONFIG_MINIX_FS is not set
# CONFIG_ROMFS_FS is not set
-# CONFIG_INOTIFY is not set
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
# CONFIG_QUOTA is not set
CONFIG_DNOTIFY=y
# CONFIG_AUTOFS_FS is not set
@@ -1151,7 +1151,7 @@
# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
# CONFIG_DEBUG_KOBJECT is not set
-CONFIG_DEBUG_BUGVERBOSE=y
+# CONFIG_DEBUG_BUGVERBOSE is not set
# CONFIG_DEBUG_INFO is not set
# CONFIG_DEBUG_VM is not set
# CONFIG_DEBUG_LIST is not set
Modified:
7.3/trunk/squeezeos/src/s3c2412/linux-2.6.22/arch/arm/mach-s3c2412/mach-jive.c
URL:
http://svn.slimdevices.com/7.3/trunk/squeezeos/src/s3c2412/linux-2.6.22/arch/arm/mach-s3c2412/mach-jive.c?rev=3657&root=Jive&r1=3656&r2=3657&view=diff
==============================================================================
---
7.3/trunk/squeezeos/src/s3c2412/linux-2.6.22/arch/arm/mach-s3c2412/mach-jive.c
(original)
+++
7.3/trunk/squeezeos/src/s3c2412/linux-2.6.22/arch/arm/mach-s3c2412/mach-jive.c
Fri Jan 2 09:13:47 2009
@@ -400,6 +400,8 @@
.suspend = ILI9320_SUSPEND_DEEP,
.entry_mode = ILI9320_ENTRYMODE_ID(3) | ILI9320_ENTRYMODE_BGR,
+
+#if 0
.display2 = (ILI9320_DISPLAY2_FP(LCD_UPPER_MARGIN) |
ILI9320_DISPLAY2_BP(LCD_LOWER_MARGIN)),
.display3 = 0x0,
@@ -413,10 +415,26 @@
ILI9320_INTERFACE4_DIVE(1)),
.interface5 = 0x0,
.interface6 = 0x0,
+#else
+ .display2 = (ILI9320_DISPLAY2_FP(LCD_UPPER_MARGIN) |
+ ILI9320_DISPLAY2_BP(LCD_LOWER_MARGIN)),
+ .display3 = 0x0,
+ .display4 = 0x0,
+ .rgb_if1 = (ILI9320_RGBIF1_RIM_RGB16 |
+ ILI9320_RGBIF1_RM | ILI9320_RGBIF1_CLK_RGBIF),
+ .rgb_if2 = ILI9320_RGBIF2_DPL,
+ .interface2 = 0x0,
+#endif
};
/* LCD SPI support */
+static void jive_lcd_spi_chipselect(struct s3c2410_spigpio_info *spi, int cs)
+{
+ s3c2410_gpio_setpin(S3C2410_GPB7, cs ? 0 : 1);
+}
+
+#if 0
static struct spi_board_info jive_lcd_spi_board[] = {
[0] = {
.modalias = "VGG2432A4",
@@ -427,11 +445,6 @@
},
};
-static void jive_lcd_spi_chipselect(struct s3c2410_spigpio_info *spi, int cs)
-{
- s3c2410_gpio_setpin(S3C2410_GPB7, cs ? 0 : 1);
-}
-
static struct s3c2410_spigpio_info jive_lcd_spi = {
.bus_num = 0,
.pin_clk = S3C2410_GPG8,
@@ -440,6 +453,26 @@
.board_info = jive_lcd_spi_board,
.board_size = ARRAY_SIZE(jive_lcd_spi_board),
};
+#else
+static struct spi_board_info jive_lcd_spi_board[] = {
+ [0] = {
+ .modalias = "VGG243271",
+ .chip_select = 0,
+ .mode = SPI_MODE_3, /* CPOL=1, CPHA=1 */
+ .max_speed_hz = 100000, /* todo: confirm */
+ .platform_data = &jive_lcm_config,
+ },
+};
+
+static struct s3c2410_spigpio_info jive_lcd_spi = {
+ .bus_num = 0,
+ .pin_clk = S3C2410_GPG8,
+ .pin_mosi = S3C2410_GPB8,
+ .chip_select = jive_lcd_spi_chipselect,
+ .board_info = jive_lcd_spi_board,
+ .board_size = ARRAY_SIZE(jive_lcd_spi_board),
+};
+#endif
static struct platform_device jive_device_lcdspi = {
.name = "s3c24xx-spi-gpio",
Modified:
7.3/trunk/squeezeos/src/s3c2412/linux-2.6.22/drivers/video/backlight/Kconfig
URL:
http://svn.slimdevices.com/7.3/trunk/squeezeos/src/s3c2412/linux-2.6.22/drivers/video/backlight/Kconfig?rev=3657&root=Jive&r1=3656&r2=3657&view=diff
==============================================================================
---
7.3/trunk/squeezeos/src/s3c2412/linux-2.6.22/drivers/video/backlight/Kconfig
(original)
+++
7.3/trunk/squeezeos/src/s3c2412/linux-2.6.22/drivers/video/backlight/Kconfig
Fri Jan 2 09:13:47 2009
@@ -88,3 +88,12 @@
help
If you have a VGG2432A4 panel based on the ILI9320 controller chip
then say y to include a power driver for it.
+
+config LCD_VGG243271
+ tristate "VGG243271 LCM device support"
+ depends on BACKLIGHT_LCD_SUPPORT && LCD_CLASS_DEVICE && SPI_MASTER
+ select LCD_ILI9320
+ default n
+ help
+ If you have a VGG243271 panel based on the ILI9325 controller chip
+ then say y to include a power driver for it.
Modified:
7.3/trunk/squeezeos/src/s3c2412/linux-2.6.22/drivers/video/backlight/Makefile
URL:
http://svn.slimdevices.com/7.3/trunk/squeezeos/src/s3c2412/linux-2.6.22/drivers/video/backlight/Makefile?rev=3657&root=Jive&r1=3656&r2=3657&view=diff
==============================================================================
---
7.3/trunk/squeezeos/src/s3c2412/linux-2.6.22/drivers/video/backlight/Makefile
(original)
+++
7.3/trunk/squeezeos/src/s3c2412/linux-2.6.22/drivers/video/backlight/Makefile
Fri Jan 2 09:13:47 2009
@@ -9,4 +9,5 @@
obj-$(CONFIG_BACKLIGHT_CARILLO_RANCH) += cr_bllcd.o
obj-$(CONFIG_LCD_ILI9320) += ili9320.o
-obj-$(CONFIG_LCD_VGG2432A4) += vgg2432a4.o
+obj-$(CONFIG_LCD_VGG2432A4) += vgg2432a4.o
+obj-$(CONFIG_LCD_VGG243271) += vgg243271.o
Added:
7.3/trunk/squeezeos/src/s3c2412/linux-2.6.22/drivers/video/backlight/vgg243271.c
URL:
http://svn.slimdevices.com/7.3/trunk/squeezeos/src/s3c2412/linux-2.6.22/drivers/video/backlight/vgg243271.c?rev=3657&root=Jive&view=auto
==============================================================================
---
7.3/trunk/squeezeos/src/s3c2412/linux-2.6.22/drivers/video/backlight/vgg243271.c
(added)
+++
7.3/trunk/squeezeos/src/s3c2412/linux-2.6.22/drivers/video/backlight/vgg243271.c
Fri Jan 2 09:13:47 2009
@@ -1,0 +1,291 @@
+/* drivers/video/backlight/vgg243271.c
+ *
+ * VGG243271 (ILI9320) LCD controller driver.
+ *
+ * Copyright 2008 Logitech
+ * Richard Titmuss <[email protected]>
+ *
+ * Based on:
+ * VGG2432A4 (ILI9320) LCD controller driver
+ *
+ * Copyright 2007 Simtec Electronics
+ * Ben Dooks <[email protected]>
+ *
+ * http://armlinux.simtec.co.uk/
+ *
+ * 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.
+*/
+
+#include <linux/delay.h>
+#include <linux/err.h>
+#include <linux/fb.h>
+#include <linux/init.h>
+#include <linux/lcd.h>
+#include <linux/module.h>
+
+#include <linux/spi/spi.h>
+
+#include <video/ili9320.h>
+
+#include "ili9320.h"
+
+/* Device initialisation sequences */
+
+static struct ili9320_reg vgg_init1[] = {
+ {
+ .address = ILI9320_POWER1,
+ .value = ILI9320_POWER1_AP(0) | ILI9320_POWER1_BT(0),
+ }, {
+ .address = ILI9320_POWER2,
+ .value = ILI9320_POWER2_VC(7) | ILI9320_POWER2_DC0(0) |
ILI9320_POWER2_DC1(0),
+ }, {
+ .address = ILI9320_POWER3,
+ .value = ILI9320_POWER3_VRH(0),
+ }, {
+ .address = ILI9320_POWER4,
+ .value = ILI9320_POWER4_VREOUT(0),
+ },
+};
+
+static struct ili9320_reg vgg_init2[] = {
+ {
+ .address = ILI9320_POWER1,
+ .value = ILI9320_POWER1_AP(1) | ILI9320_POWER1_APE |
ILI9320_POWER1_BT(4) | ILI9320_POWER1_SAP,
+ }, {
+ .address = ILI9320_POWER2,
+ .value = ILI9320_POWER2_VC(7) | ILI9320_POWER2_DC0(2) |
ILI9320_POWER2_DC1(2),
+ }
+};
+
+static struct ili9320_reg vgg_gamma[] = {
+ {
+ .address = ILI9320_GAMMA1,
+ .value = 0x0000,
+ }, {
+ .address = ILI9320_GAMMA2,
+ .value = 0x0506,
+ }, {
+ .address = ILI9320_GAMMA3,
+ .value = 0x0104,
+ }, {
+ .address = ILI9320_GAMMA4,
+ .value = 0x0207,
+ }, {
+ .address = ILI9320_GAMMA5,
+ .value = 0x000F,
+ }, {
+ .address = ILI9320_GAMMA6,
+ .value = 0x0306,
+ }, {
+ .address = ILI9320_GAMMA7,
+ .value = 0x0102,
+ }, {
+ .address = ILI9320_GAMMA8,
+ .value = 0x0707,
+ }, {
+ .address = ILI9320_GAMMA9,
+ .value = 0x0702,
+ }, {
+ .address = ILI9320_GAMMA10,
+ .value = 0x1604,
+ }
+
+};
+
+static struct ili9320_reg vgg_init0[] = {
+ [0] = {
+ /* set direction and scan mode gate */
+ .address = ILI9320_DRIVER,
+ .value = ILI9320_DRIVER_SS,
+ }, {
+ .address = ILI9320_DRIVEWAVE,
+ .value = ILI9320_DRIVEWAVE_MUSTSET | ILI9320_DRIVEWAVE_EOR |
ILI9320_DRIVEWAVE_BC,
+ }, {
+ .address = ILI9320_ENTRYMODE,
+ .value = ILI9320_ENTRYMODE_ID(3) | ILI9320_ENTRYMODE_BGR,
+ }, {
+ .address = ILI9320_RESIZING,
+ .value = 0x0,
+ },
+};
+
+
+static int vgg243271_lcd_init(struct ili9320 *lcd,
+ struct ili9320_platdata *cfg)
+{
+ unsigned int addr;
+ int ret;
+
+ /* Set internal timing */
+ ret = ili9320_write(lcd, 0x00e3, 0x3008);
+ if (ret)
+ goto err_initial;
+
+ ret = ili9320_write(lcd, 0x00e7, 0x0012);
+ if (ret)
+ goto err_initial;
+
+ ret = ili9320_write(lcd, 0x00ef, 0x1231);
+ if (ret)
+ goto err_initial;
+
+ /* must wait at-lesat 10ms after starting */
+ mdelay(15);
+
+ ret = ili9320_write_regs(lcd, vgg_init0, ARRAY_SIZE(vgg_init0));
+ if (ret != 0)
+ goto err_initial;
+
+ ili9320_write(lcd, ILI9320_DISPLAY2, cfg->display2);
+ ili9320_write(lcd, ILI9320_DISPLAY3, cfg->display3);
+ ili9320_write(lcd, ILI9320_DISPLAY4, cfg->display4);
+
+ ili9320_write(lcd, ILI9320_RGB_IF1, cfg->rgb_if1);
+ ili9320_write(lcd, ILI9320_FRAMEMAKER, 0x0);
+ ili9320_write(lcd, ILI9320_RGB_IF2, cfg->rgb_if2);
+
+ ret = ili9320_write_regs(lcd, vgg_init1, ARRAY_SIZE(vgg_init1));
+ if (ret != 0)
+ goto err_vgg;
+
+ mdelay(300);
+
+ ret = ili9320_write_regs(lcd, vgg_init2, ARRAY_SIZE(vgg_init2));
+ if (ret != 0)
+ goto err_vgg2;
+
+ mdelay(100);
+
+ ili9320_write(lcd, ILI9320_POWER3, 0x001c);
+
+ mdelay(100);
+
+ ili9320_write(lcd, ILI9320_POWER4, 0x1a00);
+ ili9320_write(lcd, ILI9320_POWER7, 0x0025);
+
+ mdelay(100);
+
+ ili9320_write(lcd, ILI9320_FRAME_RATE_COLOUR, 0x0C);
+
+ mdelay(100);
+
+ ili9320_write(lcd, ILI9320_GRAM_HORIZ_ADDR, 0x00);
+ ili9320_write(lcd, ILI9320_GRAM_VERT_ADD, 0x00);
+
+ ret = ili9320_write_regs(lcd, vgg_gamma, ARRAY_SIZE(vgg_gamma));
+ if (ret != 0)
+ goto err_vgg3;
+
+ ili9320_write(lcd, ILI9320_HORIZ_START, 0x0);
+ ili9320_write(lcd, ILI9320_HORIZ_END, cfg->hsize - 1);
+ ili9320_write(lcd, ILI9320_VERT_START, 0x0);
+ ili9320_write(lcd, ILI9320_VERT_END, cfg->vsize - 1);
+
+ ili9320_write(lcd, ILI9320_DRIVER2,
+ ILI9320_DRIVER2_GS |
+ ILI9320_DRIVER2_NL(((cfg->vsize - 240) / 8) + 0x1D));
+
+ ili9320_write(lcd, ILI9320_BASE_IMAGE, 0x1);
+ ili9320_write(lcd, ILI9320_VERT_SCROLL, 0x00);
+
+ for (addr = ILI9320_PARTIAL1_POSITION; addr <= ILI9320_PARTIAL2_END;
+ addr++) {
+ ili9320_write(lcd, addr, 0x0);
+ }
+
+ ili9320_write(lcd, ILI9320_INTERFACE1, 0x10);
+ ili9320_write(lcd, ILI9320_INTERFACE2, cfg->interface2);
+
+ lcd->display1 = (ILI9320_DISPLAY1_D(3) | ILI9320_DISPLAY1_DTE |
+ ILI9320_DISPLAY1_GON | ILI9320_DISPLAY1_BASEE);
+
+ ili9320_write(lcd, ILI9320_DISPLAY1, lcd->display1);
+
+ return 0;
+
+ err_vgg3:
+ err_vgg2:
+ err_vgg:
+ err_initial:
+ return ret;
+}
+
+#ifdef CONFIG_PM
+static int vgg243271_suspend(struct spi_device *spi, pm_message_t state)
+{
+ return ili9320_suspend(dev_get_drvdata(&spi->dev), state);
+}
+
+static int vgg243271_resume(struct spi_device *spi)
+{
+ return ili9320_resume(dev_get_drvdata(&spi->dev));
+}
+#else
+#define vgg243271_suspend NULL
+#define vgg243271_resume NULL
+#endif
+
+static struct ili9320_client vgg243271_client = {
+ .name = "VGG243271",
+ .init = vgg243271_lcd_init,
+};
+
+/* Device probe */
+
+static int __devinit vgg243271_probe(struct spi_device *spi)
+{
+ int ret;
+
+ ret = ili9320_probe_spi(spi, &vgg243271_client);
+ if (ret != 0) {
+ dev_err(&spi->dev, "failed to initialise ili9320\n");
+ return ret;
+ }
+
+ return 0;
+}
+
+static int __devexit vgg243271_remove(struct spi_device *spi)
+{
+ return ili9320_remove(dev_get_drvdata(&spi->dev));
+}
+
+static void vgg243271_shutdown(struct spi_device *spi)
+{
+ ili9320_shutdown(dev_get_drvdata(&spi->dev));
+}
+
+static struct spi_driver vgg243271_driver = {
+ .driver = {
+ .name = "VGG243271",
+ .owner = THIS_MODULE,
+ },
+ .probe = vgg243271_probe,
+ .remove = __devexit_p(vgg243271_remove),
+ .shutdown = vgg243271_shutdown,
+ .suspend = vgg243271_suspend,
+ .resume = vgg243271_resume,
+};
+
+/* Device driver initialisation */
+
+static int __init vgg243271_init(void)
+{
+ return spi_register_driver(&vgg243271_driver);
+}
+
+static void __exit vgg243271_exit(void)
+{
+ spi_unregister_driver(&vgg243271_driver);
+}
+
+module_init(vgg243271_init);
+module_exit(vgg243271_exit);
+
+MODULE_AUTHOR("Richard Titmuss <[email protected]>");
+MODULE_DESCRIPTION("VGG243271 LCD Driver");
+MODULE_LICENSE("GPLv2");
+
+
_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive-checkins