Author: nick
Date: 2012-05-15 14:39:31 +0100 (Tue, 15 May 2012)
New Revision: 1877
Modified:
balloon/branches/menuconfig2/package/kernel/patches/2.6.39.4/s6d04k1.patch
Log:
add DEBUG_VOLTAGE sysfs skeleton for runtime debug of main display panel
Modified: balloon/branches/menuconfig2/package/kernel/patches/2.6.39.4/s6d04k1.patch
===================================================================
--- balloon/branches/menuconfig2/package/kernel/patches/2.6.39.4/s6d04k1.patch 2012-05-14 14:49:33 UTC (rev 1876)
+++ balloon/branches/menuconfig2/package/kernel/patches/2.6.39.4/s6d04k1.patch 2012-05-15 13:39:31 UTC (rev 1877)
@@ -1,7 +1,7 @@
Index: linux-2.6.39.4/drivers/video/Kconfig
===================================================================
---- linux-2.6.39.4.orig/drivers/video/Kconfig 2012-03-22 11:21:31.000000000 +0000
-+++ linux-2.6.39.4/drivers/video/Kconfig 2012-03-22 11:34:21.000000000 +0000
+--- linux-2.6.39.4.orig/drivers/video/Kconfig 2012-05-14 15:48:23.000000000 +0100
++++ linux-2.6.39.4/drivers/video/Kconfig 2012-05-15 14:38:05.000000000 +0100
@@ -634,6 +634,17 @@
To compile this driver as a module, choose M here: the
module will be called bfin_adv7393fb.
@@ -40,8 +40,8 @@
depends on FB && ARCH_PXA
Index: linux-2.6.39.4/drivers/video/Makefile
===================================================================
---- linux-2.6.39.4.orig/drivers/video/Makefile 2012-03-22 11:21:31.000000000 +0000
-+++ linux-2.6.39.4/drivers/video/Makefile 2012-03-22 11:34:21.000000000 +0000
+--- linux-2.6.39.4.orig/drivers/video/Makefile 2012-05-14 15:48:23.000000000 +0100
++++ linux-2.6.39.4/drivers/video/Makefile 2012-05-15 14:38:05.000000000 +0100
@@ -140,6 +140,7 @@
obj-$(CONFIG_FB_NUC900) += nuc900fb.o
obj-$(CONFIG_FB_JZ4740) += jz4740_fb.o
@@ -53,7 +53,7 @@
Index: linux-2.6.39.4/drivers/video/s6d04k1.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.39.4/drivers/video/s6d04k1.c 2012-03-22 11:22:06.000000000 +0000
++++ linux-2.6.39.4/drivers/video/s6d04k1.c 2012-05-14 15:48:31.000000000 +0100
@@ -0,0 +1,1038 @@
+/*
+ * linux/drivers/char/s6d04k1.c
@@ -1096,7 +1096,7 @@
Index: linux-2.6.39.4/drivers/video/s6d04k1.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.39.4/drivers/video/s6d04k1.h 2012-03-22 11:22:06.000000000 +0000
++++ linux-2.6.39.4/drivers/video/s6d04k1.h 2012-05-14 15:48:31.000000000 +0100
@@ -0,0 +1,185 @@
+// s6d04k1 LCD Display Driver interface.
+// Driver for CO240QGLH-T Active OLED display (240 x 320)
@@ -1285,8 +1285,8 @@
+#endif
Index: linux-2.6.39.4/drivers/video/display/Kconfig
===================================================================
---- linux-2.6.39.4.orig/drivers/video/display/Kconfig 2012-03-22 11:21:31.000000000 +0000
-+++ linux-2.6.39.4/drivers/video/display/Kconfig 2012-03-22 11:22:06.000000000 +0000
+--- linux-2.6.39.4.orig/drivers/video/display/Kconfig 2012-05-14 15:48:23.000000000 +0100
++++ linux-2.6.39.4/drivers/video/display/Kconfig 2012-05-14 15:48:31.000000000 +0100
@@ -21,4 +21,8 @@
comment "Display hardware drivers"
depends on DISPLAY_SUPPORT
@@ -1298,8 +1298,8 @@
endmenu
Index: linux-2.6.39.4/drivers/video/display/Makefile
===================================================================
---- linux-2.6.39.4.orig/drivers/video/display/Makefile 2012-03-22 11:21:31.000000000 +0000
-+++ linux-2.6.39.4/drivers/video/display/Makefile 2012-03-22 11:22:06.000000000 +0000
+--- linux-2.6.39.4.orig/drivers/video/display/Makefile 2012-05-14 15:48:23.000000000 +0100
++++ linux-2.6.39.4/drivers/video/display/Makefile 2012-05-14 15:48:31.000000000 +0100
@@ -3,4 +3,5 @@
display-objs := display-sysfs.o
@@ -1309,8 +1309,8 @@
Index: linux-2.6.39.4/drivers/video/display/display-s6d04k1.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.39.4/drivers/video/display/display-s6d04k1.c 2012-03-22 11:25:02.000000000 +0000
-@@ -0,0 +1,808 @@
++++ linux-2.6.39.4/drivers/video/display/display-s6d04k1.c 2012-05-15 14:29:22.000000000 +0100
+@@ -0,0 +1,956 @@
+/*
+ * linux/drivers/char/s6d04k1.c
+ *
@@ -1380,6 +1380,8 @@
+#define S6D04K1_IOC_MAXNR 9
+#define S6D04K1_DEFAULT_BRIGHTNESS 100
+
++#define DEBUG_VOLTAGE
++
+#if defined(CONFIG_SPI_TT) || defined(CONFIG_SPI_TT_MODULE)
+ struct s6d04k1 {
+ struct spi_device *spi;
@@ -1482,7 +1484,7 @@
+ }
+}
+
-+static unblank_fb(void) {
++static void unblank_fb(void) {
+ if (num_registered_fb) {
+ struct fb_info *fbinfo = registered_fb[0];
+ if (fbinfo->fbops && fbinfo->fbops->fb_blank) {
@@ -1524,6 +1526,148 @@
+#endif
+}
+
++#ifdef DEBUG_VOLTAGE
++
++
++static int set_volts(int *target, const char *buf, size_t count)
++{
++ unsigned long tmp;
++ int ret = strict_strtoul(buf, 10, &tmp);
++ if (ret)
++ return -EINVAL;
++ *target = tmp;
++ return count;
++}
++
++static int volts0 = 0;
++static ssize_t show_volts0(struct device *dev, struct device_attribute *attr, char *buf)
++{
++ return sprintf(buf, "0x%x\n", volts0);
++}
++static ssize_t set_volts0(struct device *dev,
++ struct device_attribute *attr, const char *buf, size_t count)
++{
++ return set_volts(&volts0, buf, count);
++}
++
++static int volts1 = 1;
++static ssize_t show_volts1(struct device *dev, struct device_attribute *attr, char *buf)
++{
++ return sprintf(buf, "0x%x\n", volts1);
++}
++static ssize_t set_volts1(struct device *dev,
++ struct device_attribute *attr, const char *buf, size_t count)
++{
++ return set_volts(&volts1, buf, count);
++}
++
++static int volts2 = 2;
++static ssize_t show_volts2(struct device *dev, struct device_attribute *attr, char *buf)
++{
++ return sprintf(buf, "0x%x\n", volts2);
++}
++static ssize_t set_volts2(struct device *dev,
++ struct device_attribute *attr, const char *buf, size_t count)
++{
++ return set_volts(&volts2, buf, count);
++}
++
++static int volts3 = 3;
++static ssize_t show_volts3(struct device *dev, struct device_attribute *attr, char *buf)
++{
++ return sprintf(buf, "0x%x\n", volts3);
++}
++static ssize_t set_volts3(struct device *dev,
++ struct device_attribute *attr, const char *buf, size_t count)
++{
++ return set_volts(&volts3, buf, count);
++}
++
++static int volts4 = 4;
++static ssize_t show_volts4(struct device *dev, struct device_attribute *attr, char *buf)
++{
++ return sprintf(buf, "0x%x\n", volts4);
++}
++static ssize_t set_volts4(struct device *dev,
++ struct device_attribute *attr, const char *buf, size_t count)
++{
++ return set_volts(&volts4, buf, count);
++}
++
++static int volts5 = 5;
++static ssize_t show_volts5(struct device *dev, struct device_attribute *attr, char *buf)
++{
++ return sprintf(buf, "0x%x\n", volts5);
++}
++static ssize_t set_volts5(struct device *dev,
++ struct device_attribute *attr, const char *buf, size_t count)
++{
++ return set_volts(&volts5, buf, count);
++}
++
++static int volts6 = 6;
++static ssize_t show_volts6(struct device *dev, struct device_attribute *attr, char *buf)
++{
++ return sprintf(buf, "0x%x\n", volts6);
++}
++static ssize_t set_volts6(struct device *dev,
++ struct device_attribute *attr, const char *buf, size_t count)
++{
++ return set_volts(&volts6, buf, count);
++}
++
++static int volts7 = 7;
++static ssize_t show_volts7(struct device *dev, struct device_attribute *attr, char *buf)
++{
++ return sprintf(buf, "0x%x\n", volts7);
++}
++static ssize_t set_volts7(struct device *dev,
++ struct device_attribute *attr, const char *buf, size_t count)
++{
++ return set_volts(&volts7, buf, count);
++}
++
++static ssize_t show_init(struct device *dev, struct device_attribute *attr, char *buf)
++{
++ return sprintf(buf, "init for %d %d %d %d %d %d %d %d available\n", volts0, volts1, volts2, volts3, volts4, volts5, volts6, volts7);
++}
++static ssize_t set_init(struct device *dev,
++ struct device_attribute *attr, const char *buf, size_t count)
++{
++ pr_info("%s: init for %d %d %d %d %d %d %d %d faked\n", __func__, volts0, volts1, volts2, volts3, volts4, volts5, volts6, volts7);
++ return count;
++}
++
++static DEVICE_ATTR(volts0, S_IRUGO | S_IWUSR, show_volts0, set_volts0);
++static DEVICE_ATTR(volts1, S_IRUGO | S_IWUSR, show_volts1, set_volts1);
++static DEVICE_ATTR(volts2, S_IRUGO | S_IWUSR, show_volts2, set_volts2);
++static DEVICE_ATTR(volts3, S_IRUGO | S_IWUSR, show_volts3, set_volts3);
++static DEVICE_ATTR(volts4, S_IRUGO | S_IWUSR, show_volts4, set_volts4);
++static DEVICE_ATTR(volts5, S_IRUGO | S_IWUSR, show_volts5, set_volts5);
++static DEVICE_ATTR(volts6, S_IRUGO | S_IWUSR, show_volts6, set_volts6);
++static DEVICE_ATTR(volts7, S_IRUGO | S_IWUSR, show_volts7, set_volts7);
++static DEVICE_ATTR(init, S_IRUGO | S_IWUSR, show_init, set_init);
++
++static struct device_attribute *voltage_regs[] = {
++ &dev_attr_volts0,
++ &dev_attr_volts1,
++ &dev_attr_volts2,
++ &dev_attr_volts3,
++ &dev_attr_volts4,
++ &dev_attr_volts5,
++ &dev_attr_volts6,
++ &dev_attr_volts7,
++ &dev_attr_init,
++};
++
++static void init_debug_voltage(struct kobject *kobj) {
++ int i;
++ for (i = 0; i < ARRAY_SIZE(voltage_regs); i++) {
++ sysfs_create_file(kobj, &voltage_regs[i]->attr);
++ }
++}
++#endif
++
+static void s6d04k1_Init2(void)
+{
+ BYTE cmd_buffer[20];
@@ -2025,6 +2169,10 @@
+
+ spi_set_drvdata(dev,s6d04k1);
+
++#ifdef DEBUG_VOLTAGE
++ init_debug_voltage(&dev->dev.kobj);
++#endif
++
+ implicit_spi_dev=dev;
+ s6d04k1_Init();
+ s6d04k1_SetBrightness(display_brightness);
@@ -2122,7 +2270,7 @@
Index: linux-2.6.39.4/drivers/video/display/display-s6d04k1.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.39.4/drivers/video/display/display-s6d04k1.h 2012-03-22 11:22:06.000000000 +0000
++++ linux-2.6.39.4/drivers/video/display/display-s6d04k1.h 2012-05-14 15:48:31.000000000 +0100
@@ -0,0 +1,185 @@
+// s6d04k1 LCD Display Driver interface.
+// Driver for CO240QGLH-T Active OLED display (240 x 320)