diff options
Diffstat (limited to 'drivers/input/keyboard')
-rw-r--r-- | drivers/input/keyboard/amikbd.c | 2 | ||||
-rw-r--r-- | drivers/input/keyboard/atkbd.c | 46 | ||||
-rw-r--r-- | drivers/input/keyboard/gpio_keys.c | 89 | ||||
-rw-r--r-- | drivers/input/keyboard/lkkbd.c | 6 | ||||
-rw-r--r-- | drivers/input/keyboard/pxa27x_keypad.c | 15 | ||||
-rw-r--r-- | drivers/input/keyboard/sunkbd.c | 2 | ||||
-rw-r--r-- | drivers/input/keyboard/xtkbd.c | 2 |
7 files changed, 122 insertions, 40 deletions
diff --git a/drivers/input/keyboard/amikbd.c b/drivers/input/keyboard/amikbd.c index 81bf7562aca0..35149ec455a9 100644 --- a/drivers/input/keyboard/amikbd.c +++ b/drivers/input/keyboard/amikbd.c | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: amikbd.c,v 1.13 2002/02/01 16:02:24 vojtech Exp $ | ||
3 | * | ||
4 | * Copyright (c) 2000-2001 Vojtech Pavlik | 2 | * Copyright (c) 2000-2001 Vojtech Pavlik |
5 | * | 3 | * |
6 | * Based on the work of: | 4 | * Based on the work of: |
diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c index af58a6f1e898..b1ce10f50bcf 100644 --- a/drivers/input/keyboard/atkbd.c +++ b/drivers/input/keyboard/atkbd.c | |||
@@ -68,7 +68,7 @@ MODULE_PARM_DESC(extra, "Enable extra LEDs and keys on IBM RapidAcces, EzKey and | |||
68 | * are loadable via an userland utility. | 68 | * are loadable via an userland utility. |
69 | */ | 69 | */ |
70 | 70 | ||
71 | static unsigned char atkbd_set2_keycode[512] = { | 71 | static const unsigned short atkbd_set2_keycode[512] = { |
72 | 72 | ||
73 | #ifdef CONFIG_KEYBOARD_ATKBD_HP_KEYCODES | 73 | #ifdef CONFIG_KEYBOARD_ATKBD_HP_KEYCODES |
74 | 74 | ||
@@ -99,7 +99,7 @@ static unsigned char atkbd_set2_keycode[512] = { | |||
99 | #endif | 99 | #endif |
100 | }; | 100 | }; |
101 | 101 | ||
102 | static unsigned char atkbd_set3_keycode[512] = { | 102 | static const unsigned short atkbd_set3_keycode[512] = { |
103 | 103 | ||
104 | 0, 0, 0, 0, 0, 0, 0, 59, 1,138,128,129,130, 15, 41, 60, | 104 | 0, 0, 0, 0, 0, 0, 0, 59, 1,138,128,129,130, 15, 41, 60, |
105 | 131, 29, 42, 86, 58, 16, 2, 61,133, 56, 44, 31, 30, 17, 3, 62, | 105 | 131, 29, 42, 86, 58, 16, 2, 61,133, 56, 44, 31, 30, 17, 3, 62, |
@@ -115,7 +115,7 @@ static unsigned char atkbd_set3_keycode[512] = { | |||
115 | 148,149,147,140 | 115 | 148,149,147,140 |
116 | }; | 116 | }; |
117 | 117 | ||
118 | static unsigned char atkbd_unxlate_table[128] = { | 118 | static const unsigned short atkbd_unxlate_table[128] = { |
119 | 0,118, 22, 30, 38, 37, 46, 54, 61, 62, 70, 69, 78, 85,102, 13, | 119 | 0,118, 22, 30, 38, 37, 46, 54, 61, 62, 70, 69, 78, 85,102, 13, |
120 | 21, 29, 36, 45, 44, 53, 60, 67, 68, 77, 84, 91, 90, 20, 28, 27, | 120 | 21, 29, 36, 45, 44, 53, 60, 67, 68, 77, 84, 91, 90, 20, 28, 27, |
121 | 35, 43, 52, 51, 59, 66, 75, 76, 82, 14, 18, 93, 26, 34, 33, 42, | 121 | 35, 43, 52, 51, 59, 66, 75, 76, 82, 14, 18, 93, 26, 34, 33, 42, |
@@ -161,7 +161,7 @@ static unsigned char atkbd_unxlate_table[128] = { | |||
161 | #define ATKBD_SCR_LEFT 249 | 161 | #define ATKBD_SCR_LEFT 249 |
162 | #define ATKBD_SCR_RIGHT 248 | 162 | #define ATKBD_SCR_RIGHT 248 |
163 | 163 | ||
164 | #define ATKBD_SPECIAL 248 | 164 | #define ATKBD_SPECIAL ATKBD_SCR_RIGHT |
165 | 165 | ||
166 | #define ATKBD_LED_EVENT_BIT 0 | 166 | #define ATKBD_LED_EVENT_BIT 0 |
167 | #define ATKBD_REP_EVENT_BIT 1 | 167 | #define ATKBD_REP_EVENT_BIT 1 |
@@ -173,7 +173,7 @@ static unsigned char atkbd_unxlate_table[128] = { | |||
173 | #define ATKBD_XL_HANGEUL 0x10 | 173 | #define ATKBD_XL_HANGEUL 0x10 |
174 | #define ATKBD_XL_HANJA 0x20 | 174 | #define ATKBD_XL_HANJA 0x20 |
175 | 175 | ||
176 | static struct { | 176 | static const struct { |
177 | unsigned char keycode; | 177 | unsigned char keycode; |
178 | unsigned char set2; | 178 | unsigned char set2; |
179 | } atkbd_scroll_keys[] = { | 179 | } atkbd_scroll_keys[] = { |
@@ -200,7 +200,7 @@ struct atkbd { | |||
200 | char phys[32]; | 200 | char phys[32]; |
201 | 201 | ||
202 | unsigned short id; | 202 | unsigned short id; |
203 | unsigned char keycode[512]; | 203 | unsigned short keycode[512]; |
204 | DECLARE_BITMAP(force_release_mask, 512); | 204 | DECLARE_BITMAP(force_release_mask, 512); |
205 | unsigned char set; | 205 | unsigned char set; |
206 | unsigned char translated; | 206 | unsigned char translated; |
@@ -357,7 +357,7 @@ static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data, | |||
357 | unsigned int code = data; | 357 | unsigned int code = data; |
358 | int scroll = 0, hscroll = 0, click = -1; | 358 | int scroll = 0, hscroll = 0, click = -1; |
359 | int value; | 359 | int value; |
360 | unsigned char keycode; | 360 | unsigned short keycode; |
361 | 361 | ||
362 | #ifdef ATKBD_DEBUG | 362 | #ifdef ATKBD_DEBUG |
363 | printk(KERN_DEBUG "atkbd.c: Received %02x flags %02x\n", data, flags); | 363 | printk(KERN_DEBUG "atkbd.c: Received %02x flags %02x\n", data, flags); |
@@ -851,6 +851,23 @@ static void atkbd_latitude_keymap_fixup(struct atkbd *atkbd) | |||
851 | } | 851 | } |
852 | 852 | ||
853 | /* | 853 | /* |
854 | * Perform fixup for HP system that doesn't generate release | ||
855 | * for its video switch | ||
856 | */ | ||
857 | static void atkbd_hp_keymap_fixup(struct atkbd *atkbd) | ||
858 | { | ||
859 | const unsigned int forced_release_keys[] = { | ||
860 | 0x94, | ||
861 | }; | ||
862 | int i; | ||
863 | |||
864 | if (atkbd->set == 2) | ||
865 | for (i = 0; i < ARRAY_SIZE(forced_release_keys); i++) | ||
866 | __set_bit(forced_release_keys[i], | ||
867 | atkbd->force_release_mask); | ||
868 | } | ||
869 | |||
870 | /* | ||
854 | * atkbd_set_keycode_table() initializes keyboard's keycode table | 871 | * atkbd_set_keycode_table() initializes keyboard's keycode table |
855 | * according to the selected scancode set | 872 | * according to the selected scancode set |
856 | */ | 873 | */ |
@@ -961,16 +978,16 @@ static void atkbd_set_device_attrs(struct atkbd *atkbd) | |||
961 | input_dev->evbit[0] |= BIT_MASK(EV_REL); | 978 | input_dev->evbit[0] |= BIT_MASK(EV_REL); |
962 | input_dev->relbit[0] = BIT_MASK(REL_WHEEL) | | 979 | input_dev->relbit[0] = BIT_MASK(REL_WHEEL) | |
963 | BIT_MASK(REL_HWHEEL); | 980 | BIT_MASK(REL_HWHEEL); |
964 | set_bit(BTN_MIDDLE, input_dev->keybit); | 981 | __set_bit(BTN_MIDDLE, input_dev->keybit); |
965 | } | 982 | } |
966 | 983 | ||
967 | input_dev->keycode = atkbd->keycode; | 984 | input_dev->keycode = atkbd->keycode; |
968 | input_dev->keycodesize = sizeof(unsigned char); | 985 | input_dev->keycodesize = sizeof(unsigned short); |
969 | input_dev->keycodemax = ARRAY_SIZE(atkbd_set2_keycode); | 986 | input_dev->keycodemax = ARRAY_SIZE(atkbd_set2_keycode); |
970 | 987 | ||
971 | for (i = 0; i < 512; i++) | 988 | for (i = 0; i < 512; i++) |
972 | if (atkbd->keycode[i] && atkbd->keycode[i] < ATKBD_SPECIAL) | 989 | if (atkbd->keycode[i] && atkbd->keycode[i] < ATKBD_SPECIAL) |
973 | set_bit(atkbd->keycode[i], input_dev->keybit); | 990 | __set_bit(atkbd->keycode[i], input_dev->keybit); |
974 | } | 991 | } |
975 | 992 | ||
976 | /* | 993 | /* |
@@ -1452,6 +1469,15 @@ static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = { | |||
1452 | .callback = atkbd_setup_fixup, | 1469 | .callback = atkbd_setup_fixup, |
1453 | .driver_data = atkbd_latitude_keymap_fixup, | 1470 | .driver_data = atkbd_latitude_keymap_fixup, |
1454 | }, | 1471 | }, |
1472 | { | ||
1473 | .ident = "HP 2133", | ||
1474 | .matches = { | ||
1475 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
1476 | DMI_MATCH(DMI_PRODUCT_NAME, "HP 2133"), | ||
1477 | }, | ||
1478 | .callback = atkbd_setup_fixup, | ||
1479 | .driver_data = atkbd_hp_keymap_fixup, | ||
1480 | }, | ||
1455 | { } | 1481 | { } |
1456 | }; | 1482 | }; |
1457 | 1483 | ||
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index bbd00c3fe98c..be58730e636a 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c | |||
@@ -26,23 +26,54 @@ | |||
26 | 26 | ||
27 | #include <asm/gpio.h> | 27 | #include <asm/gpio.h> |
28 | 28 | ||
29 | struct gpio_button_data { | ||
30 | struct gpio_keys_button *button; | ||
31 | struct input_dev *input; | ||
32 | struct timer_list timer; | ||
33 | }; | ||
34 | |||
35 | struct gpio_keys_drvdata { | ||
36 | struct input_dev *input; | ||
37 | struct gpio_button_data data[0]; | ||
38 | }; | ||
39 | |||
40 | static void gpio_keys_report_event(struct gpio_keys_button *button, | ||
41 | struct input_dev *input) | ||
42 | { | ||
43 | unsigned int type = button->type ?: EV_KEY; | ||
44 | int state = (gpio_get_value(button->gpio) ? 1 : 0) ^ button->active_low; | ||
45 | |||
46 | input_event(input, type, button->code, !!state); | ||
47 | input_sync(input); | ||
48 | } | ||
49 | |||
50 | static void gpio_check_button(unsigned long _data) | ||
51 | { | ||
52 | struct gpio_button_data *data = (struct gpio_button_data *)_data; | ||
53 | |||
54 | gpio_keys_report_event(data->button, data->input); | ||
55 | } | ||
56 | |||
29 | static irqreturn_t gpio_keys_isr(int irq, void *dev_id) | 57 | static irqreturn_t gpio_keys_isr(int irq, void *dev_id) |
30 | { | 58 | { |
31 | int i; | ||
32 | struct platform_device *pdev = dev_id; | 59 | struct platform_device *pdev = dev_id; |
33 | struct gpio_keys_platform_data *pdata = pdev->dev.platform_data; | 60 | struct gpio_keys_platform_data *pdata = pdev->dev.platform_data; |
34 | struct input_dev *input = platform_get_drvdata(pdev); | 61 | struct gpio_keys_drvdata *ddata = platform_get_drvdata(pdev); |
62 | int i; | ||
35 | 63 | ||
36 | for (i = 0; i < pdata->nbuttons; i++) { | 64 | for (i = 0; i < pdata->nbuttons; i++) { |
37 | struct gpio_keys_button *button = &pdata->buttons[i]; | 65 | struct gpio_keys_button *button = &pdata->buttons[i]; |
38 | int gpio = button->gpio; | ||
39 | 66 | ||
40 | if (irq == gpio_to_irq(gpio)) { | 67 | if (irq == gpio_to_irq(button->gpio)) { |
41 | unsigned int type = button->type ?: EV_KEY; | 68 | struct gpio_button_data *bdata = &ddata->data[i]; |
42 | int state = (gpio_get_value(gpio) ? 1 : 0) ^ button->active_low; | 69 | |
70 | if (button->debounce_interval) | ||
71 | mod_timer(&bdata->timer, | ||
72 | jiffies + | ||
73 | msecs_to_jiffies(button->debounce_interval)); | ||
74 | else | ||
75 | gpio_keys_report_event(button, bdata->input); | ||
43 | 76 | ||
44 | input_event(input, type, button->code, !!state); | ||
45 | input_sync(input); | ||
46 | return IRQ_HANDLED; | 77 | return IRQ_HANDLED; |
47 | } | 78 | } |
48 | } | 79 | } |
@@ -53,17 +84,21 @@ static irqreturn_t gpio_keys_isr(int irq, void *dev_id) | |||
53 | static int __devinit gpio_keys_probe(struct platform_device *pdev) | 84 | static int __devinit gpio_keys_probe(struct platform_device *pdev) |
54 | { | 85 | { |
55 | struct gpio_keys_platform_data *pdata = pdev->dev.platform_data; | 86 | struct gpio_keys_platform_data *pdata = pdev->dev.platform_data; |
87 | struct gpio_keys_drvdata *ddata; | ||
56 | struct input_dev *input; | 88 | struct input_dev *input; |
57 | int i, error; | 89 | int i, error; |
58 | int wakeup = 0; | 90 | int wakeup = 0; |
59 | 91 | ||
92 | ddata = kzalloc(sizeof(struct gpio_keys_drvdata) + | ||
93 | pdata->nbuttons * sizeof(struct gpio_button_data), | ||
94 | GFP_KERNEL); | ||
60 | input = input_allocate_device(); | 95 | input = input_allocate_device(); |
61 | if (!input) | 96 | if (!ddata || !input) { |
62 | return -ENOMEM; | 97 | error = -ENOMEM; |
63 | 98 | goto fail1; | |
64 | platform_set_drvdata(pdev, input); | 99 | } |
65 | 100 | ||
66 | input->evbit[0] = BIT_MASK(EV_KEY); | 101 | platform_set_drvdata(pdev, ddata); |
67 | 102 | ||
68 | input->name = pdev->name; | 103 | input->name = pdev->name; |
69 | input->phys = "gpio-keys/input0"; | 104 | input->phys = "gpio-keys/input0"; |
@@ -74,16 +109,23 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev) | |||
74 | input->id.product = 0x0001; | 109 | input->id.product = 0x0001; |
75 | input->id.version = 0x0100; | 110 | input->id.version = 0x0100; |
76 | 111 | ||
112 | ddata->input = input; | ||
113 | |||
77 | for (i = 0; i < pdata->nbuttons; i++) { | 114 | for (i = 0; i < pdata->nbuttons; i++) { |
78 | struct gpio_keys_button *button = &pdata->buttons[i]; | 115 | struct gpio_keys_button *button = &pdata->buttons[i]; |
116 | struct gpio_button_data *bdata = &ddata->data[i]; | ||
79 | int irq; | 117 | int irq; |
80 | unsigned int type = button->type ?: EV_KEY; | 118 | unsigned int type = button->type ?: EV_KEY; |
81 | 119 | ||
120 | bdata->input = input; | ||
121 | setup_timer(&bdata->timer, | ||
122 | gpio_check_button, (unsigned long)bdata); | ||
123 | |||
82 | error = gpio_request(button->gpio, button->desc ?: "gpio_keys"); | 124 | error = gpio_request(button->gpio, button->desc ?: "gpio_keys"); |
83 | if (error < 0) { | 125 | if (error < 0) { |
84 | pr_err("gpio-keys: failed to request GPIO %d," | 126 | pr_err("gpio-keys: failed to request GPIO %d," |
85 | " error %d\n", button->gpio, error); | 127 | " error %d\n", button->gpio, error); |
86 | goto fail; | 128 | goto fail2; |
87 | } | 129 | } |
88 | 130 | ||
89 | error = gpio_direction_input(button->gpio); | 131 | error = gpio_direction_input(button->gpio); |
@@ -92,7 +134,7 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev) | |||
92 | " direction for GPIO %d, error %d\n", | 134 | " direction for GPIO %d, error %d\n", |
93 | button->gpio, error); | 135 | button->gpio, error); |
94 | gpio_free(button->gpio); | 136 | gpio_free(button->gpio); |
95 | goto fail; | 137 | goto fail2; |
96 | } | 138 | } |
97 | 139 | ||
98 | irq = gpio_to_irq(button->gpio); | 140 | irq = gpio_to_irq(button->gpio); |
@@ -102,7 +144,7 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev) | |||
102 | " for GPIO %d, error %d\n", | 144 | " for GPIO %d, error %d\n", |
103 | button->gpio, error); | 145 | button->gpio, error); |
104 | gpio_free(button->gpio); | 146 | gpio_free(button->gpio); |
105 | goto fail; | 147 | goto fail2; |
106 | } | 148 | } |
107 | 149 | ||
108 | error = request_irq(irq, gpio_keys_isr, | 150 | error = request_irq(irq, gpio_keys_isr, |
@@ -114,7 +156,7 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev) | |||
114 | pr_err("gpio-keys: Unable to claim irq %d; error %d\n", | 156 | pr_err("gpio-keys: Unable to claim irq %d; error %d\n", |
115 | irq, error); | 157 | irq, error); |
116 | gpio_free(button->gpio); | 158 | gpio_free(button->gpio); |
117 | goto fail; | 159 | goto fail2; |
118 | } | 160 | } |
119 | 161 | ||
120 | if (button->wakeup) | 162 | if (button->wakeup) |
@@ -127,21 +169,25 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev) | |||
127 | if (error) { | 169 | if (error) { |
128 | pr_err("gpio-keys: Unable to register input device, " | 170 | pr_err("gpio-keys: Unable to register input device, " |
129 | "error: %d\n", error); | 171 | "error: %d\n", error); |
130 | goto fail; | 172 | goto fail2; |
131 | } | 173 | } |
132 | 174 | ||
133 | device_init_wakeup(&pdev->dev, wakeup); | 175 | device_init_wakeup(&pdev->dev, wakeup); |
134 | 176 | ||
135 | return 0; | 177 | return 0; |
136 | 178 | ||
137 | fail: | 179 | fail2: |
138 | while (--i >= 0) { | 180 | while (--i >= 0) { |
139 | free_irq(gpio_to_irq(pdata->buttons[i].gpio), pdev); | 181 | free_irq(gpio_to_irq(pdata->buttons[i].gpio), pdev); |
182 | if (pdata->buttons[i].debounce_interval) | ||
183 | del_timer_sync(&ddata->data[i].timer); | ||
140 | gpio_free(pdata->buttons[i].gpio); | 184 | gpio_free(pdata->buttons[i].gpio); |
141 | } | 185 | } |
142 | 186 | ||
143 | platform_set_drvdata(pdev, NULL); | 187 | platform_set_drvdata(pdev, NULL); |
188 | fail1: | ||
144 | input_free_device(input); | 189 | input_free_device(input); |
190 | kfree(ddata); | ||
145 | 191 | ||
146 | return error; | 192 | return error; |
147 | } | 193 | } |
@@ -149,7 +195,8 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev) | |||
149 | static int __devexit gpio_keys_remove(struct platform_device *pdev) | 195 | static int __devexit gpio_keys_remove(struct platform_device *pdev) |
150 | { | 196 | { |
151 | struct gpio_keys_platform_data *pdata = pdev->dev.platform_data; | 197 | struct gpio_keys_platform_data *pdata = pdev->dev.platform_data; |
152 | struct input_dev *input = platform_get_drvdata(pdev); | 198 | struct gpio_keys_drvdata *ddata = platform_get_drvdata(pdev); |
199 | struct input_dev *input = ddata->input; | ||
153 | int i; | 200 | int i; |
154 | 201 | ||
155 | device_init_wakeup(&pdev->dev, 0); | 202 | device_init_wakeup(&pdev->dev, 0); |
@@ -157,6 +204,8 @@ static int __devexit gpio_keys_remove(struct platform_device *pdev) | |||
157 | for (i = 0; i < pdata->nbuttons; i++) { | 204 | for (i = 0; i < pdata->nbuttons; i++) { |
158 | int irq = gpio_to_irq(pdata->buttons[i].gpio); | 205 | int irq = gpio_to_irq(pdata->buttons[i].gpio); |
159 | free_irq(irq, pdev); | 206 | free_irq(irq, pdev); |
207 | if (pdata->buttons[i].debounce_interval) | ||
208 | del_timer_sync(&ddata->data[i].timer); | ||
160 | gpio_free(pdata->buttons[i].gpio); | 209 | gpio_free(pdata->buttons[i].gpio); |
161 | } | 210 | } |
162 | 211 | ||
diff --git a/drivers/input/keyboard/lkkbd.c b/drivers/input/keyboard/lkkbd.c index 32e2c2605d95..4730ef35c732 100644 --- a/drivers/input/keyboard/lkkbd.c +++ b/drivers/input/keyboard/lkkbd.c | |||
@@ -538,11 +538,11 @@ lkkbd_event (struct input_dev *dev, unsigned int type, unsigned int code, | |||
538 | switch (code) { | 538 | switch (code) { |
539 | case SND_CLICK: | 539 | case SND_CLICK: |
540 | if (value == 0) { | 540 | if (value == 0) { |
541 | DBG ("%s: Deactivating key clicks\n", __FUNCTION__); | 541 | DBG ("%s: Deactivating key clicks\n", __func__); |
542 | lk->serio->write (lk->serio, LK_CMD_DISABLE_KEYCLICK); | 542 | lk->serio->write (lk->serio, LK_CMD_DISABLE_KEYCLICK); |
543 | lk->serio->write (lk->serio, LK_CMD_DISABLE_CTRCLICK); | 543 | lk->serio->write (lk->serio, LK_CMD_DISABLE_CTRCLICK); |
544 | } else { | 544 | } else { |
545 | DBG ("%s: Activating key clicks\n", __FUNCTION__); | 545 | DBG ("%s: Activating key clicks\n", __func__); |
546 | lk->serio->write (lk->serio, LK_CMD_ENABLE_KEYCLICK); | 546 | lk->serio->write (lk->serio, LK_CMD_ENABLE_KEYCLICK); |
547 | lk->serio->write (lk->serio, volume_to_hw (lk->keyclick_volume)); | 547 | lk->serio->write (lk->serio, volume_to_hw (lk->keyclick_volume)); |
548 | lk->serio->write (lk->serio, LK_CMD_ENABLE_CTRCLICK); | 548 | lk->serio->write (lk->serio, LK_CMD_ENABLE_CTRCLICK); |
@@ -560,7 +560,7 @@ lkkbd_event (struct input_dev *dev, unsigned int type, unsigned int code, | |||
560 | 560 | ||
561 | default: | 561 | default: |
562 | printk (KERN_ERR "%s (): Got unknown type %d, code %d, value %d\n", | 562 | printk (KERN_ERR "%s (): Got unknown type %d, code %d, value %d\n", |
563 | __FUNCTION__, type, code, value); | 563 | __func__, type, code, value); |
564 | } | 564 | } |
565 | 565 | ||
566 | return -1; | 566 | return -1; |
diff --git a/drivers/input/keyboard/pxa27x_keypad.c b/drivers/input/keyboard/pxa27x_keypad.c index 45767e73f071..6f1516f50750 100644 --- a/drivers/input/keyboard/pxa27x_keypad.c +++ b/drivers/input/keyboard/pxa27x_keypad.c | |||
@@ -105,6 +105,8 @@ struct pxa27x_keypad { | |||
105 | struct input_dev *input_dev; | 105 | struct input_dev *input_dev; |
106 | void __iomem *mmio_base; | 106 | void __iomem *mmio_base; |
107 | 107 | ||
108 | int irq; | ||
109 | |||
108 | /* matrix key code map */ | 110 | /* matrix key code map */ |
109 | unsigned int matrix_keycodes[MAX_MATRIX_KEY_NUM]; | 111 | unsigned int matrix_keycodes[MAX_MATRIX_KEY_NUM]; |
110 | 112 | ||
@@ -392,6 +394,10 @@ static int pxa27x_keypad_suspend(struct platform_device *pdev, pm_message_t stat | |||
392 | struct pxa27x_keypad *keypad = platform_get_drvdata(pdev); | 394 | struct pxa27x_keypad *keypad = platform_get_drvdata(pdev); |
393 | 395 | ||
394 | clk_disable(keypad->clk); | 396 | clk_disable(keypad->clk); |
397 | |||
398 | if (device_may_wakeup(&pdev->dev)) | ||
399 | enable_irq_wake(keypad->irq); | ||
400 | |||
395 | return 0; | 401 | return 0; |
396 | } | 402 | } |
397 | 403 | ||
@@ -400,6 +406,9 @@ static int pxa27x_keypad_resume(struct platform_device *pdev) | |||
400 | struct pxa27x_keypad *keypad = platform_get_drvdata(pdev); | 406 | struct pxa27x_keypad *keypad = platform_get_drvdata(pdev); |
401 | struct input_dev *input_dev = keypad->input_dev; | 407 | struct input_dev *input_dev = keypad->input_dev; |
402 | 408 | ||
409 | if (device_may_wakeup(&pdev->dev)) | ||
410 | disable_irq_wake(keypad->irq); | ||
411 | |||
403 | mutex_lock(&input_dev->mutex); | 412 | mutex_lock(&input_dev->mutex); |
404 | 413 | ||
405 | if (input_dev->users) { | 414 | if (input_dev->users) { |
@@ -509,6 +518,8 @@ static int __devinit pxa27x_keypad_probe(struct platform_device *pdev) | |||
509 | goto failed_free_dev; | 518 | goto failed_free_dev; |
510 | } | 519 | } |
511 | 520 | ||
521 | keypad->irq = irq; | ||
522 | |||
512 | /* Register the input device */ | 523 | /* Register the input device */ |
513 | error = input_register_device(input_dev); | 524 | error = input_register_device(input_dev); |
514 | if (error) { | 525 | if (error) { |
@@ -516,6 +527,8 @@ static int __devinit pxa27x_keypad_probe(struct platform_device *pdev) | |||
516 | goto failed_free_irq; | 527 | goto failed_free_irq; |
517 | } | 528 | } |
518 | 529 | ||
530 | device_init_wakeup(&pdev->dev, 1); | ||
531 | |||
519 | return 0; | 532 | return 0; |
520 | 533 | ||
521 | failed_free_irq: | 534 | failed_free_irq: |
@@ -539,7 +552,7 @@ static int __devexit pxa27x_keypad_remove(struct platform_device *pdev) | |||
539 | struct pxa27x_keypad *keypad = platform_get_drvdata(pdev); | 552 | struct pxa27x_keypad *keypad = platform_get_drvdata(pdev); |
540 | struct resource *res; | 553 | struct resource *res; |
541 | 554 | ||
542 | free_irq(platform_get_irq(pdev, 0), pdev); | 555 | free_irq(keypad->irq, pdev); |
543 | 556 | ||
544 | clk_disable(keypad->clk); | 557 | clk_disable(keypad->clk); |
545 | clk_put(keypad->clk); | 558 | clk_put(keypad->clk); |
diff --git a/drivers/input/keyboard/sunkbd.c b/drivers/input/keyboard/sunkbd.c index be0f5d19d023..9fce6d1e29b2 100644 --- a/drivers/input/keyboard/sunkbd.c +++ b/drivers/input/keyboard/sunkbd.c | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: sunkbd.c,v 1.14 2001/09/25 10:12:07 vojtech Exp $ | ||
3 | * | ||
4 | * Copyright (c) 1999-2001 Vojtech Pavlik | 2 | * Copyright (c) 1999-2001 Vojtech Pavlik |
5 | */ | 3 | */ |
6 | 4 | ||
diff --git a/drivers/input/keyboard/xtkbd.c b/drivers/input/keyboard/xtkbd.c index 152a2c070508..37b01d777a4a 100644 --- a/drivers/input/keyboard/xtkbd.c +++ b/drivers/input/keyboard/xtkbd.c | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: xtkbd.c,v 1.11 2001/09/25 10:12:07 vojtech Exp $ | ||
3 | * | ||
4 | * Copyright (c) 1999-2001 Vojtech Pavlik | 2 | * Copyright (c) 1999-2001 Vojtech Pavlik |
5 | */ | 3 | */ |
6 | 4 | ||