Commit | Line | Data |
---|---|---|
1d0ea069 | 1 | // SPDX-License-Identifier: GPL-2.0-only |
1bbd7089 MB |
2 | /* |
3 | * linux/arch/arm/mach-mmp/teton_bga.c | |
4 | * | |
5 | * Support for the Marvell PXA168 Teton BGA Development Platform. | |
6 | * | |
7 | * Author: Mark F. Brown <mark.brown314@gmail.com> | |
8 | * | |
9 | * This code is based on aspenite.c | |
1bbd7089 MB |
10 | */ |
11 | ||
12 | #include <linux/init.h> | |
13 | #include <linux/kernel.h> | |
14 | #include <linux/platform_device.h> | |
15 | #include <linux/gpio.h> | |
b8f649f1 | 16 | #include <linux/gpio-pxa.h> |
d2ce6973 | 17 | #include <linux/input.h> |
293b2da1 | 18 | #include <linux/platform_data/keypad-pxa27x.h> |
759305c6 | 19 | #include <linux/i2c.h> |
1bbd7089 MB |
20 | |
21 | #include <asm/mach-types.h> | |
22 | #include <asm/mach/arch.h> | |
b501fd7b AB |
23 | #include "addr-map.h" |
24 | #include "mfp-pxa168.h" | |
25 | #include "pxa168.h" | |
26 | #include "teton_bga.h" | |
27 | #include "irqs.h" | |
1bbd7089 MB |
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, | |
d2ce6973 MB |
35 | |
36 | /* Keypad */ | |
37 | GPIO109_KP_MKIN1, | |
38 | GPIO110_KP_MKIN0, | |
39 | GPIO111_KP_MKOUT7, | |
40 | GPIO112_KP_MKOUT6, | |
759305c6 MB |
41 | |
42 | /* I2C Bus */ | |
43 | GPIO105_CI2C_SDA, | |
44 | GPIO106_CI2C_SCL, | |
45 | ||
46 | /* RTC */ | |
47 | GPIO78_GPIO, | |
d2ce6973 MB |
48 | }; |
49 | ||
b8f649f1 HZ |
50 | static struct pxa_gpio_platform_data pxa168_gpio_pdata = { |
51 | .irq_base = MMP_GPIO_TO_IRQ(0), | |
52 | }; | |
53 | ||
d2ce6973 MB |
54 | static unsigned int teton_bga_matrix_key_map[] = { |
55 | KEY(0, 6, KEY_ESC), | |
56 | KEY(0, 7, KEY_ENTER), | |
57 | KEY(1, 6, KEY_LEFT), | |
58 | KEY(1, 7, KEY_RIGHT), | |
59 | }; | |
60 | ||
0a085a94 CX |
61 | static struct matrix_keymap_data teton_bga_matrix_keymap_data = { |
62 | .keymap = teton_bga_matrix_key_map, | |
63 | .keymap_size = ARRAY_SIZE(teton_bga_matrix_key_map), | |
64 | }; | |
65 | ||
d2ce6973 MB |
66 | static struct pxa27x_keypad_platform_data teton_bga_keypad_info __initdata = { |
67 | .matrix_key_rows = 2, | |
68 | .matrix_key_cols = 8, | |
0a085a94 | 69 | .matrix_keymap_data = &teton_bga_matrix_keymap_data, |
d2ce6973 | 70 | .debounce_interval = 30, |
1bbd7089 MB |
71 | }; |
72 | ||
759305c6 MB |
73 | static struct i2c_board_info teton_bga_i2c_info[] __initdata = { |
74 | { | |
75 | I2C_BOARD_INFO("ds1337", 0x68), | |
4929f5a8 | 76 | .irq = MMP_GPIO_TO_IRQ(RTC_INT_GPIO) |
759305c6 MB |
77 | }, |
78 | }; | |
79 | ||
1bbd7089 MB |
80 | static void __init teton_bga_init(void) |
81 | { | |
82 | mfp_config(ARRAY_AND_SIZE(teton_bga_pin_config)); | |
83 | ||
84 | /* on-chip devices */ | |
85 | pxa168_add_uart(1); | |
d2ce6973 | 86 | pxa168_add_keypad(&teton_bga_keypad_info); |
759305c6 | 87 | pxa168_add_twsi(0, NULL, ARRAY_AND_SIZE(teton_bga_i2c_info)); |
b8f649f1 HZ |
88 | platform_device_add_data(&pxa168_device_gpio, &pxa168_gpio_pdata, |
89 | sizeof(struct pxa_gpio_platform_data)); | |
157d2644 | 90 | platform_device_register(&pxa168_device_gpio); |
1bbd7089 MB |
91 | } |
92 | ||
93 | MACHINE_START(TETON_BGA, "PXA168-based Teton BGA Development Platform") | |
1bbd7089 | 94 | .map_io = mmp_map_io, |
8661fb92 | 95 | .nr_irqs = MMP_NR_IRQS, |
1bbd7089 | 96 | .init_irq = pxa168_init_irq, |
6bb27d73 | 97 | .init_time = pxa168_timer_init, |
1bbd7089 | 98 | .init_machine = teton_bga_init, |
9854a38e | 99 | .restart = pxa168_restart, |
1bbd7089 | 100 | MACHINE_END |