Author: nick
Date: 2012-06-01 13:21:09 +0100 (Fri, 01 Jun 2012)
New Revision: 1888
Modified:
balloon/branches/menuconfig2/package/kernel/patches/2.6.39.4/keyboard-tt.patch
Log:
bigger sledgehammer to unmask keys
Modified: balloon/branches/menuconfig2/package/kernel/patches/2.6.39.4/keyboard-tt.patch
===================================================================
--- balloon/branches/menuconfig2/package/kernel/patches/2.6.39.4/keyboard-tt.patch 2012-06-01 12:20:29 UTC (rev 1887)
+++ balloon/branches/menuconfig2/package/kernel/patches/2.6.39.4/keyboard-tt.patch 2012-06-01 12:21:09 UTC (rev 1888)
@@ -1,7 +1,7 @@
Index: linux-2.6.39.4/drivers/input/keyboard/Kconfig
===================================================================
---- linux-2.6.39.4.orig/drivers/input/keyboard/Kconfig 2012-05-31 12:51:30.000000000 +0100
-+++ linux-2.6.39.4/drivers/input/keyboard/Kconfig 2012-05-31 12:51:51.000000000 +0100
+--- linux-2.6.39.4.orig/drivers/input/keyboard/Kconfig 2012-06-01 10:11:48.000000000 +0100
++++ linux-2.6.39.4/drivers/input/keyboard/Kconfig 2012-06-01 10:14:51.000000000 +0100
@@ -530,4 +530,13 @@
To compile this driver as a module, choose M here: the
module will be called w90p910_keypad.
@@ -18,8 +18,8 @@
endif
Index: linux-2.6.39.4/drivers/input/keyboard/Makefile
===================================================================
---- linux-2.6.39.4.orig/drivers/input/keyboard/Makefile 2012-05-31 12:51:30.000000000 +0100
-+++ linux-2.6.39.4/drivers/input/keyboard/Makefile 2012-05-31 12:51:51.000000000 +0100
+--- linux-2.6.39.4.orig/drivers/input/keyboard/Makefile 2012-06-01 10:11:48.000000000 +0100
++++ linux-2.6.39.4/drivers/input/keyboard/Makefile 2012-06-01 10:14:51.000000000 +0100
@@ -48,3 +48,4 @@
obj-$(CONFIG_KEYBOARD_TWL4030) += twl4030_keypad.o
obj-$(CONFIG_KEYBOARD_XTKBD) += xtkbd.o
@@ -28,8 +28,8 @@
Index: linux-2.6.39.4/drivers/input/keyboard/tt-keyboard.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.39.4/drivers/input/keyboard/tt-keyboard.c 2012-05-31 13:07:05.000000000 +0100
-@@ -0,0 +1,444 @@
++++ linux-2.6.39.4/drivers/input/keyboard/tt-keyboard.c 2012-06-01 13:10:53.000000000 +0100
+@@ -0,0 +1,431 @@
+/*
+ * Balloon3 Bubble TT Keyboard Controller Driver
+ * Based on OpenCores keyboard controller
@@ -123,24 +123,6 @@
+
+static DEVICE_ATTR(kbd_id, S_IRUGO, show_id, NULL);
+
-+#if 0
-+static inline void Write_Data(unsigned char reg, unsigned char parameter)
-+ {
-+#if defined(CONFIG_SPI_TT) || defined(CONFIG_SPI_TT_MODULE)
-+#else
-+ samosa_write8( reg, parameter);
-+#endif
-+ }
-+static inline int Read_Data(unsigned char reg)
-+ {
-+#if defined(CONFIG_SPI_TT) || defined(CONFIG_SPI_TT_MODULE)
-+ return 0;
-+#else
-+ return samosa_read8( reg );
-+#endif
-+ }
-+#endif
-+
+static int spiReadReg(struct spi_device *spi, unsigned char reg)
+{
+ u8 result = 0;
@@ -187,12 +169,10 @@
+
+static void maskKey(struct spi_device *dev, int row, int col) {
+ spiWriteRegData(dev, 0x11, ((row & 0xf) << 4) | (col & 0xf));
-+// msleep(5);
+}
+
+static void unmaskKey(struct spi_device *dev, int row, int col) {
+ spiWriteRegData(dev, 0x12, ((row & 0xf) << 4) | (col & 0xf));
-+// msleep(5);
+}
+
+static void ttkeypad_reset(void)
@@ -224,7 +204,7 @@
+{KEY_UP, KEY_RIGHT, KEY_DOWN, KEY_LEFT, 0, 0, 0, KEY_KPENTER}, // joystick
+};
+
-+static void suspendKeys(struct device *dev) {
++static void suspendKeys(struct spi_device *dev) {
+ int row, col;
+ for (row = 6; row < 8; row++) {
+ for (col = 0; col < 8; col++)
@@ -233,7 +213,7 @@
+ }
+}
+
-+static void resumeKeys(struct device *dev) {
++static void resumeKeys(struct spi_device *dev) {
+ int row, col;
+ for (row = 6; row < 8; row++) {
+ for (col = 0; col < 8; col++)
@@ -442,7 +422,14 @@
+ // this resets all keys to being unmasked as a side effect
+ // pending reliably fixing the unmask spi write
+ ttkeypad_reset();
-+// resumeKeys(to_spi_device(dev));
++ // reset seems insufficient - odd.
++ // stry a different sledgehammer
++ msleep(1);
++ resumeKeys(to_spi_device(dev));
++ msleep(1);
++ resumeKeys(to_spi_device(dev));
++ msleep(1);
++ resumeKeys(to_spi_device(dev));
+ return 0;
+}
+#endif