diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c
--- a/drivers/input/keyboard/matrix_keypad.c
+++ b/drivers/input/keyboard/matrix_keypad.c
@@ -14,7 +14,6 @@
 #include <linux/input.h>
 #include <linux/irq.h>
 #include <linux/interrupt.h>
-#include <linux/jiffies.h>
 #include <linux/module.h>
 #include <linux/gpio.h>
 #include <linux/input/matrix_keypad.h>
@@ -25,13 +24,15 @@
 
 struct matrix_keypad {
 	const struct matrix_keypad_platform_data *pdata;
+	struct device *dev;
 	struct input_dev *input_dev;
 	unsigned int row_shift;
+	unsigned int last_key;
+	int last_key_pressed;
 
 	DECLARE_BITMAP(disabled_gpios, MATRIX_MAX_ROWS);
 
 	uint32_t last_key_state[MATRIX_MAX_COLS];
-	struct delayed_work work;
 	spinlock_t lock;
 	bool scan_pending;
 	bool stopped;
@@ -52,7 +53,7 @@
 	if (on) {
 		gpio_direction_output(pdata->col_gpios[col], level_on);
 	} else {
-		gpio_set_value_cansleep(pdata->col_gpios[col], !level_on);
+		gpio_set_value(pdata->col_gpios[col], !level_on);
 		if (!pdata->drive_inactive_cols)
 			gpio_direction_input(pdata->col_gpios[col]);
 	}
@@ -112,20 +113,26 @@
 /*
  * This gets the keys from keyboard and reports it to input subsystem
  */
-static void matrix_keypad_scan(struct work_struct *work)
+static void matrix_keypad_scan(struct matrix_keypad *keypad)
 {
-	struct matrix_keypad *keypad =
-		container_of(work, struct matrix_keypad, work.work);
 	struct input_dev *input_dev = keypad->input_dev;
 	const unsigned short *keycodes = input_dev->keycode;
 	const struct matrix_keypad_platform_data *pdata = keypad->pdata;
 	uint32_t new_state[MATRIX_MAX_COLS];
 	int row, col, code;
 
+	dev_dbg(keypad->dev, "Starting keypad scan\n");
+
+	udelay(pdata->col_scan_delay_us * 100);
+
+	memset(new_state, 0, sizeof(new_state));
+
+	dev_dbg(keypad->dev, "Memset done\n");
+
 	/* de-activate all columns for scanning */
 	activate_all_cols(pdata, false);
 
-	memset(new_state, 0, sizeof(new_state));
+	dev_dbg(keypad->dev, "Activate all cols false\n");
 
 	/* assert each column and read the row status out */
 	for (col = 0; col < pdata->num_col_gpios; col++) {
@@ -151,23 +158,41 @@
 				continue;
 
 			code = MATRIX_SCAN_CODE(row, col, keypad->row_shift);
+
+			/* if the last key is not this then we cancel the old key press */
+			if (keypad->last_key != keycodes[code] && keypad->last_key_pressed == 0) {
+				dev_info(keypad->dev, "Last keycode: %d", keypad->last_key);
+				dev_info(keypad->dev, "Last state: %d", keypad->last_key_pressed);
+
+				input_report_key(input_dev, keypad->last_key, 0);
+				input_sync(input_dev);
+			}
+
 			input_event(input_dev, EV_MSC, MSC_SCAN, code);
 			input_report_key(input_dev,
 					 keycodes[code],
 					 new_state[col] & (1 << row));
+
+			/* store last key and state*/ 
+			keypad->last_key = keycodes[code];
+			keypad->last_key_pressed = new_state[col] & (1 << row);
 		}
 	}
 	input_sync(input_dev);
 
+	dev_dbg(keypad->dev, "Synced input\n");
+
 	memcpy(keypad->last_key_state, new_state, sizeof(new_state));
 
+	dev_dbg(keypad->dev, "Memcpy done\n");
+
 	activate_all_cols(pdata, true);
 
-	/* Enable IRQs again */
-	spin_lock_irq(&keypad->lock);
+	dev_dbg(keypad->dev, "Activate all cols true\n");
+
 	keypad->scan_pending = false;
-	enable_row_irqs(keypad);
-	spin_unlock_irq(&keypad->lock);
+
+	dev_dbg(keypad->dev, "Keypad scan done\n");
 }
 
 static irqreturn_t matrix_keypad_interrupt(int irq, void *id)
@@ -175,6 +200,8 @@
 	struct matrix_keypad *keypad = id;
 	unsigned long flags;
 
+	dev_dbg(keypad->dev, "Interrupt\n");
+
 	spin_lock_irqsave(&keypad->lock, flags);
 
 	/*
@@ -185,13 +212,19 @@
 	if (unlikely(keypad->scan_pending || keypad->stopped))
 		goto out;
 
+	dev_dbg(keypad->dev, "No active scan exists\n");
+
 	disable_row_irqs(keypad);
 	keypad->scan_pending = true;
-	schedule_delayed_work(&keypad->work,
-		msecs_to_jiffies(keypad->pdata->debounce_ms));
+
+	matrix_keypad_scan(keypad);
 
 out:
 	spin_unlock_irqrestore(&keypad->lock, flags);
+
+	enable_row_irqs(keypad);
+
+	dev_dbg(keypad->dev, "Interrupt handled\n");
 	return IRQ_HANDLED;
 }
 
@@ -206,7 +239,7 @@
 	 * Schedule an immediate key scan to capture current key state;
 	 * columns will be activated and IRQs be enabled after the scan.
 	 */
-	schedule_delayed_work(&keypad->work, 0);
+	matrix_keypad_scan(keypad);
 
 	return 0;
 }
@@ -219,7 +252,6 @@
 	keypad->stopped = true;
 	spin_unlock_irq(&keypad->lock);
 
-	flush_delayed_work(&keypad->work);
 	/*
 	 * matrix_keypad_scan() will leave IRQs enabled;
 	 * we should disable them now.
@@ -294,6 +326,8 @@
 
 	matrix_keypad_start(keypad->input_dev);
 
+	enable_row_irqs(keypad);
+
 	return 0;
 }
 #endif
@@ -502,11 +536,11 @@
 		goto err_free_mem;
 	}
 
+	keypad->dev = &pdev->dev;
 	keypad->input_dev = input_dev;
 	keypad->pdata = pdata;
 	keypad->row_shift = get_count_order(pdata->num_col_gpios);
 	keypad->stopped = true;
-	INIT_DELAYED_WORK(&keypad->work, matrix_keypad_scan);
 	spin_lock_init(&keypad->lock);
 
 	input_dev->name		= pdev->name;
@@ -540,6 +574,10 @@
 	device_init_wakeup(&pdev->dev, pdata->wakeup);
 	platform_set_drvdata(pdev, keypad);
 
+	enable_row_irqs(keypad);
+
+	dev_dbg(&pdev->dev, "Probe done\n");
+
 	return 0;
 
 err_free_gpio:
