teton_bga.c 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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/input.h>
  19. #include <plat/pxa27x_keypad.h>
  20. #include <linux/i2c.h>
  21. #include <asm/mach-types.h>
  22. #include <asm/mach/arch.h>
  23. #include <mach/addr-map.h>
  24. #include <mach/mfp-pxa168.h>
  25. #include <mach/pxa168.h>
  26. #include <mach/teton_bga.h>
  27. #include "common.h"
  28. static unsigned long teton_bga_pin_config[] __initdata = {
  29. /* UART1 */
  30. GPIO107_UART1_TXD,
  31. GPIO108_UART1_RXD,
  32. /* Keypad */
  33. GPIO109_KP_MKIN1,
  34. GPIO110_KP_MKIN0,
  35. GPIO111_KP_MKOUT7,
  36. GPIO112_KP_MKOUT6,
  37. /* I2C Bus */
  38. GPIO105_CI2C_SDA,
  39. GPIO106_CI2C_SCL,
  40. /* RTC */
  41. GPIO78_GPIO,
  42. };
  43. static unsigned int teton_bga_matrix_key_map[] = {
  44. KEY(0, 6, KEY_ESC),
  45. KEY(0, 7, KEY_ENTER),
  46. KEY(1, 6, KEY_LEFT),
  47. KEY(1, 7, KEY_RIGHT),
  48. };
  49. static struct pxa27x_keypad_platform_data teton_bga_keypad_info __initdata = {
  50. .matrix_key_rows = 2,
  51. .matrix_key_cols = 8,
  52. .matrix_key_map = teton_bga_matrix_key_map,
  53. .matrix_key_map_size = ARRAY_SIZE(teton_bga_matrix_key_map),
  54. .debounce_interval = 30,
  55. };
  56. static struct i2c_board_info teton_bga_i2c_info[] __initdata = {
  57. {
  58. I2C_BOARD_INFO("ds1337", 0x68),
  59. .irq = gpio_to_irq(RTC_INT_GPIO)
  60. },
  61. };
  62. static void __init teton_bga_init(void)
  63. {
  64. mfp_config(ARRAY_AND_SIZE(teton_bga_pin_config));
  65. /* on-chip devices */
  66. pxa168_add_uart(1);
  67. pxa168_add_keypad(&teton_bga_keypad_info);
  68. pxa168_add_twsi(0, NULL, ARRAY_AND_SIZE(teton_bga_i2c_info));
  69. }
  70. MACHINE_START(TETON_BGA, "PXA168-based Teton BGA Development Platform")
  71. .map_io = mmp_map_io,
  72. .nr_irqs = IRQ_BOARD_START,
  73. .init_irq = pxa168_init_irq,
  74. .timer = &pxa168_timer,
  75. .init_machine = teton_bga_init,
  76. MACHINE_END