aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard/spitzkbd.c
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@rpsys.net>2006-03-14 00:12:32 -0500
committerDmitry Torokhov <dtor_core@ameritech.net>2006-03-14 00:12:32 -0500
commit4872f7888855fa52182f3d69de1ff3746fd43c07 (patch)
treee2b16a34cfae7b75e39a855b4e3b43aac3aa29d6 /drivers/input/keyboard/spitzkbd.c
parent2bfc3c6e9516ece6856ec7904319650a5d4d9871 (diff)
Input: zaurus keyboard driver updates
* Change the scan interval from 100ms to 50ms. This stops the key repeat from triggering on double letter presses. * Remove unneeded stale hinge code from corgikbd * Change unneeded corgi GPIO pins to inputs when suspended * Add support for the headphone jack switch for both corgi and spitz (as switch SW_2) Signed-off-by: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/keyboard/spitzkbd.c')
-rw-r--r--drivers/input/keyboard/spitzkbd.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/input/keyboard/spitzkbd.c b/drivers/input/keyboard/spitzkbd.c
index 83999d583122..bc61cf8cfc65 100644
--- a/drivers/input/keyboard/spitzkbd.c
+++ b/drivers/input/keyboard/spitzkbd.c
@@ -30,6 +30,7 @@
30#define SCANCODE(r,c) (((r)<<4) + (c) + 1) 30#define SCANCODE(r,c) (((r)<<4) + (c) + 1)
31#define NR_SCANCODES ((KB_ROWS<<4) + 1) 31#define NR_SCANCODES ((KB_ROWS<<4) + 1)
32 32
33#define SCAN_INTERVAL (50) /* ms */
33#define HINGE_SCAN_INTERVAL (150) /* ms */ 34#define HINGE_SCAN_INTERVAL (150) /* ms */
34 35
35#define SPITZ_KEY_CALENDER KEY_F1 36#define SPITZ_KEY_CALENDER KEY_F1
@@ -230,7 +231,7 @@ static void spitzkbd_scankeyboard(struct spitzkbd *spitzkbd_data, struct pt_regs
230 231
231 /* if any keys are pressed, enable the timer */ 232 /* if any keys are pressed, enable the timer */
232 if (num_pressed) 233 if (num_pressed)
233 mod_timer(&spitzkbd_data->timer, jiffies + msecs_to_jiffies(100)); 234 mod_timer(&spitzkbd_data->timer, jiffies + msecs_to_jiffies(SCAN_INTERVAL));
234 235
235 spin_unlock_irqrestore(&spitzkbd_data->lock, flags); 236 spin_unlock_irqrestore(&spitzkbd_data->lock, flags);
236} 237}
@@ -287,6 +288,7 @@ static void spitzkbd_hinge_timer(unsigned long data)
287 unsigned long flags; 288 unsigned long flags;
288 289
289 state = GPLR(SPITZ_GPIO_SWA) & (GPIO_bit(SPITZ_GPIO_SWA)|GPIO_bit(SPITZ_GPIO_SWB)); 290 state = GPLR(SPITZ_GPIO_SWA) & (GPIO_bit(SPITZ_GPIO_SWA)|GPIO_bit(SPITZ_GPIO_SWB));
291 state |= (GPLR(SPITZ_GPIO_AK_INT) & GPIO_bit(SPITZ_GPIO_AK_INT));
290 if (state != sharpsl_hinge_state) { 292 if (state != sharpsl_hinge_state) {
291 hinge_count = 0; 293 hinge_count = 0;
292 sharpsl_hinge_state = state; 294 sharpsl_hinge_state = state;
@@ -299,6 +301,7 @@ static void spitzkbd_hinge_timer(unsigned long data)
299 301
300 input_report_switch(spitzkbd_data->input, SW_0, ((GPLR(SPITZ_GPIO_SWA) & GPIO_bit(SPITZ_GPIO_SWA)) != 0)); 302 input_report_switch(spitzkbd_data->input, SW_0, ((GPLR(SPITZ_GPIO_SWA) & GPIO_bit(SPITZ_GPIO_SWA)) != 0));
301 input_report_switch(spitzkbd_data->input, SW_1, ((GPLR(SPITZ_GPIO_SWB) & GPIO_bit(SPITZ_GPIO_SWB)) != 0)); 303 input_report_switch(spitzkbd_data->input, SW_1, ((GPLR(SPITZ_GPIO_SWB) & GPIO_bit(SPITZ_GPIO_SWB)) != 0));
304 input_report_switch(spitzkbd_data->input, SW_2, ((GPLR(SPITZ_GPIO_AK_INT) & GPIO_bit(SPITZ_GPIO_AK_INT)) != 0));
302 input_sync(spitzkbd_data->input); 305 input_sync(spitzkbd_data->input);
303 306
304 spin_unlock_irqrestore(&spitzkbd_data->lock, flags); 307 spin_unlock_irqrestore(&spitzkbd_data->lock, flags);
@@ -397,6 +400,7 @@ static int __init spitzkbd_probe(struct platform_device *dev)
397 clear_bit(0, input_dev->keybit); 400 clear_bit(0, input_dev->keybit);
398 set_bit(SW_0, input_dev->swbit); 401 set_bit(SW_0, input_dev->swbit);
399 set_bit(SW_1, input_dev->swbit); 402 set_bit(SW_1, input_dev->swbit);
403 set_bit(SW_2, input_dev->swbit);
400 404
401 input_register_device(input_dev); 405 input_register_device(input_dev);
402 406
@@ -432,6 +436,9 @@ static int __init spitzkbd_probe(struct platform_device *dev)
432 request_irq(SPITZ_IRQ_GPIO_SWB, spitzkbd_hinge_isr, 436 request_irq(SPITZ_IRQ_GPIO_SWB, spitzkbd_hinge_isr,
433 SA_INTERRUPT | SA_TRIGGER_RISING | SA_TRIGGER_FALLING, 437 SA_INTERRUPT | SA_TRIGGER_RISING | SA_TRIGGER_FALLING,
434 "Spitzkbd SWB", spitzkbd); 438 "Spitzkbd SWB", spitzkbd);
439 request_irq(SPITZ_IRQ_GPIO_AK_INT, spitzkbd_hinge_isr,
440 SA_INTERRUPT | SA_TRIGGER_RISING | SA_TRIGGER_FALLING,
441 "Spitzkbd HP", spitzkbd);
435 442
436 printk(KERN_INFO "input: Spitz Keyboard Registered\n"); 443 printk(KERN_INFO "input: Spitz Keyboard Registered\n");
437 444
@@ -450,6 +457,7 @@ static int spitzkbd_remove(struct platform_device *dev)
450 free_irq(SPITZ_IRQ_GPIO_ON_KEY, spitzkbd); 457 free_irq(SPITZ_IRQ_GPIO_ON_KEY, spitzkbd);
451 free_irq(SPITZ_IRQ_GPIO_SWA, spitzkbd); 458 free_irq(SPITZ_IRQ_GPIO_SWA, spitzkbd);
452 free_irq(SPITZ_IRQ_GPIO_SWB, spitzkbd); 459 free_irq(SPITZ_IRQ_GPIO_SWB, spitzkbd);
460 free_irq(SPITZ_IRQ_GPIO_AK_INT, spitzkbd);
453 461
454 del_timer_sync(&spitzkbd->htimer); 462 del_timer_sync(&spitzkbd->htimer);
455 del_timer_sync(&spitzkbd->timer); 463 del_timer_sync(&spitzkbd->timer);