teton_bga.c 2.5 KB

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