diff options
author | Sundar Iyer <sundar.iyer@stericsson.com> | 2010-12-03 20:35:38 +0530 |
---|---|---|
committer | Linus Walleij <linus.walleij@stericsson.com> | 2010-12-19 20:54:55 +0100 |
commit | 556fb03869ad4d14e5336093a7a8565456a26c21 (patch) | |
tree | c101cd16bcf442a82d2b5246b0c5409cd1b55313 /arch/arm/mach-ux500 | |
parent | e43abe6f98641e40460d74a002f09c7751db48f9 (diff) | |
download | kernel_samsung_aries-556fb03869ad4d14e5336093a7a8565456a26c21.zip kernel_samsung_aries-556fb03869ad4d14e5336093a7a8565456a26c21.tar.gz kernel_samsung_aries-556fb03869ad4d14e5336093a7a8565456a26c21.tar.bz2 |
mach-ux500: add STMPE1601 platform data
Signed-off-by: Sundar Iyer <sundar.iyer@stericsson.com>
[Minor fixups to GPIO enumerators]
Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Diffstat (limited to 'arch/arm/mach-ux500')
-rw-r--r-- | arch/arm/mach-ux500/board-mop500-keypads.c | 32 | ||||
-rw-r--r-- | arch/arm/mach-ux500/board-mop500.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-ux500/include/mach/irqs-board-mop500.h | 13 |
3 files changed, 49 insertions, 2 deletions
diff --git a/arch/arm/mach-ux500/board-mop500-keypads.c b/arch/arm/mach-ux500/board-mop500-keypads.c index b634615..8dbba03 100644 --- a/arch/arm/mach-ux500/board-mop500-keypads.c +++ b/arch/arm/mach-ux500/board-mop500-keypads.c @@ -128,7 +128,39 @@ static struct ske_keypad_platform_data ske_keypad_board = { .debounce_ms = 40, /* in millisecs */ }; +/* + * STMPE1601 + */ +static struct stmpe_keypad_platform_data stmpe1601_keypad_data = { + .debounce_ms = 64, + .scan_count = 8, + .no_autorepeat = true, + .keymap_data = &mop500_keymap_data, +}; + +static struct stmpe_platform_data stmpe1601_data = { + .id = 1, + .blocks = STMPE_BLOCK_KEYPAD, + .irq_trigger = IRQF_TRIGGER_FALLING, + .irq_base = MOP500_STMPE1601_IRQ(0), + .keypad = &stmpe1601_keypad_data, + .autosleep = true, + .autosleep_timeout = 1024, +}; + +static struct i2c_board_info __initdata mop500_i2c0_devices_stuib[] = { + { + I2C_BOARD_INFO("stmpe1601", 0x40), + .irq = NOMADIK_GPIO_TO_IRQ(218), + .platform_data = &stmpe1601_data, + .flags = I2C_CLIENT_WAKE, + }, +}; + void mop500_keypad_init(void) { db8500_add_ske_keypad(&ske_keypad_board); + + i2c_register_board_info(0, mop500_i2c0_devices_stuib, + ARRAY_SIZE(mop500_i2c0_devices_stuib)); } diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index 0bc0aa3..a1c9ea1 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c @@ -71,7 +71,11 @@ static pin_cfg_t mop500_pins[] = { GPIO167_KP_O1, GPIO168_KP_O0, - GPIO217_GPIO, /* GPIO_EXP_INT */ + /* GPIO_EXP_INT */ + GPIO217_GPIO, + + /* STMPE1601 IRQ */ + GPIO218_GPIO | PIN_INPUT_PULLUP, }; static struct ab8500_platform_data ab8500_platdata = { diff --git a/arch/arm/mach-ux500/include/mach/irqs-board-mop500.h b/arch/arm/mach-ux500/include/mach/irqs-board-mop500.h index 4a91bbd..7cdeb2a 100644 --- a/arch/arm/mach-ux500/include/mach/irqs-board-mop500.h +++ b/arch/arm/mach-ux500/include/mach/irqs-board-mop500.h @@ -15,6 +15,7 @@ #define MOP500_AB8500_IRQ_END (MOP500_AB8500_IRQ_BASE \ + AB8500_NR_IRQS) +/* TC35892 */ #define TC35892_NR_INTERNAL_IRQS 8 #define TC35892_INT_GPIO(x) (TC35892_NR_INTERNAL_IRQS + (x)) #define TC35892_NR_GPIOS 24 @@ -25,8 +26,18 @@ #define MOP500_EGPIO_IRQ_BASE MOP500_AB8500_IRQ_END #define MOP500_EGPIO_IRQ_END (MOP500_EGPIO_IRQ_BASE \ + MOP500_EGPIO_NR_IRQS) +/* STMPE1601 irqs */ +#define STMPE_NR_INTERNAL_IRQS 9 +#define STMPE_INT_GPIO(x) (STMPE_NR_INTERNAL_IRQS + (x)) +#define STMPE_NR_GPIOS 24 +#define STMPE_NR_IRQS STMPE_INT_GPIO(STMPE_NR_GPIOS) -#define MOP500_IRQ_END MOP500_EGPIO_IRQ_END +#define MOP500_STMPE1601_IRQBASE MOP500_EGPIO_IRQ_END +#define MOP500_STMPE1601_IRQ(x) (MOP500_STMPE1601_IRQBASE + (x)) + +#define MOP500_NR_IRQS MOP500_STMPE1601_IRQ(STMPE_NR_INTERNAL_IRQS) + +#define MOP500_IRQ_END MOP500_NR_IRQS #if MOP500_IRQ_END > IRQ_BOARD_END #undef IRQ_BOARD_END |