teton_bga.c 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. // SPDX-License-Identifier: GPL-2.0-only
  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 <[email protected]>
  8. *
  9. * This code is based on aspenite.c
  10. */
  11. #include <linux/init.h>
  12. #include <linux/kernel.h>
  13. #include <linux/platform_device.h>
  14. #include <linux/gpio.h>
  15. #include <linux/gpio-pxa.h>
  16. #include <linux/input.h>
  17. #include <linux/platform_data/keypad-pxa27x.h>
  18. #include <linux/i2c.h>
  19. #include <asm/mach-types.h>
  20. #include <asm/mach/arch.h>
  21. #include "addr-map.h"
  22. #include "mfp-pxa168.h"
  23. #include "pxa168.h"
  24. #include "teton_bga.h"
  25. #include "irqs.h"
  26. #include "common.h"
  27. static unsigned long teton_bga_pin_config[] __initdata = {
  28. /* UART1 */
  29. GPIO107_UART1_TXD,
  30. GPIO108_UART1_RXD,
  31. /* Keypad */
  32. GPIO109_KP_MKIN1,
  33. GPIO110_KP_MKIN0,
  34. GPIO111_KP_MKOUT7,
  35. GPIO112_KP_MKOUT6,
  36. /* I2C Bus */
  37. GPIO105_CI2C_SDA,
  38. GPIO106_CI2C_SCL,
  39. /* RTC */
  40. GPIO78_GPIO,
  41. };
  42. static struct pxa_gpio_platform_data pxa168_gpio_pdata = {
  43. .irq_base = MMP_GPIO_TO_IRQ(0),
  44. };
  45. static unsigned int teton_bga_matrix_key_map[] = {
  46. KEY(0, 6, KEY_ESC),
  47. KEY(0, 7, KEY_ENTER),
  48. KEY(1, 6, KEY_LEFT),
  49. KEY(1, 7, KEY_RIGHT),
  50. };
  51. static struct matrix_keymap_data teton_bga_matrix_keymap_data = {
  52. .keymap = teton_bga_matrix_key_map,
  53. .keymap_size = ARRAY_SIZE(teton_bga_matrix_key_map),
  54. };
  55. static struct pxa27x_keypad_platform_data teton_bga_keypad_info __initdata = {
  56. .matrix_key_rows = 2,
  57. .matrix_key_cols = 8,
  58. .matrix_keymap_data = &teton_bga_matrix_keymap_data,
  59. .debounce_interval = 30,
  60. };
  61. static struct i2c_board_info teton_bga_i2c_info[] __initdata = {
  62. {
  63. I2C_BOARD_INFO("ds1337", 0x68),
  64. .irq = MMP_GPIO_TO_IRQ(RTC_INT_GPIO)
  65. },
  66. };
  67. static void __init teton_bga_init(void)
  68. {
  69. mfp_config(ARRAY_AND_SIZE(teton_bga_pin_config));
  70. /* on-chip devices */
  71. pxa168_add_uart(1);
  72. pxa168_add_keypad(&teton_bga_keypad_info);
  73. pxa168_add_twsi(0, NULL, ARRAY_AND_SIZE(teton_bga_i2c_info));
  74. platform_device_add_data(&pxa168_device_gpio, &pxa168_gpio_pdata,
  75. sizeof(struct pxa_gpio_platform_data));
  76. platform_device_register(&pxa168_device_gpio);
  77. }
  78. MACHINE_START(TETON_BGA, "PXA168-based Teton BGA Development Platform")
  79. .map_io = mmp_map_io,
  80. .nr_irqs = MMP_NR_IRQS,
  81. .init_irq = pxa168_init_irq,
  82. .init_time = pxa168_timer_init,
  83. .init_machine = teton_bga_init,
  84. .restart = pxa168_restart,
  85. MACHINE_END