Commit | Line | Data |
---|---|---|
1bbd7089 MB |
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> | |
b8f649f1 | 19 | #include <linux/gpio-pxa.h> |
d2ce6973 | 20 | #include <linux/input.h> |
293b2da1 | 21 | #include <linux/platform_data/keypad-pxa27x.h> |
759305c6 | 22 | #include <linux/i2c.h> |
1bbd7089 MB |
23 | |
24 | #include <asm/mach-types.h> | |
25 | #include <asm/mach/arch.h> | |
b501fd7b AB |
26 | #include "addr-map.h" |
27 | #include "mfp-pxa168.h" | |
28 | #include "pxa168.h" | |
29 | #include "teton_bga.h" | |
30 | #include "irqs.h" | |
1bbd7089 MB |
31 | |
32 | #include "common.h" | |
33 | ||
34 | static unsigned long teton_bga_pin_config[] __initdata = { | |
35 | /* UART1 */ | |
36 | GPIO107_UART1_TXD, | |
37 | GPIO108_UART1_RXD, | |
d2ce6973 MB |
38 | |
39 | /* Keypad */ | |
40 | GPIO109_KP_MKIN1, | |
41 | GPIO110_KP_MKIN0, | |
42 | GPIO111_KP_MKOUT7, | |
43 | GPIO112_KP_MKOUT6, | |
759305c6 MB |
44 | |
45 | /* I2C Bus */ | |
46 | GPIO105_CI2C_SDA, | |
47 | GPIO106_CI2C_SCL, | |
48 | ||
49 | /* RTC */ | |
50 | GPIO78_GPIO, | |
d2ce6973 MB |
51 | }; |
52 | ||
b8f649f1 HZ |
53 | static struct pxa_gpio_platform_data pxa168_gpio_pdata = { |
54 | .irq_base = MMP_GPIO_TO_IRQ(0), | |
55 | }; | |
56 | ||
d2ce6973 MB |
57 | static unsigned int teton_bga_matrix_key_map[] = { |
58 | KEY(0, 6, KEY_ESC), | |
59 | KEY(0, 7, KEY_ENTER), | |
60 | KEY(1, 6, KEY_LEFT), | |
61 | KEY(1, 7, KEY_RIGHT), | |
62 | }; | |
63 | ||
0a085a94 CX |
64 | static struct matrix_keymap_data teton_bga_matrix_keymap_data = { |
65 | .keymap = teton_bga_matrix_key_map, | |
66 | .keymap_size = ARRAY_SIZE(teton_bga_matrix_key_map), | |
67 | }; | |
68 | ||
d2ce6973 MB |
69 | static struct pxa27x_keypad_platform_data teton_bga_keypad_info __initdata = { |
70 | .matrix_key_rows = 2, | |
71 | .matrix_key_cols = 8, | |
0a085a94 | 72 | .matrix_keymap_data = &teton_bga_matrix_keymap_data, |
d2ce6973 | 73 | .debounce_interval = 30, |
1bbd7089 MB |
74 | }; |
75 | ||
759305c6 MB |
76 | static struct i2c_board_info teton_bga_i2c_info[] __initdata = { |
77 | { | |
78 | I2C_BOARD_INFO("ds1337", 0x68), | |
4929f5a8 | 79 | .irq = MMP_GPIO_TO_IRQ(RTC_INT_GPIO) |
759305c6 MB |
80 | }, |
81 | }; | |
82 | ||
1bbd7089 MB |
83 | static void __init teton_bga_init(void) |
84 | { | |
85 | mfp_config(ARRAY_AND_SIZE(teton_bga_pin_config)); | |
86 | ||
87 | /* on-chip devices */ | |
88 | pxa168_add_uart(1); | |
d2ce6973 | 89 | pxa168_add_keypad(&teton_bga_keypad_info); |
759305c6 | 90 | pxa168_add_twsi(0, NULL, ARRAY_AND_SIZE(teton_bga_i2c_info)); |
b8f649f1 HZ |
91 | platform_device_add_data(&pxa168_device_gpio, &pxa168_gpio_pdata, |
92 | sizeof(struct pxa_gpio_platform_data)); | |
157d2644 | 93 | platform_device_register(&pxa168_device_gpio); |
1bbd7089 MB |
94 | } |
95 | ||
96 | MACHINE_START(TETON_BGA, "PXA168-based Teton BGA Development Platform") | |
1bbd7089 | 97 | .map_io = mmp_map_io, |
8661fb92 | 98 | .nr_irqs = MMP_NR_IRQS, |
1bbd7089 | 99 | .init_irq = pxa168_init_irq, |
6bb27d73 | 100 | .init_time = pxa168_timer_init, |
1bbd7089 | 101 | .init_machine = teton_bga_init, |
9854a38e | 102 | .restart = pxa168_restart, |
1bbd7089 | 103 | MACHINE_END |