board-mop500-u8500uib.c 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /*
  2. * Copyright (C) ST-Ericsson SA 2010
  3. *
  4. * Board data for the U8500 UIB, also known as the New UIB
  5. * License terms: GNU General Public License (GPL), version 2
  6. */
  7. #include <linux/kernel.h>
  8. #include <linux/init.h>
  9. #include <linux/i2c.h>
  10. #include <linux/gpio.h>
  11. #include <linux/interrupt.h>
  12. #include <linux/mfd/tc3589x.h>
  13. #include <linux/input/matrix_keypad.h>
  14. #include <../drivers/staging/ste_rmi4/synaptics_i2c_rmi4.h>
  15. #include <mach/gpio.h>
  16. #include <mach/irqs.h>
  17. #include "board-mop500.h"
  18. /*
  19. * Synaptics RMI4 touchscreen interface on the U8500 UIB
  20. */
  21. /*
  22. * Descriptor structure.
  23. * Describes the number of i2c devices on the bus that speak RMI.
  24. */
  25. static struct synaptics_rmi4_platform_data rmi4_i2c_dev_platformdata = {
  26. .irq_number = NOMADIK_GPIO_TO_IRQ(84),
  27. .irq_type = (IRQF_TRIGGER_FALLING | IRQF_SHARED),
  28. .x_flip = false,
  29. .y_flip = true,
  30. .regulator_en = false,
  31. };
  32. static struct i2c_board_info __initdata mop500_i2c3_devices_u8500[] = {
  33. {
  34. I2C_BOARD_INFO("synaptics_rmi4_i2c", 0x4B),
  35. .platform_data = &rmi4_i2c_dev_platformdata,
  36. },
  37. };
  38. /*
  39. * TC35893
  40. */
  41. static const unsigned int u8500_keymap[] = {
  42. KEY(3, 1, KEY_END),
  43. KEY(4, 1, KEY_POWER),
  44. KEY(6, 4, KEY_VOLUMEDOWN),
  45. KEY(4, 2, KEY_EMAIL),
  46. KEY(3, 3, KEY_RIGHT),
  47. KEY(2, 5, KEY_BACKSPACE),
  48. KEY(6, 7, KEY_MENU),
  49. KEY(5, 0, KEY_ENTER),
  50. KEY(4, 3, KEY_0),
  51. KEY(3, 4, KEY_DOT),
  52. KEY(5, 2, KEY_UP),
  53. KEY(3, 5, KEY_DOWN),
  54. KEY(4, 5, KEY_SEND),
  55. KEY(0, 5, KEY_BACK),
  56. KEY(6, 2, KEY_VOLUMEUP),
  57. KEY(1, 3, KEY_SPACE),
  58. KEY(7, 6, KEY_LEFT),
  59. KEY(5, 5, KEY_SEARCH),
  60. };
  61. static struct matrix_keymap_data u8500_keymap_data = {
  62. .keymap = u8500_keymap,
  63. .keymap_size = ARRAY_SIZE(u8500_keymap),
  64. };
  65. static struct tc3589x_keypad_platform_data tc35893_data = {
  66. .krow = TC_KPD_ROWS,
  67. .kcol = TC_KPD_COLUMNS,
  68. .debounce_period = TC_KPD_DEBOUNCE_PERIOD,
  69. .settle_time = TC_KPD_SETTLE_TIME,
  70. .irqtype = IRQF_TRIGGER_FALLING,
  71. .enable_wakeup = true,
  72. .keymap_data = &u8500_keymap_data,
  73. .no_autorepeat = true,
  74. };
  75. static struct tc3589x_platform_data tc3589x_keypad_data = {
  76. .block = TC3589x_BLOCK_KEYPAD,
  77. .keypad = &tc35893_data,
  78. .irq_base = MOP500_EGPIO_IRQ_BASE,
  79. };
  80. static struct i2c_board_info __initdata mop500_i2c0_devices_u8500[] = {
  81. {
  82. I2C_BOARD_INFO("tc3589x", 0x44),
  83. .platform_data = &tc3589x_keypad_data,
  84. .irq = NOMADIK_GPIO_TO_IRQ(218),
  85. .flags = I2C_CLIENT_WAKE,
  86. },
  87. };
  88. void __init mop500_u8500uib_init(void)
  89. {
  90. mop500_uib_i2c_add(3, mop500_i2c3_devices_u8500,
  91. ARRAY_SIZE(mop500_i2c3_devices_u8500));
  92. mop500_uib_i2c_add(0, mop500_i2c0_devices_u8500,
  93. ARRAY_SIZE(mop500_i2c0_devices_u8500));
  94. }