aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2013-11-14 20:38:05 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2013-11-14 20:38:05 -0500
commit42249094f79422fbf5ed4b54eeb48ff096809b8f (patch)
tree91e6850c8c7e8cc284cf8bb6363f8662f84011f4 /drivers/input/keyboard
parent936816161978ca716a56c5e553c68f25972b1e3a (diff)
parent2c027b7c48a888ab173ba45babb4525e278375d9 (diff)
Merge branch 'next' into for-linus
Merge first round of changes for 3.13 merge window.
Diffstat (limited to 'drivers/input/keyboard')
-rw-r--r--drivers/input/keyboard/Kconfig10
-rw-r--r--drivers/input/keyboard/cros_ec_keyb.c54
-rw-r--r--drivers/input/keyboard/gpio_keys.c1
-rw-r--r--drivers/input/keyboard/gpio_keys_polled.c1
-rw-r--r--drivers/input/keyboard/lpc32xx-keys.c2
-rw-r--r--drivers/input/keyboard/nspire-keypad.c6
-rw-r--r--drivers/input/keyboard/pxa27x_keypad.c1
-rw-r--r--drivers/input/keyboard/tegra-kbc.c2
-rw-r--r--drivers/input/keyboard/tnetv107x-keypad.c4
9 files changed, 43 insertions, 38 deletions
diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index 269d4c3658cb..bb174c1a9886 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -2,7 +2,7 @@
2# Input core configuration 2# Input core configuration
3# 3#
4menuconfig INPUT_KEYBOARD 4menuconfig INPUT_KEYBOARD
5 bool "Keyboards" if EXPERT || !X86 5 bool "Keyboards"
6 default y 6 default y
7 help 7 help
8 Say Y here, and a list of supported keyboards will be displayed. 8 Say Y here, and a list of supported keyboards will be displayed.
@@ -67,7 +67,7 @@ config KEYBOARD_ATARI
67 module will be called atakbd. 67 module will be called atakbd.
68 68
69config KEYBOARD_ATKBD 69config KEYBOARD_ATKBD
70 tristate "AT keyboard" if EXPERT || !X86 70 tristate "AT keyboard"
71 default y 71 default y
72 select SERIO 72 select SERIO
73 select SERIO_LIBPS2 73 select SERIO_LIBPS2
@@ -224,7 +224,7 @@ config KEYBOARD_TCA6416
224 224
225config KEYBOARD_TCA8418 225config KEYBOARD_TCA8418
226 tristate "TCA8418 Keypad Support" 226 tristate "TCA8418 Keypad Support"
227 depends on I2C && GENERIC_HARDIRQS 227 depends on I2C
228 select INPUT_MATRIXKMAP 228 select INPUT_MATRIXKMAP
229 help 229 help
230 This driver implements basic keypad functionality 230 This driver implements basic keypad functionality
@@ -303,7 +303,7 @@ config KEYBOARD_HP7XX
303 303
304config KEYBOARD_LM8323 304config KEYBOARD_LM8323
305 tristate "LM8323 keypad chip" 305 tristate "LM8323 keypad chip"
306 depends on I2C && GENERIC_HARDIRQS 306 depends on I2C
307 depends on LEDS_CLASS 307 depends on LEDS_CLASS
308 help 308 help
309 If you say yes here you get support for the National Semiconductor 309 If you say yes here you get support for the National Semiconductor
@@ -525,7 +525,7 @@ config KEYBOARD_SUNKBD
525 525
526config KEYBOARD_SH_KEYSC 526config KEYBOARD_SH_KEYSC
527 tristate "SuperH KEYSC keypad support" 527 tristate "SuperH KEYSC keypad support"
528 depends on SUPERH || ARCH_SHMOBILE 528 depends on SUPERH || ARM || COMPILE_TEST
529 help 529 help
530 Say Y here if you want to use a keypad attached to the KEYSC block 530 Say Y here if you want to use a keypad attached to the KEYSC block
531 on SuperH processors such as sh7722 and sh7343. 531 on SuperH processors such as sh7722 and sh7343.
diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c
index 49557f27bfa6..7e8b0a52af25 100644
--- a/drivers/input/keyboard/cros_ec_keyb.c
+++ b/drivers/input/keyboard/cros_ec_keyb.c
@@ -206,33 +206,6 @@ static int cros_ec_keyb_work(struct notifier_block *nb,
206 return NOTIFY_DONE; 206 return NOTIFY_DONE;
207} 207}
208 208
209/* Clear any keys in the buffer */
210static void cros_ec_keyb_clear_keyboard(struct cros_ec_keyb *ckdev)
211{
212 uint8_t old_state[ckdev->cols];
213 uint8_t new_state[ckdev->cols];
214 unsigned long duration;
215 int i, ret;
216
217 /*
218 * Keep reading until we see that the scan state does not change.
219 * That indicates that we are done.
220 *
221 * Assume that the EC keyscan buffer is at most 32 deep.
222 */
223 duration = jiffies;
224 ret = cros_ec_keyb_get_state(ckdev, new_state);
225 for (i = 1; !ret && i < 32; i++) {
226 memcpy(old_state, new_state, sizeof(old_state));
227 ret = cros_ec_keyb_get_state(ckdev, new_state);
228 if (0 == memcmp(old_state, new_state, sizeof(old_state)))
229 break;
230 }
231 duration = jiffies - duration;
232 dev_info(ckdev->dev, "Discarded %d keyscan(s) in %dus\n", i,
233 jiffies_to_usecs(duration));
234}
235
236static int cros_ec_keyb_probe(struct platform_device *pdev) 209static int cros_ec_keyb_probe(struct platform_device *pdev)
237{ 210{
238 struct cros_ec_device *ec = dev_get_drvdata(pdev->dev.parent); 211 struct cros_ec_device *ec = dev_get_drvdata(pdev->dev.parent);
@@ -299,6 +272,33 @@ static int cros_ec_keyb_probe(struct platform_device *pdev)
299} 272}
300 273
301#ifdef CONFIG_PM_SLEEP 274#ifdef CONFIG_PM_SLEEP
275/* Clear any keys in the buffer */
276static void cros_ec_keyb_clear_keyboard(struct cros_ec_keyb *ckdev)
277{
278 uint8_t old_state[ckdev->cols];
279 uint8_t new_state[ckdev->cols];
280 unsigned long duration;
281 int i, ret;
282
283 /*
284 * Keep reading until we see that the scan state does not change.
285 * That indicates that we are done.
286 *
287 * Assume that the EC keyscan buffer is at most 32 deep.
288 */
289 duration = jiffies;
290 ret = cros_ec_keyb_get_state(ckdev, new_state);
291 for (i = 1; !ret && i < 32; i++) {
292 memcpy(old_state, new_state, sizeof(old_state));
293 ret = cros_ec_keyb_get_state(ckdev, new_state);
294 if (0 == memcmp(old_state, new_state, sizeof(old_state)))
295 break;
296 }
297 duration = jiffies - duration;
298 dev_info(ckdev->dev, "Discarded %d keyscan(s) in %dus\n", i,
299 jiffies_to_usecs(duration));
300}
301
302static int cros_ec_keyb_resume(struct device *dev) 302static int cros_ec_keyb_resume(struct device *dev)
303{ 303{
304 struct cros_ec_keyb *ckdev = dev_get_drvdata(dev); 304 struct cros_ec_keyb *ckdev = dev_get_drvdata(dev);
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index 440ce32462ba..2db13246eb8e 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -26,6 +26,7 @@
26#include <linux/gpio_keys.h> 26#include <linux/gpio_keys.h>
27#include <linux/workqueue.h> 27#include <linux/workqueue.h>
28#include <linux/gpio.h> 28#include <linux/gpio.h>
29#include <linux/of.h>
29#include <linux/of_platform.h> 30#include <linux/of_platform.h>
30#include <linux/of_gpio.h> 31#include <linux/of_gpio.h>
31#include <linux/spinlock.h> 32#include <linux/spinlock.h>
diff --git a/drivers/input/keyboard/gpio_keys_polled.c b/drivers/input/keyboard/gpio_keys_polled.c
index cd5ed9e22168..4e428199e580 100644
--- a/drivers/input/keyboard/gpio_keys_polled.c
+++ b/drivers/input/keyboard/gpio_keys_polled.c
@@ -25,6 +25,7 @@
25#include <linux/platform_device.h> 25#include <linux/platform_device.h>
26#include <linux/gpio.h> 26#include <linux/gpio.h>
27#include <linux/gpio_keys.h> 27#include <linux/gpio_keys.h>
28#include <linux/of.h>
28#include <linux/of_platform.h> 29#include <linux/of_platform.h>
29#include <linux/of_gpio.h> 30#include <linux/of_gpio.h>
30 31
diff --git a/drivers/input/keyboard/lpc32xx-keys.c b/drivers/input/keyboard/lpc32xx-keys.c
index 42181435fe67..8b1b01361ec6 100644
--- a/drivers/input/keyboard/lpc32xx-keys.c
+++ b/drivers/input/keyboard/lpc32xx-keys.c
@@ -383,7 +383,7 @@ static struct platform_driver lpc32xx_kscan_driver = {
383 .name = DRV_NAME, 383 .name = DRV_NAME,
384 .owner = THIS_MODULE, 384 .owner = THIS_MODULE,
385 .pm = &lpc32xx_kscan_pm_ops, 385 .pm = &lpc32xx_kscan_pm_ops,
386 .of_match_table = of_match_ptr(lpc32xx_kscan_match), 386 .of_match_table = lpc32xx_kscan_match,
387 } 387 }
388}; 388};
389 389
diff --git a/drivers/input/keyboard/nspire-keypad.c b/drivers/input/keyboard/nspire-keypad.c
index b3e3edab6d9f..b31064981e96 100644
--- a/drivers/input/keyboard/nspire-keypad.c
+++ b/drivers/input/keyboard/nspire-keypad.c
@@ -143,8 +143,10 @@ static int nspire_keypad_open(struct input_dev *input)
143 return error; 143 return error;
144 144
145 error = nspire_keypad_chip_init(keypad); 145 error = nspire_keypad_chip_init(keypad);
146 if (error) 146 if (error) {
147 clk_disable_unprepare(keypad->clk);
147 return error; 148 return error;
149 }
148 150
149 return 0; 151 return 0;
150} 152}
@@ -267,7 +269,7 @@ static struct platform_driver nspire_keypad_driver = {
267 .driver = { 269 .driver = {
268 .name = "nspire-keypad", 270 .name = "nspire-keypad",
269 .owner = THIS_MODULE, 271 .owner = THIS_MODULE,
270 .of_match_table = of_match_ptr(nspire_keypad_dt_match), 272 .of_match_table = nspire_keypad_dt_match,
271 }, 273 },
272 .probe = nspire_keypad_probe, 274 .probe = nspire_keypad_probe,
273}; 275};
diff --git a/drivers/input/keyboard/pxa27x_keypad.c b/drivers/input/keyboard/pxa27x_keypad.c
index a2e758d27584..186138c720c7 100644
--- a/drivers/input/keyboard/pxa27x_keypad.c
+++ b/drivers/input/keyboard/pxa27x_keypad.c
@@ -27,6 +27,7 @@
27#include <linux/err.h> 27#include <linux/err.h>
28#include <linux/input/matrix_keypad.h> 28#include <linux/input/matrix_keypad.h>
29#include <linux/slab.h> 29#include <linux/slab.h>
30#include <linux/of.h>
30 31
31#include <asm/mach/arch.h> 32#include <asm/mach/arch.h>
32#include <asm/mach/map.h> 33#include <asm/mach/map.h>
diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c
index 9cd20e6905a0..8508879f6faf 100644
--- a/drivers/input/keyboard/tegra-kbc.c
+++ b/drivers/input/keyboard/tegra-kbc.c
@@ -614,7 +614,7 @@ static int tegra_kbc_probe(struct platform_device *pdev)
614 unsigned int keymap_rows; 614 unsigned int keymap_rows;
615 const struct of_device_id *match; 615 const struct of_device_id *match;
616 616
617 match = of_match_device(of_match_ptr(tegra_kbc_of_match), &pdev->dev); 617 match = of_match_device(tegra_kbc_of_match, &pdev->dev);
618 618
619 kbc = devm_kzalloc(&pdev->dev, sizeof(*kbc), GFP_KERNEL); 619 kbc = devm_kzalloc(&pdev->dev, sizeof(*kbc), GFP_KERNEL);
620 if (!kbc) { 620 if (!kbc) {
diff --git a/drivers/input/keyboard/tnetv107x-keypad.c b/drivers/input/keyboard/tnetv107x-keypad.c
index 5f7b427dd7ed..8bd24d52bf1b 100644
--- a/drivers/input/keyboard/tnetv107x-keypad.c
+++ b/drivers/input/keyboard/tnetv107x-keypad.c
@@ -60,8 +60,8 @@ struct keypad_data {
60 struct clk *clk; 60 struct clk *clk;
61 struct device *dev; 61 struct device *dev;
62 spinlock_t lock; 62 spinlock_t lock;
63 u32 irq_press; 63 int irq_press;
64 u32 irq_release; 64 int irq_release;
65 int rows, cols, row_shift; 65 int rows, cols, row_shift;
66 int debounce_ms, active_low; 66 int debounce_ms, active_low;
67 u32 prev_keys[3]; 67 u32 prev_keys[3];