Merge tag 'locking-urgent-2020-12-27' of git://git.kernel.org/pub/scm/linux/kernel...
[linux/fpc-iii.git] / arch / arm / mach-mmp / teton_bga.c
blob7111535f325f26f66751b60897878bcfe717649d
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3 * linux/arch/arm/mach-mmp/teton_bga.c
5 * Support for the Marvell PXA168 Teton BGA Development Platform.
7 * Author: Mark F. Brown <mark.brown314@gmail.com>
9 * This code is based on aspenite.c
12 #include <linux/init.h>
13 #include <linux/kernel.h>
14 #include <linux/platform_device.h>
15 #include <linux/gpio.h>
16 #include <linux/gpio-pxa.h>
17 #include <linux/input.h>
18 #include <linux/platform_data/keypad-pxa27x.h>
19 #include <linux/i2c.h>
21 #include <asm/mach-types.h>
22 #include <asm/mach/arch.h>
23 #include "addr-map.h"
24 #include "mfp-pxa168.h"
25 #include "pxa168.h"
26 #include "teton_bga.h"
27 #include "irqs.h"
29 #include "common.h"
31 static unsigned long teton_bga_pin_config[] __initdata = {
32 /* UART1 */
33 GPIO107_UART1_TXD,
34 GPIO108_UART1_RXD,
36 /* Keypad */
37 GPIO109_KP_MKIN1,
38 GPIO110_KP_MKIN0,
39 GPIO111_KP_MKOUT7,
40 GPIO112_KP_MKOUT6,
42 /* I2C Bus */
43 GPIO105_CI2C_SDA,
44 GPIO106_CI2C_SCL,
46 /* RTC */
47 GPIO78_GPIO,
50 static struct pxa_gpio_platform_data pxa168_gpio_pdata = {
51 .irq_base = MMP_GPIO_TO_IRQ(0),
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),
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),
66 static struct pxa27x_keypad_platform_data teton_bga_keypad_info __initdata = {
67 .matrix_key_rows = 2,
68 .matrix_key_cols = 8,
69 .matrix_keymap_data = &teton_bga_matrix_keymap_data,
70 .debounce_interval = 30,
73 static struct i2c_board_info teton_bga_i2c_info[] __initdata = {
75 I2C_BOARD_INFO("ds1337", 0x68),
76 .irq = MMP_GPIO_TO_IRQ(RTC_INT_GPIO)
80 static void __init teton_bga_init(void)
82 mfp_config(ARRAY_AND_SIZE(teton_bga_pin_config));
84 /* on-chip devices */
85 pxa168_add_uart(1);
86 pxa168_add_keypad(&teton_bga_keypad_info);
87 pxa168_add_twsi(0, NULL, ARRAY_AND_SIZE(teton_bga_i2c_info));
88 platform_device_add_data(&pxa168_device_gpio, &pxa168_gpio_pdata,
89 sizeof(struct pxa_gpio_platform_data));
90 platform_device_register(&pxa168_device_gpio);
93 MACHINE_START(TETON_BGA, "PXA168-based Teton BGA Development Platform")
94 .map_io = mmp_map_io,
95 .nr_irqs = MMP_NR_IRQS,
96 .init_irq = pxa168_init_irq,
97 .init_time = pxa168_timer_init,
98 .init_machine = teton_bga_init,
99 .restart = pxa168_restart,
100 MACHINE_END