aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Eremin-Solenikov <dbaryshkov@gmail.com>2014-02-25 06:59:19 -0500
committerHaojian Zhuang <haojian.zhuang@gmail.com>2014-03-03 20:17:01 -0500
commitdc5dfab4ed18f0756f304dc5699b5743ddf56f90 (patch)
tree98ced765dc3d16c85315c1f8f1398157efc7acc4
parent38dbfb59d1175ef458d006556061adeaa8751b72 (diff)
ARM: pxa: add gpio keys information
Switching from corgikbd to matrixkbd corgi has lost support for few switches. Readd them through gpio-keys-polled device (-polled, since scoop does not provide IRQ for GPIO). Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>
-rw-r--r--arch/arm/mach-pxa/corgi.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c
index f162f1b77cd2..57d60542f982 100644
--- a/arch/arm/mach-pxa/corgi.c
+++ b/arch/arm/mach-pxa/corgi.c
@@ -32,6 +32,7 @@
32#include <linux/spi/pxa2xx_spi.h> 32#include <linux/spi/pxa2xx_spi.h>
33#include <linux/mtd/sharpsl.h> 33#include <linux/mtd/sharpsl.h>
34#include <linux/input/matrix_keypad.h> 34#include <linux/input/matrix_keypad.h>
35#include <linux/gpio_keys.h>
35#include <linux/module.h> 36#include <linux/module.h>
36#include <video/w100fb.h> 37#include <video/w100fb.h>
37 38
@@ -405,6 +406,44 @@ static struct platform_device corgikbd_device = {
405 }, 406 },
406}; 407};
407 408
409static struct gpio_keys_button corgi_gpio_keys[] = {
410 {
411 .type = EV_SW,
412 .code = SW_LID,
413 .gpio = CORGI_GPIO_SWA,
414 .desc = "Lid close switch",
415 .debounce_interval = 500,
416 },
417 {
418 .type = EV_SW,
419 .code = SW_TABLET_MODE,
420 .gpio = CORGI_GPIO_SWB,
421 .desc = "Tablet mode switch",
422 .debounce_interval = 500,
423 },
424 {
425 .type = EV_SW,
426 .code = SW_HEADPHONE_INSERT,
427 .gpio = CORGI_GPIO_AK_INT,
428 .desc = "HeadPhone insert",
429 .debounce_interval = 500,
430 },
431};
432
433static struct gpio_keys_platform_data corgi_gpio_keys_platform_data = {
434 .buttons = corgi_gpio_keys,
435 .nbuttons = ARRAY_SIZE(corgi_gpio_keys),
436 .poll_interval = 250,
437};
438
439static struct platform_device corgi_gpio_keys_device = {
440 .name = "gpio-keys-polled",
441 .id = -1,
442 .dev = {
443 .platform_data = &corgi_gpio_keys_platform_data,
444 },
445};
446
408/* 447/*
409 * Corgi LEDs 448 * Corgi LEDs
410 */ 449 */
@@ -646,6 +685,7 @@ static struct platform_device sharpsl_rom_device = {
646static struct platform_device *devices[] __initdata = { 685static struct platform_device *devices[] __initdata = {
647 &corgiscoop_device, 686 &corgiscoop_device,
648 &corgifb_device, 687 &corgifb_device,
688 &corgi_gpio_keys_device,
649 &corgikbd_device, 689 &corgikbd_device,
650 &corgiled_device, 690 &corgiled_device,
651 &corgi_audio_device, 691 &corgi_audio_device,