[Armadeus-commitlog] armadeus branch, master, updated. release-3.2-106-g76c93b6
Brought to you by:
sszy
|
From: Fabien M <fa...@us...> - 2010-01-14 13:35:43
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 76c93b6327804b46cf924cfec0036e348cbef0de (commit)
via c963cd8e056e998f3e65dbc164ea530c12d1b3a6 (commit)
via 5ba2ecd31c0faee73f87578597eb2472e42671cc (commit)
from 33302c7045f183e6849cfe8037952b3b75ec6958 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 76c93b6327804b46cf924cfec0036e348cbef0de
Author: Fabien Marteau <fab...@ar...>
Date: Thu Jan 14 14:32:09 2010 +0100
[LINUX] Improve configuration file to add HX5116_DISPLAY
commit c963cd8e056e998f3e65dbc164ea530c12d1b3a6
Author: Fabien Marteau <fab...@ar...>
Date: Thu Jan 14 14:25:54 2010 +0100
[LINUX] Add hx5116-display driver in ARMadeus specific drivers directory
commit 5ba2ecd31c0faee73f87578597eb2472e42671cc
Author: Fabien Marteau <fab...@ar...>
Date: Thu Jan 14 14:22:38 2010 +0100
[LINUX] HX5116-display header improve. (adding reset function in structure
-----------------------------------------------------------------------
Summary of changes:
.../armadeus/apf27/apf27-linux-2.6.29.config | 1 +
.../2.6.29/343-apf27-amoled-hx5116.patch | 5 +-
target/linux/modules/Kconfig | 2 +
target/linux/modules/Makefile | 2 +-
target/linux/modules/display/Kconfig | 12 +
target/linux/modules/{max1027 => display}/Makefile | 4 +-
target/linux/modules/display/hx5116_display.c | 258 ++++++++++++++++++++
7 files changed, 279 insertions(+), 5 deletions(-)
create mode 100644 target/linux/modules/display/Kconfig
copy target/linux/modules/{max1027 => display}/Makefile (82%)
mode change 100755 => 100644
create mode 100644 target/linux/modules/display/hx5116_display.c
diff --git a/buildroot/target/device/armadeus/apf27/apf27-linux-2.6.29.config b/buildroot/target/device/armadeus/apf27/apf27-linux-2.6.29.config
index 0d79290..dc5c9ad 100644
--- a/buildroot/target/device/armadeus/apf27/apf27-linux-2.6.29.config
+++ b/buildroot/target/device/armadeus/apf27/apf27-linux-2.6.29.config
@@ -1435,6 +1435,7 @@ CONFIG_ARMADEUS_FPGA_LOADER_DRIVER=m
#
CONFIG_ARMADEUS_PWM_DRIVER=m
CONFIG_IMX_BACKLIGHT=m
+# CONFIG_HX5116_DISPLAY is not set
#
# Communication bus related
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/343-apf27-amoled-hx5116.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/343-apf27-amoled-hx5116.patch
index 723dfb9..47ddaae 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/343-apf27-amoled-hx5116.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.29/343-apf27-amoled-hx5116.patch
@@ -1,8 +1,8 @@
Index: linux-2.6.29.6/include/video/hx5116.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.29.6/include/video/hx5116.h 2010-01-13 15:56:02.000000000 +0100
-@@ -0,0 +1,112 @@
++++ linux-2.6.29.6/include/video/hx5116.h 2010-01-14 14:19:29.000000000 +0100
+@@ -0,0 +1,113 @@
+/*
+ *
+ * HX5116 160CH Single Chip Driver for LPTS AMOLED
@@ -111,6 +111,7 @@ Index: linux-2.6.29.6/include/video/hx5116.h
+ struct display_device *display_dev;
+ struct spi_device *spi; /* spi bus */
+ void (*power_on)(int); /* function that power on screen */
++ void (*reset_on)(int); /* function that let hx5116 on reset */
+ int gcontrast_value; /* current contrast value */
+};
+
diff --git a/target/linux/modules/Kconfig b/target/linux/modules/Kconfig
index 6262ced..5b72c11 100644
--- a/target/linux/modules/Kconfig
+++ b/target/linux/modules/Kconfig
@@ -35,6 +35,8 @@ source "drivers/armadeus/pwm/Kconfig"
source "drivers/armadeus/backlight/Kconfig"
+source "drivers/armadeus/display/Kconfig"
+
comment "Communication bus related"
depends on ARMADEUS_DRIVERS
diff --git a/target/linux/modules/Makefile b/target/linux/modules/Makefile
index d124d3d..c548550 100755
--- a/target/linux/modules/Makefile
+++ b/target/linux/modules/Makefile
@@ -9,7 +9,7 @@ ifneq ($(KERNELRELEASE),)
# Part executed when called from kernel build system:
obj-$(CONFIG_ARMADEUS_DRIVERS) += gpio/ pwm/ backlight/ isp1761/ \
- imxlkeypad/ fpga/ max1027/ max9768/
+ imxlkeypad/ fpga/ max1027/ max9768/ display/
else
diff --git a/target/linux/modules/display/Kconfig b/target/linux/modules/display/Kconfig
new file mode 100644
index 0000000..54e2cfb
--- /dev/null
+++ b/target/linux/modules/display/Kconfig
@@ -0,0 +1,12 @@
+#
+#
+
+config HX5116_DISPLAY
+ tristate "HX5116 AMOLED display driver"
+ default n
+ depends on ARMADEUS_DRIVERS
+ select DISPLAY_SUPPORT
+ ---help---
+ This driver allows you to control the contrast of
+ HX5116 based AMOLED screen.
+
diff --git a/target/linux/modules/max1027/Makefile b/target/linux/modules/display/Makefile
old mode 100755
new mode 100644
similarity index 82%
copy from target/linux/modules/max1027/Makefile
copy to target/linux/modules/display/Makefile
index aef647a..7783230
--- a/target/linux/modules/max1027/Makefile
+++ b/target/linux/modules/display/Makefile
@@ -1,11 +1,11 @@
#
-# Makefile for the Armadeus Max1027
+# Makefile for the i.MXL backlight driver
#
# Part executed when called from kernel build system:
ifneq ($(KERNELRELEASE),)
-obj-$(CONFIG_ARMADEUS_MAX1027) += max1027.o
+obj-$(CONFIG_HX5116_DISPLAY) += hx5116_display.o
# Part executed when called from standard make in this directory:
# (preferably use Makefile in parent directory)
diff --git a/target/linux/modules/display/hx5116_display.c b/target/linux/modules/display/hx5116_display.c
new file mode 100644
index 0000000..e1a1827
--- /dev/null
+++ b/target/linux/modules/display/hx5116_display.c
@@ -0,0 +1,258 @@
+/*
+ * Display Driver for hx5116 controler for AMOLED
+ *
+ * Copyright (c) 2009 Fabien Marteau - ARMadeus Systems
+ *
+ * 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/module.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/mutex.h>
+#include <linux/fb.h>
+
+#include <linux/display.h>
+#include <linux/spi/spi.h>
+
+#include <linux/version.h>
+#include <mach/imxfb.h> /* Backlight machinfo struct is defined here */
+#include <mach/hardware.h>
+
+#include <video/hx5116.h>
+
+#define DRIVER_NAME "hx5116-display"
+#define DRIVER_VERSION "0.3"
+
+/* write value hx5116 display register via SPI */
+void hx5116_write(struct hx5116_display *hx5116_dev, u8 address, u16 data)
+{
+ u8 command[2];
+ int ret;
+ /* Address */
+ command[0] = (address << 1) | HX5116_SPI_WRITE;
+ command[1] = data;
+ ret = spi_write(hx5116_dev->spi, command, 2);
+ if (ret < 0)
+ printk("ERROR: can't write on hx5116\n");
+
+}
+
+/* XXX: not functionnal, need half duplex capability under spi_gpio driver */
+u8 hx5116_read(struct hx5116_display *hx5116_dev, u8 address)
+{
+ u8 command;
+ ssize_t ret;
+
+ /* Address */
+ command = (address << 1) | HX5116_SPI_READ;
+ ret = spi_w8r8(hx5116_dev->spi, command);
+ if (ret < 0)
+ printk("ERROR: can't read on hx5116\n");
+ return (u8)ret;
+}
+
+static int hx5116_display_get_contrast(struct display_device *dev)
+{
+ struct hx5116_display *hx5116_dev = dev->priv_data;
+ /* TODO: read register value with spi_w8r8 */
+ return hx5116_dev->gcontrast_value;
+}
+
+static int hx5116_display_set_contrast(struct display_device *dev, unsigned int value)
+{
+ struct hx5116_display *hx5116_dev = dev->priv_data;
+
+ hx5116_write(hx5116_dev, HX5116_RGB_CONTRAST, value);
+ hx5116_dev->gcontrast_value = value;
+ return value;
+}
+
+static int hx5116_display_probe(struct display_device *dev, void *data)
+{
+ return 1;
+}
+
+static int hx5116_display_remove(struct display_device *dev)
+{
+
+ return 0;
+}
+
+#ifdef CONFIG_PM
+static void hx5116_display_suspend(struct display_device *dev, pm_message_t state)
+{
+ struct hx5116_display *hx5116_dev = dev->priv_data;
+ hx5116_dev->power_on(0); /* switch off AMOLED power */
+}
+
+static void hx5116_display_resume(struct display_device *dev)
+{
+ struct hx5116_display *hx5116_dev = dev->priv_data;
+ hx5116_dev->power_on(1); /* switch on AMOLED power */
+}
+#else
+#define hx5116_display_suspend NULL
+#define hx5116_display_resume NULL
+#endif /* CONFIG_PM */
+
+static struct display_driver hx5116_ops = {
+ .get_contrast = hx5116_display_get_contrast,
+ .set_contrast = hx5116_display_set_contrast,
+ .probe = hx5116_display_probe,
+ .suspend = hx5116_display_suspend,
+ .resume = hx5116_display_resume,
+ .remove = hx5116_display_remove,
+ .max_contrast = 63,
+};
+
+
+static void hx5116_init_sequence(struct hx5116_display *hx5116_dev)
+{
+ hx5116_dev->reset_on(0); /* reset off */
+
+ /* initial procedure for 24-bit parallel RGB (DE) */
+ hx5116_write (hx5116_dev, 0x04, 0x23); /*set display mode 24-bit parallel RGB (DE)*/
+ hx5116_write (hx5116_dev, 0x05, 0x82); /*set display mode*/
+ hx5116_write (hx5116_dev, 0x07, 0x0F); /*set driver capability*/
+ hx5116_write (hx5116_dev, 0x34, 0x18); /*set display timing*/
+ hx5116_write (hx5116_dev, 0x35, 0x28); /*set display timing*/
+ hx5116_write (hx5116_dev, 0x36, 0x16); /*set display timing*/
+ hx5116_write (hx5116_dev, 0x37, 0x01); /*set display timing*/
+ hx5116_write (hx5116_dev, 0x02, 0x02); /*OTP On*/
+ hx5116_write (hx5116_dev, 0x0A, 0x79); /*VGHVGL=+/-6V*/
+ hx5116_write (hx5116_dev, 0x09, 0x20); /*VGAM1OUT=4.85V*/
+ hx5116_write (hx5116_dev, 0x10, 0x6A); /*set R slop*/
+ hx5116_write (hx5116_dev, 0x11, 0x6A); /*set G slop*/
+ hx5116_write (hx5116_dev, 0x12, 0x68); /*set B slop*/
+ hx5116_write (hx5116_dev, 0x13, 0x00); /*set R_0*/
+ hx5116_write (hx5116_dev, 0x14, 0x04); /*set R_10*/
+ hx5116_write (hx5116_dev, 0x15, 0x05); /*set R_36*/
+ hx5116_write (hx5116_dev, 0x16, 0x05); /*set R_80*/
+ hx5116_write (hx5116_dev, 0x17, 0x04); /*set R_124*/
+ hx5116_write (hx5116_dev, 0x18, 0x03); /*set R_168*/
+ hx5116_write (hx5116_dev, 0x19, 0x02); /*set R_212*/
+ hx5116_write (hx5116_dev, 0x1A, 0x02); /*set R_255*/
+ hx5116_write (hx5116_dev, 0x1B, 0x00); /*set G_0*/
+ hx5116_write (hx5116_dev, 0x1C, 0x06); /*set G_10*/
+ hx5116_write (hx5116_dev, 0x1D, 0x05); /*set G_36*/
+ hx5116_write (hx5116_dev, 0x1E, 0x06); /*set G_80*/
+ hx5116_write (hx5116_dev, 0x1F, 0x06); /*set G_124*/
+ hx5116_write (hx5116_dev, 0x20, 0x05); /*set G_168*/
+ hx5116_write (hx5116_dev, 0x21, 0x05); /*set G_212*/
+ hx5116_write (hx5116_dev, 0x22, 0x07); /*set G_255*/
+ hx5116_write (hx5116_dev, 0x23, 0x00); /*set G_0*/
+ hx5116_write (hx5116_dev, 0x24, 0x07); /*set B_10*/
+ hx5116_write (hx5116_dev, 0x25, 0x06); /*set B_36*/
+ hx5116_write (hx5116_dev, 0x26, 0x07); /*set B_80*/
+ hx5116_write (hx5116_dev, 0x27, 0x07); /*set B_124*/
+ hx5116_write (hx5116_dev, 0x28, 0x06); /*set B_168*/
+ hx5116_write (hx5116_dev, 0x29, 0x04); /*set B_212*/
+ hx5116_write (hx5116_dev, 0x2A, 0x07); /*set B_255*/
+ hx5116_write (hx5116_dev, 0x06, 0x03); /*set display on*/
+
+ hx5116_dev->power_on(1); /* switch on AMOLED power */
+}
+
+
+
+static int hx5116_spi_probe(struct spi_device *pdev)
+{
+ int err = -EINVAL;
+ struct display_device *disp_dev;
+ struct hx5116_display *hx5116_dev = pdev->dev.platform_data;
+ /* fill hx5116 display structure */
+ disp_dev = display_device_register(&hx5116_ops,
+ &pdev->dev,
+ hx5116_dev);
+ if (disp_dev == NULL)
+ goto display_device_error;
+ disp_dev->priv_data = hx5116_dev;
+ hx5116_dev->display_dev = disp_dev;
+ hx5116_dev->spi = pdev;
+
+ /* configure spi */
+ hx5116_dev->spi->mode = SPI_MODE_0;
+ hx5116_dev->spi->bits_per_word = 8;
+ hx5116_dev->spi->dev.power.power_state = PMSG_ON;
+ err = spi_setup(hx5116_dev->spi);
+ if (err < 0)
+ {
+ goto spi_error;
+ }
+
+ hx5116_init_sequence(hx5116_dev);
+
+ return 0;
+
+spi_error:
+ printk("ERROR: can't setup spi for hx5116\n");
+ display_device_unregister(hx5116_dev->display_dev);
+display_device_error:
+ printk("ERROR: can't register display device\n");
+ return err;
+}
+
+static int hx5116_spi_remove(struct spi_device *pdev)
+{
+ struct hx5116_display *hx5116_dev = pdev->dev.platform_data;
+
+ hx5116_dev->power_on(0); /* switch off AMOLED power */
+ hx5116_dev->reset_on(1); /* let hx5116 in reset */
+ display_device_unregister(hx5116_dev->display_dev);
+ return 0;
+}
+
+#ifdef CONFIG_PM
+static int hx5116_spi_suspend(struct spi_device *dev, pm_message_t state)
+{
+ return 0;
+}
+
+static int hx5116_spi_resume(struct spi_device *dev)
+{
+ return 0;
+}
+#else
+#define hx5116_suspend NULL
+#define hx5116_resume NULL
+#endif
+
+static void hx5116_spi_shutdown(struct spi_device *spi)
+{
+
+}
+
+static struct spi_driver hx5116_driver = {
+ .probe = hx5116_spi_probe,
+ .remove = hx5116_spi_remove,
+ .shutdown = hx5116_spi_shutdown,
+ .suspend = hx5116_spi_suspend,
+ .resume = hx5116_spi_resume,
+ .driver = {
+ .name = DRIVER_NAME,
+ .owner = THIS_MODULE,
+ },
+};
+
+static int __init hx5116_init(void)
+{
+ return spi_register_driver(&hx5116_driver);
+}
+
+static void __exit hx5116_exit(void)
+{
+ spi_unregister_driver(&hx5116_driver);
+}
+
+module_init(hx5116_init);
+module_exit(hx5116_exit);
+
+MODULE_AUTHOR("Fabien Marteau <fab...@ar...");
+MODULE_DESCRIPTION("HX5116 AMOLED Driver");
+MODULE_LICENSE("GPL");
+
hooks/post-receive
--
armadeus
|