Mark F. Brown | 1bbd708 | 2010-09-12 23:51:34 -0400 | [diff] [blame] | 1 | /* |
| 2 | * linux/arch/arm/mach-mmp/teton_bga.c |
| 3 | * |
| 4 | * Support for the Marvell PXA168 Teton BGA Development Platform. |
| 5 | * |
| 6 | * Author: Mark F. Brown <mark.brown314@gmail.com> |
| 7 | * |
| 8 | * This code is based on aspenite.c |
| 9 | * |
| 10 | * This program is free software; you can redistribute it and/or modify |
| 11 | * it under the terms of the GNU General Public License version 2 as |
| 12 | * publishhed by the Free Software Foundation. |
| 13 | */ |
| 14 | |
| 15 | #include <linux/init.h> |
| 16 | #include <linux/kernel.h> |
| 17 | #include <linux/platform_device.h> |
| 18 | #include <linux/gpio.h> |
Mark F. Brown | d2ce697 | 2010-09-12 23:51:35 -0400 | [diff] [blame^] | 19 | #include <linux/input.h> |
| 20 | #include <plat/pxa27x_keypad.h> |
Mark F. Brown | 1bbd708 | 2010-09-12 23:51:34 -0400 | [diff] [blame] | 21 | |
| 22 | #include <asm/mach-types.h> |
| 23 | #include <asm/mach/arch.h> |
| 24 | #include <mach/addr-map.h> |
| 25 | #include <mach/mfp-pxa168.h> |
| 26 | #include <mach/pxa168.h> |
| 27 | #include <mach/teton_bga.h> |
| 28 | |
| 29 | #include "common.h" |
| 30 | |
| 31 | static unsigned long teton_bga_pin_config[] __initdata = { |
| 32 | /* UART1 */ |
| 33 | GPIO107_UART1_TXD, |
| 34 | GPIO108_UART1_RXD, |
Mark F. Brown | d2ce697 | 2010-09-12 23:51:35 -0400 | [diff] [blame^] | 35 | |
| 36 | /* Keypad */ |
| 37 | GPIO109_KP_MKIN1, |
| 38 | GPIO110_KP_MKIN0, |
| 39 | GPIO111_KP_MKOUT7, |
| 40 | GPIO112_KP_MKOUT6, |
| 41 | }; |
| 42 | |
| 43 | static unsigned int teton_bga_matrix_key_map[] = { |
| 44 | KEY(0, 6, KEY_ESC), |
| 45 | KEY(0, 7, KEY_ENTER), |
| 46 | KEY(1, 6, KEY_LEFT), |
| 47 | KEY(1, 7, KEY_RIGHT), |
| 48 | }; |
| 49 | |
| 50 | static struct pxa27x_keypad_platform_data teton_bga_keypad_info __initdata = { |
| 51 | .matrix_key_rows = 2, |
| 52 | .matrix_key_cols = 8, |
| 53 | .matrix_key_map = teton_bga_matrix_key_map, |
| 54 | .matrix_key_map_size = ARRAY_SIZE(teton_bga_matrix_key_map), |
| 55 | .debounce_interval = 30, |
Mark F. Brown | 1bbd708 | 2010-09-12 23:51:34 -0400 | [diff] [blame] | 56 | }; |
| 57 | |
| 58 | static void __init teton_bga_init(void) |
| 59 | { |
| 60 | mfp_config(ARRAY_AND_SIZE(teton_bga_pin_config)); |
| 61 | |
| 62 | /* on-chip devices */ |
| 63 | pxa168_add_uart(1); |
Mark F. Brown | d2ce697 | 2010-09-12 23:51:35 -0400 | [diff] [blame^] | 64 | pxa168_add_keypad(&teton_bga_keypad_info); |
Mark F. Brown | 1bbd708 | 2010-09-12 23:51:34 -0400 | [diff] [blame] | 65 | } |
| 66 | |
| 67 | MACHINE_START(TETON_BGA, "PXA168-based Teton BGA Development Platform") |
| 68 | .phys_io = APB_PHYS_BASE, |
| 69 | .io_pg_offst = (APB_VIRT_BASE >> 18) & 0xfffc, |
| 70 | .map_io = mmp_map_io, |
| 71 | .nr_irqs = IRQ_BOARD_START, |
| 72 | .init_irq = pxa168_init_irq, |
| 73 | .timer = &pxa168_timer, |
| 74 | .init_machine = teton_bga_init, |
| 75 | MACHINE_END |