[Balloon-svn] r1882 - balloon/branches/menuconfig2/package/k…

トップ ページ
添付ファイル:
Eメールのメッセージ
+ (text/plain)
このメッセージを削除
このメッセージに返信
著者: subversion@balloonboard.org
日付:  
To: balloon-svn
題目: [Balloon-svn] r1882 - balloon/branches/menuconfig2/package/kernel/patches/2.6.39.4
Author: nick
Date: 2012-05-26 15:27:40 +0100 (Sat, 26 May 2012)
New Revision: 1882

Modified:
balloon/branches/menuconfig2/package/kernel/patches/2.6.39.4/keyboard-tt.patch
Log:
clean up code by removing old samosa interface references. Increase keymask delay for safety

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-05-25 15:34:22 UTC (rev 1881)
+++ balloon/branches/menuconfig2/package/kernel/patches/2.6.39.4/keyboard-tt.patch    2012-05-26 14:27:40 UTC (rev 1882)
@@ -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-15 14:38:12.000000000 +0100
-+++ linux-2.6.39.4/drivers/input/keyboard/Kconfig    2012-05-15 14:38:23.000000000 +0100
+--- linux-2.6.39.4.orig/drivers/input/keyboard/Kconfig    2012-05-25 16:30:55.000000000 +0100
++++ linux-2.6.39.4/drivers/input/keyboard/Kconfig    2012-05-25 16:31:01.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-15 14:38:12.000000000 +0100
-+++ linux-2.6.39.4/drivers/input/keyboard/Makefile    2012-05-15 14:38:23.000000000 +0100
+--- linux-2.6.39.4.orig/drivers/input/keyboard/Makefile    2012-05-25 16:30:55.000000000 +0100
++++ linux-2.6.39.4/drivers/input/keyboard/Makefile    2012-05-25 16:31:01.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-25 15:20:19.000000000 +0100
-@@ -0,0 +1,830 @@
++++ linux-2.6.39.4/drivers/input/keyboard/tt-keyboard.c    2012-05-26 11:34:02.000000000 +0100
+@@ -0,0 +1,442 @@
 +/*
 + * Balloon3 Bubble TT Keyboard Controller Driver
 + * Based on OpenCores keyboard controller
@@ -47,44 +47,18 @@
 +#include <linux/module.h>
 +#include <linux/slab.h>
 +#include <linux/irq.h>
-+#if defined(CONFIG_SPI_TT) || defined(CONFIG_SPI_TT_MODULE)
 +#include <linux/spi/spi.h>
 +#include <linux/spi/spi_tt.h>
-+#endif
 +#include <linux/samosa_device.h>
 +
 +#include <mach/balloon3.h>
 +
-+#if defined(CONFIG_SPI_TT) || defined(CONFIG_SPI_TT_MODULE)
-+#define USE_WORK
-+#else
-+//#define USE_WORK
-+#endif
-+#define DEBOUNCE_JIFFIES (HZ/200)
-+//#define DEBOUNCE_MS 50
-+//#define DEBOUNCE_COUNT 10
-+//#define DEBUG_ISR
-+//#define DEBUG_WORK
-+//#define DEBUG_EVENT
-+
 +#include <linux/workqueue.h>
 +#include <linux/delay.h>
 +
-+//#define PROC_TTKBD "ttkbd"
-+
-+#ifdef PROC_TTKBD
-+#include <linux/proc_fs.h>
-+#include <linux/ctype.h>
-+#include <linux/uaccess.h>
-+#endif
-+
 +struct tt_kbd {
-+#if defined(CONFIG_SPI_TT) || defined(CONFIG_SPI_TT_MODULE)
 +    struct spi_device *spi;
 +    struct spi_message spi_msg;
-+#else
-+    unsigned long jiffies;
-+#endif
 +    struct input_dev *input;
 +    struct input_dev *sys_start_input;
 +    int sys_start;
@@ -94,24 +68,10 @@
 +    int switch_up;
 +    int joystick_down;
 +    int joystick_up;
-+#ifdef DEBOUNCE_MS
-+    int joystick_state;
-+    int switch_state;
-+#endif
 +    int read_id;
 +    struct work_struct kbd_wq;
 +};
 +
-+#define SAMOSA_JOYSTICK_DOWN_LATCH 0x08
-+#define SAMOSA_JOYSTICK_UP_LATCH   0x09
-+#define SAMOSA_JOYSTICK_STATE 0x0A
-+
-+#define SAMOSA_SWITCH_DOWN_LATCH 0x0B
-+#define SAMOSA_SWITCH_UP_LATCH 0x0C
-+#define SAMOSA_SWITCH_STATE 0x0D
-+
-+#define SAMOSA_KEYBOARD_INT_STATUS 0x0F
-+
 +static u8 keyboard_id;
 +static unsigned int keyboard_keymask[8];
 +
@@ -163,6 +123,7 @@
 +
 +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)
@@ -178,8 +139,8 @@
 +    return samosa_read8( reg );
 +#endif
 +    }
++#endif
 +
-+#if defined(CONFIG_SPI_TT) || defined(CONFIG_SPI_TT_MODULE)
 +static int spiReadReg(struct spi_device *spi, unsigned char reg)
 +{
 +    u8 result = 0;
@@ -208,22 +169,15 @@
 +static int spiWriteRegData(struct spi_device *spi, unsigned char reg, unsigned char data)
 +{
 +    int res = 0;
-+    char dummy;
 +    unsigned char txbuffer[2]= { reg, data };
 +    struct spi_transfer    rg = {
 +        .tx_buf        = &txbuffer[0],
 +        .len        = 2,
 +    };
-+    struct spi_transfer    rd = {
-+        .rx_buf        = &dummy,
-+        .len        = 0,
-+    };
 +    struct spi_message    m;
 +
-+//    reg |= 0x80; // set read bit
 +    spi_message_init(&m);
 +    spi_message_add_tail(&rg, &m);
-+//    spi_message_add_tail(&rd, &m);
 +    res = spi_sync(spi, &m);
 +    if (res != 0)
 +        pr_info("%s: spi_sync returned %d\n", __func__, res);
@@ -231,77 +185,25 @@
 +    return res;
 +}
 +
-+
 +static void maskKey(struct spi_device *dev, int row, int col) {
 +    spiWriteRegData(dev, 0x11, ((row & 0xf) << 4) | (col & 0xf));
-+    msleep(1);
++    msleep(5);
 +}
 +
 +static void unmaskKey(struct spi_device *dev, int row, int col) {
 +    spiWriteRegData(dev, 0x12, ((row & 0xf) << 4) | (col & 0xf));
-+    msleep(1);
++    msleep(5);
 +}
 +
-+#endif
-+
 +static void ttkeypad_reset(void)
 +{
-+#if defined(CONFIG_SPI_TT) || defined(CONFIG_SPI_TT_MODULE)
 +    // reset keyboard
 +    samosa_write8(SAMOSA_ADDR_CONTROL_REG_2_SET,1 << KBD_RESET_BIT);
 +    msleep(1);
 +    samosa_write8(SAMOSA_ADDR_CONTROL_REG_2_CLR,1 << KBD_RESET_BIT);
 +    msleep(1);
-+#else
-+    Write_Data(SAMOSA_JOYSTICK_DOWN_LATCH, 0xff);
-+    Write_Data(SAMOSA_JOYSTICK_UP_LATCH, 0xff);
-+    Write_Data(SAMOSA_SWITCH_DOWN_LATCH, 0xff);
-+    Write_Data(SAMOSA_SWITCH_UP_LATCH, 0xff);
-+#endif
 +}
 +
-+#if 0
-+static int ttkeypad_setup()
-+{
-+    printk("ttkeypad_setup\n");
-+    return 0;
-+}
-+
-+static int ttkeypadReadJoystickLatches()
-+{
-+    int data, down, up;
-+    down = Read_Data(SAMOSA_JOYSTICK_DOWN_LATCH);
-+//    Write_Data(SAMOSA_JOYSTICK_DOWN_LATCH, down);
-+    up = Read_Data(SAMOSA_JOYSTICK_UP_LATCH);
-+//    Write_Data(SAMOSA_JOYSTICK_UP_LATCH, up);
-+    data = (up << 8) | down;
-+    return data;
-+}
-+
-+static int ttkeypadReadSwitchLatches()
-+{
-+    int data, down, up;
-+    down = Read_Data(SAMOSA_SWITCH_DOWN_LATCH);
-+//    Write_Data(SAMOSA_SWITCH_DOWN_LATCH, down);
-+    up = Read_Data(SAMOSA_SWITCH_UP_LATCH);
-+//    Write_Data(SAMOSA_SWITCH_UP_LATCH, up);
-+    data = (up << 8) | down;
-+    return data;
-+}
-+#endif
-+
-+static int readJoystickState(void)
-+{
-+    return Read_Data(SAMOSA_JOYSTICK_STATE);
-+}
-+
-+static int readSwitchState(void)
-+{
-+    return Read_Data(SAMOSA_SWITCH_STATE);
-+}
-+
-+#define SWITCH_OFFSET 8
-+#define JOYSTICK_OFFSET 0
 +static unsigned short keycodes[16] = {
 +        KEY_LEFT, KEY_DOWN, KEY_RIGHT, KEY_UP, KEY_KPENTER, KEY_G, KEY_H, KEY_I,
 +        KEY_LEFTMETA, KEY_ESC, KEY_ENTER, KEY_INSERT, KEY_COMPOSE, KEY_6, KEY_7, KEY_8
@@ -311,53 +213,6 @@
 +        KEY_POWER
 +};
 +
-+static void do_switch(struct input_dev *input, int latch, int down) {
-+    if (latch) {
-+        int i;
-+#ifdef DEBUG_EVENT
-+pr_info("%s: latch 0x%x down = %d \n",__func__, latch, down);
-+#endif
-+        for (i = 0; i < 8; i++) {
-+            if (latch & ( 1 << i ) ) {
-+                input_report_key(input, keycodes[i+SWITCH_OFFSET],down);
-+#ifdef DEBUG_EVENT
-+pr_info("%s: key 0x%x %s (index %d)\n",__func__, keycodes[i+SWITCH_OFFSET], down ? "down":"up", i+SWITCH_OFFSET);
-+#endif
-+            }
-+        }
-+    }
-+}
-+
-+static void do_joystick(struct input_dev *input, int latch, int down) {
-+    if (latch) {
-+        int i;
-+#ifdef DEBUG_EVENT
-+pr_info("%s: latch 0x%x down = %d \n",__func__, latch, down);
-+#endif
-+        for (i = 0; i < 8; i++) {
-+            if (latch & ( 1 << i ) ) {
-+                input_report_key(input, keycodes[i+JOYSTICK_OFFSET],down);
-+#ifdef DEBUG_EVENT
-+pr_info("%s: key 0x%x %s (index %d)\n",__func__, keycodes[i+JOYSTICK_OFFSET], down ? "down":"up", i+JOYSTICK_OFFSET);
-+#endif
-+            }
-+        }
-+    }
-+}
-+
-+// snapshot and clear latches
-+static void sync_latches(struct tt_kbd *tt_kbd) {
-+    tt_kbd->switch_down = Read_Data(SAMOSA_SWITCH_DOWN_LATCH);
-+    Write_Data(SAMOSA_SWITCH_DOWN_LATCH, tt_kbd->switch_down);
-+    tt_kbd->switch_up = Read_Data(SAMOSA_SWITCH_UP_LATCH);
-+    Write_Data(SAMOSA_SWITCH_UP_LATCH, tt_kbd->switch_up);
-+    tt_kbd->joystick_down = Read_Data(SAMOSA_JOYSTICK_DOWN_LATCH);
-+    Write_Data(SAMOSA_JOYSTICK_DOWN_LATCH, tt_kbd->joystick_down);
-+    tt_kbd->joystick_up = Read_Data(SAMOSA_JOYSTICK_UP_LATCH);
-+    Write_Data(SAMOSA_JOYSTICK_UP_LATCH, tt_kbd->joystick_up);
-+}
-+
-+#if defined(CONFIG_SPI_TT) || defined(CONFIG_SPI_TT_MODULE)
 +static unsigned short spi_keycodes[8][8] = {
 +{0, 0, 0, 0,  0, 0, 0, 0},
 +{0, 0, 0, 0,  0, 0, 0, 0},
@@ -386,16 +241,12 @@
 +    }
 +}
 +
-+#endif
-+
 +static void kbd_work(struct work_struct *work) {
 +    struct tt_kbd *tt_kbd = container_of(work, struct tt_kbd, kbd_wq);
 +    struct input_dev *input = tt_kbd->input;
-+#if defined(CONFIG_SPI_TT) || defined(CONFIG_SPI_TT_MODULE)
 +    u8 updown;
 +    u8 rc;
 +    unsigned short key;
-+#endif
 +    if (tt_kbd->sys_start) {
 +        struct input_dev *input = tt_kbd->sys_start_input;
 +        input_report_key(input, KEY_POWER, 1);
@@ -407,19 +258,12 @@
 +        tt_kbd->sys_start = 0;
 +        return;
 +    }
-+#if defined(CONFIG_SPI_TT) || defined(CONFIG_SPI_TT_MODULE)
 +    updown = spiReadReg(tt_kbd->spi,0);
 +    rc = spiReadReg(tt_kbd->spi,1);
 +    key = spi_keycodes[(rc >> 4) & 0x7][rc & 0x7];
-+#ifdef DEBUG_WORK
-+pr_info("%s: updown = 0x%x, rc = 0x%x\n",__func__, updown, rc);
-+#endif
 +    // check that 'updown' has non-zero in bottom four bits
 +    // indicating that this is a real keypress
-+    if(updown&0x0f) {
-+#ifdef DEBUG_WORK
-+        pr_info("%s: key 0x%x %s\n", __func__, key, (updown & 0x80) ? "up":"down");
-+#endif
++    if(updown & 0x0f) {
 +        if (key)
 +            input_report_key(input, key ,(updown & 0x80) ? 0:1);
 +    }
@@ -430,92 +274,6 @@
 +        tt_kbd->read_id = 0;
 +    }
 +
-+#else
-+    disable_irq(tt_kbd->irq);
-+    do {
-+#ifdef DEBOUNCE_MS
-+// FIXME this code is not properly functional
-+        int timeout = DEBOUNCE_COUNT;
-+        int switch_state, joystick_state;
-+        int matched;
-+        // read in the initial states
-+        switch_state = readSwitchState();
-+        joystick_state = readJoystickState();
-+#ifdef DEBUG_WORK
-+pr_info("%s: switch state 0x%x, joystick state 0x%x\n",__func__, switch_state, joystick_state);
-+#endif
-+        // read state till stable
-+        if ((switch_state != tt_kbd->switch_state) || (joystick_state != tt_kbd->joystick_state)) {
-+#ifdef DEBUG_WORK
-+pr_info("%s: polling kbd data\n",__func__);
-+#endif
-+        matched = 0;
-+        do {
-+            int current_switch_state;
-+            int current_joystick_state;
-+            msleep(DEBOUNCE_MS);
-+            current_switch_state = readSwitchState();
-+            current_joystick_state = readJoystickState();
-+            if ((current_switch_state == switch_state) && (current_joystick_state == joystick_state)) {
-+#ifdef DEBUG_WORK
-+pr_info("%s: matched state - timeout set to %d\n",__func__, timeout);
-+#endif
-+                matched = 1;
-+                break;
-+            }
-+        } while (timeout--);
-+
-+#ifdef DEBUG_WORK
-+pr_info("%s: calcualating state (timeout = %d)\n",__func__, timeout);
-+#endif
-+    tt_kbd->switch_down = tt_kbd->switch_up = tt_kbd->joystick_down = tt_kbd->joystick_up = 0;
-+    if (matched && (tt_kbd->switch_state != switch_state)) {
-+            tt_kbd->switch_down = switch_state & ~tt_kbd->switch_state;
-+            tt_kbd->switch_up = (~switch_state) & tt_kbd->switch_state;
-+            tt_kbd->switch_state = switch_state;
-+#ifdef DEBUG_WORK
-+pr_info("%s: switch state is %d\n",__func__, tt_kbd->switch_state);
-+#endif
-+    }
-+
-+    if (matched && (tt_kbd->joystick_state != joystick_state)) {
-+            tt_kbd->joystick_down = joystick_state & ~tt_kbd->joystick_state;
-+            tt_kbd->joystick_up = (~joystick_state) & tt_kbd->joystick_state;
-+            tt_kbd->joystick_state = joystick_state;
-+#ifdef DEBUG_WORK
-+pr_info("%s: joystick state is %d\n",__func__, tt_kbd->joystick_state);
-+#endif
-+    }
-+
-+#ifdef DEBUG_WORK
-+if (!matched)
-+    pr_info("%s: data unchanged\n",__func__);
-+#endif
-+
-+#endif // DEBOUNCE_MS
-+
-+        if (tt_kbd->switch_down || tt_kbd->switch_up || tt_kbd->joystick_down || tt_kbd->joystick_up) {
-+#ifdef DEBUG_WORK
-+pr_info("%s: switch down 0x%x up 0x%x, joystick down 0x%x up 0x%x \n",__func__, tt_kbd->switch_down, tt_kbd->switch_up, tt_kbd->joystick_down, tt_kbd->joystick_up);
-+#endif
-+            do_switch(input, tt_kbd->switch_down, 1);
-+            do_switch(input, tt_kbd->switch_up, 0);
-+            do_joystick(input, tt_kbd->joystick_down, 1);
-+            do_joystick(input, tt_kbd->joystick_up, 0);
-+            input_sync(input);
-+        }
-+#ifdef DEBUG_WORK
-+        else
-+pr_info("%s: no change detected\n",__func__);
-+#endif
-+        sync_latches(tt_kbd);
-+
-+    } while (tt_kbd->switch_down || tt_kbd->switch_up || tt_kbd->joystick_down || tt_kbd->joystick_up);
-+    enable_irq(tt_kbd->irq);
-+#ifdef DEBUG_WORK
-+pr_info("%s: done\n",__func__);
-+#endif
-+#endif
 +}
 +
 +static irqreturn_t tt_sys_start_isr(int irq, void *dev_id)
@@ -529,48 +287,11 @@
 +static irqreturn_t tt_kbd_isr(int irq, void *dev_id)
 +{
 +    struct tt_kbd *tt_kbd = dev_id;
-+#ifdef DEBUG_ISR
-+pr_info("%s: enter\n",__FUNCTION__);
-+#endif
-+    // latch and clear interrupts
-+#if !defined(CONFIG_SPI_TT) && !defined(CONFIG_SPI_TT_MODULE)
-+    if (jiffies > tt_kbd->jiffies + DEBOUNCE_JIFFIES) {
-+#endif
-+#ifdef USE_WORK
-+#ifdef DEBUG_ISR
-+pr_info("%s: scheduling kbd work\n",__func__);
-+#endif
 +    schedule_work(&tt_kbd->kbd_wq);
-+#else
-+    struct input_dev *input = tt_kbd->input;
-+
-+#ifdef DEBUG_ISR
-+pr_info("%s: reading state and clearing latches\n",__func__);
-+#endif
-+    if ((tt_kbd->switch_down) || (tt_kbd->switch_up) || (tt_kbd->joystick_down) || (tt_kbd->joystick_up)) {
-+        do_switch(input, tt_kbd->switch_down, 1);
-+        do_switch(input, tt_kbd->switch_up, 0);
-+        do_joystick(input, tt_kbd->joystick_down, 1);
-+        do_joystick(input, tt_kbd->joystick_up, 0);
-+        input_sync(input);
-+    }
-+#endif
-+#if !defined(CONFIG_SPI_TT) && !defined(CONFIG_SPI_TT_MODULE)
-+    }
-+    tt_kbd->jiffies = jiffies;
-+#endif
-+
-+#ifdef DEBUG_ISR
-+pr_info("%s: irq handled\n",__func__);
-+#endif
 +    return IRQ_HANDLED;
 +}
 +
-+#if defined(CONFIG_SPI_TT) || defined(CONFIG_SPI_TT_MODULE)
 +static int __devinit tt_kbd_probe(struct spi_device *dev)
-+#else
-+static int __devinit tt_kbd_probe(struct samosa_device *dev)
-+#endif
 +{
 +    struct input_dev *input, *ss_input;
 +    struct tt_kbd *tt_kbd;
@@ -583,7 +304,6 @@
 +        error = -ENOMEM;
 +        goto err_free_mem;
 +    }
-+#if defined(CONFIG_SPI_TT) || defined(CONFIG_SPI_TT_MODULE)
 +    ttkeypad_reset();
 +    dev->bits_per_word = 8;
 +
@@ -593,11 +313,6 @@
 +    tt_kbd->spi = dev;
 +    tt_kbd->irq = dev->irq;
 +    tt_kbd->sys_start_irq = TT_SYS_START_IRQ;
-+#else
-+    tt_kbd->irq = BALLOON3_FPGA_IRQ;
-+    tt_kbd->jiffies = 0;
-+#endif
-+pr_info("%s: irq is %d\n",__func__, tt_kbd->irq);
 +
 +    tt_kbd->input = input;
 +
@@ -617,9 +332,8 @@
 +    input->keycodemax = ARRAY_SIZE(keycodes);
 +
 +    __set_bit(EV_KEY, input->evbit);
-+    for (i = 0; i < ARRAY_SIZE(keycodes); i++) {
++    for (i = 0; i < ARRAY_SIZE(keycodes); i++)
 +        __set_bit(keycodes[i], input->keybit);
-+    }
 +    __clear_bit(KEY_RESERVED, input->keybit);
 +
 +    // sys_start input
@@ -642,9 +356,8 @@
 +    ss_input->keycodemax = ARRAY_SIZE(ss_keycodes);
 +
 +    __set_bit(EV_KEY, ss_input->evbit);
-+    for (i = 0; i < ARRAY_SIZE(ss_keycodes); i++) {
++    for (i = 0; i < ARRAY_SIZE(ss_keycodes); i++)
 +        __set_bit(ss_keycodes[i], ss_input->keybit);
-+    }
 +    __clear_bit(KEY_RESERVED, ss_input->keybit);
 +
 +    tt_kbd->sys_start = 0;
@@ -665,23 +378,16 @@
 +        dev_err(&dev->dev, "unable to claim irq %d\n", tt_kbd->sys_start_irq);
 +        goto err_free_irq;
 +    }
-+//    irq_set_irq_type(tt_kbd->sys_start_irq, IRQ_TYPE_EDGE_BOTH);
 +
 +    error = input_register_device(ss_input);
 +
-+#if defined(CONFIG_SPI_TT) || defined(CONFIG_SPI_TT_MODULE)
 +    spi_set_drvdata(dev, tt_kbd);
-+#else
-+    samosa_set_drvdata(dev, tt_kbd);
-+#endif
 +    if (error) {
 +        dev_err(&dev->dev, "unable to register input device\n");
 +        goto err_free_irq;
 +    }
 +
-+#if defined(CONFIG_SPI_TT) || defined(CONFIG_SPI_TT_MODULE)
 +    pr_info("%s: read keyboard INT_FLAGS returns %d\n",__func__, spiReadReg(tt_kbd->spi,0));
-+#endif
 +
 +    keyboard_id = spiReadReg(tt_kbd->spi,0xf);
 +    pr_info("%s: read keyboard id returns 0x%x\n",__func__, keyboard_id);
@@ -705,22 +411,14 @@
 + err_free_mem:
 +    input_free_device(input);
 +    kfree(tt_kbd);
-+pr_info("%s: failed\n",__FUNCTION__);
++    pr_info("%s: failed\n", __func__);
 +
 +    return error;
 +}
 +
-+#if defined(CONFIG_SPI_TT) || defined(CONFIG_SPI_TT_MODULE)
 +static int __devexit tt_kbd_remove(struct spi_device *pdev)
-+#else
-+static int __devexit tt_kbd_remove(struct samosa_device *pdev)
-+#endif
 +{
-+#if defined(CONFIG_SPI_TT) || defined(CONFIG_SPI_TT_MODULE)
 +    struct tt_kbd *tt_kbd = spi_get_drvdata(pdev);
-+#else
-+    struct tt_kbd *tt_kbd = samosa_get_drvdata(pdev);
-+#endif
 +
 +    free_irq(tt_kbd->irq, tt_kbd);
 +
@@ -732,56 +430,6 @@
 +    return 0;
 +}
 +
-+#ifdef PROC_TTKBD
-+
-+static ssize_t proc_read_ttkbd(struct file *file, char *buf,
-+        size_t nbytes, loff_t *ppos) {
-+    int count = 0;
-+//    pr_info("%s: read keyboard INT_FLAGS returns %d\n",__func__, spiReadReg(dev,0);
-+//    pr_info("%s: read keyboard LAST_EVENT returns %d\n",__func__, spiReadReg(dev,1);
-+    return count;
-+}
-+
-+static ssize_t proc_write_ttkbd(struct file *file, const char *buffer,
-+        size_t count, loff_t *ppos) {
-+    char buf[40];
-+#if 0
-+    unsigned long val;
-+    char *p = buf;
-+    char *pp;
-+#endif
-+
-+    if (count >= (sizeof(buf) -1 ))
-+        return -EFAULT;
-+
-+    if (copy_from_user(buf, buffer, count))
-+        return -EFAULT;
-+
-+#if 0
-+    buf[count] = 0;
-+    while (isspace(*p))
-+        p++;
-+    val = simple_strtoul(p,&pp,0);
-+    if (pp && (pp > p)) {
-+        pr_info("reporting key down/up for key <%ld>\n",val);
-+        input_report_key(tt_input, val, 1);
-+        input_report_key(tt_input, val, 0);
-+        input_sync(tt_input);
-+    }
-+    else
-+        pr_info("cannot get kbd value from <%s>\n",buf);
-+#endif
-+    return count;
-+}
-+
-+static struct file_operations proc_ttkbd_operations = {
-+    read:    proc_read_ttkbd,
-+    write:    proc_write_ttkbd
-+};
-+
-+static struct proc_dir_entry *proc_ttkbd;
-+#endif
-+
 +#ifdef CONFIG_PM_SLEEP
 +static int tt_kbd_suspend(struct device *dev)
 +{
@@ -791,7 +439,7 @@
 +
 +static int tt_kbd_resume(struct device *dev)
 +{
-+    ttkeypad_reset();
++//    ttkeypad_reset();
 +    resumeKeys(to_spi_device(dev));
 +    return 0;
 +}
@@ -799,7 +447,6 @@
 +
 +static SIMPLE_DEV_PM_OPS(tt_kbd_pm_ops, tt_kbd_suspend, tt_kbd_resume);
 +
-+#if defined(CONFIG_SPI_TT) || defined(CONFIG_SPI_TT_MODULE)
 +static struct spi_driver tt_kbd_device_driver = {
 +    .probe    = tt_kbd_probe,
 +    .remove   = __devexit_p(tt_kbd_remove),
@@ -809,51 +456,16 @@
 +        .pm    = &tt_kbd_pm_ops,
 +    },
 +};
-+#else
-+static struct samosa_driver tt_kbd_device_driver = {
-+    .probe    = tt_kbd_probe,
-+    .remove   = __devexit_p(tt_kbd_remove),
-+    .driver   = {
-+        .name = "tt-kbd",
-+        .owner  = THIS_MODULE,
-+        .pm    = &tt_kbd_pm_ops,
-+    },
-+};
 +
-+static struct samosa_device *tt_kbd_device;
-+#endif
-+
 +static int __init tt_kbd_init(void)
 +{
-+pr_info("%s: \n",__FUNCTION__);
-+#if !defined(CONFIG_SPI_TT) && !defined(CONFIG_SPI_TT_MODULE)
-+    tt_kbd_device = samosa_device_alloc("tt-kbd",-1);
-+    samosa_device_add(tt_kbd_device);
-+#endif
-+#ifdef PROC_TTKBD
-+    proc_ttkbd = create_proc_entry(PROC_TTKBD, S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH, NULL);
-+    if (proc_ttkbd)
-+        proc_ttkbd->proc_fops = &proc_ttkbd_operations;
-+#endif
-+#if defined(CONFIG_SPI_TT) || defined(CONFIG_SPI_TT_MODULE)
 +    return spi_register_driver(&tt_kbd_device_driver);
-+#else
-+    return samosa_driver_register(&tt_kbd_device_driver);
-+#endif
 +}
 +module_init(tt_kbd_init);
 +
 +static void __exit tt_kbd_exit(void)
 +{
-+#ifdef PROC_TTKBD
-+    remove_proc_entry(PROC_TTKBD, NULL);
-+#endif
-+#if defined(CONFIG_SPI_TT) || defined(CONFIG_SPI_TT_MODULE)
 +    spi_unregister_driver(&tt_kbd_device_driver);
-+#else
-+    samosa_driver_unregister(&tt_kbd_device_driver);
-+    samosa_device_unregister(tt_kbd_device);
-+#endif
 +}
 +module_exit(tt_kbd_exit);
 +