summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbraham Arce <x0066660@ti.com>2010-02-22 10:16:38 -0600
committerRicardo Perez Olivares <x0081762@ti.com>2010-02-24 15:34:25 -0600
commitddf8b95d6cb4b3de855f46dcecc145b0a52323a3 (patch)
tree8446dde469f978e915ce4930f1aea22b70607529
parent59907e088f4deec7ef2d651d884a4608e8db110e (diff)
OMAP4: Keypad: Module insertion/removal fixesti-2.6.33-rc2-omap4-L24.4-p1
In omap_kp_remove function * Add code to free irq * Remove already registered sysfs filename Signed-off-by: Abraham Arce <x0066660@ti.com>
-rwxr-xr-xdrivers/input/keyboard/omap-keypad.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/input/keyboard/omap-keypad.c b/drivers/input/keyboard/omap-keypad.c
index 75fa48854faa..752c647c9be7 100755
--- a/drivers/input/keyboard/omap-keypad.c
+++ b/drivers/input/keyboard/omap-keypad.c
@@ -525,7 +525,17 @@ static int __devexit omap_kp_remove(struct platform_device *pdev)
/* disable keypad interrupt handling */
tasklet_disable(&kp_tasklet);
- if (cpu_is_omap24xx()) {
+
+ if (!cpu_is_omap24xx()) {
+ omap_kp->irq = platform_get_irq(pdev, 0);
+ if (!cpu_is_omap44xx()) {
+ omap_writew(1, OMAP1_MPUIO_BASE +
+ OMAP_MPUIO_KBD_MASKIT);
+ free_irq(omap_kp->irq, 0);
+ } else {
+ free_irq(152, omap_kp);
+ }
+ } else {
int i;
for (i = 0; i < omap_kp->cols; i++)
gpio_free(col_gpios[i]);
@@ -533,9 +543,6 @@ static int __devexit omap_kp_remove(struct platform_device *pdev)
gpio_free(row_gpios[i]);
free_irq(gpio_to_irq(row_gpios[i]), 0);
}
- } else {
- omap_writew(1, OMAP1_MPUIO_BASE + OMAP_MPUIO_KBD_MASKIT);
- free_irq(omap_kp->irq, 0);
}
del_timer_sync(&omap_kp->timer);
@@ -544,6 +551,8 @@ static int __devexit omap_kp_remove(struct platform_device *pdev)
/* unregister everything */
input_unregister_device(omap_kp->input);
+ device_remove_file(&pdev->dev, &dev_attr_enable);
+
kfree(omap_kp);
return 0;