board-mop500-u8500uib.c 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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/gpio.h>
  8. #include <linux/kernel.h>
  9. #include <linux/init.h>
  10. #include <linux/i2c.h>
  11. #include <linux/interrupt.h>
  12. #include <linux/mfd/tc3589x.h>
  13. #include <linux/input/matrix_keypad.h>
  14. #include "irqs.h"
  15. #include "board-mop500.h"
  16. static struct i2c_board_info __initdata mop500_i2c3_devices_u8500[] = {
  17. {
  18. I2C_BOARD_INFO("synaptics_rmi4_i2c", 0x4B),
  19. .irq = NOMADIK_GPIO_TO_IRQ(84),
  20. },
  21. };
  22. /*
  23. * TC35893
  24. */
  25. static const unsigned int u8500_keymap[] = {
  26. KEY(3, 1, KEY_END),
  27. KEY(4, 1, KEY_POWER),
  28. KEY(6, 4, KEY_VOLUMEDOWN),
  29. KEY(4, 2, KEY_EMAIL),
  30. KEY(3, 3, KEY_RIGHT),
  31. KEY(2, 5, KEY_BACKSPACE),
  32. KEY(6, 7, KEY_MENU),
  33. KEY(5, 0, KEY_ENTER),
  34. KEY(4, 3, KEY_0),
  35. KEY(3, 4, KEY_DOT),
  36. KEY(5, 2, KEY_UP),
  37. KEY(3, 5, KEY_DOWN),
  38. KEY(4, 5, KEY_SEND),
  39. KEY(0, 5, KEY_BACK),
  40. KEY(6, 2, KEY_VOLUMEUP),
  41. KEY(1, 3, KEY_SPACE),
  42. KEY(7, 6, KEY_LEFT),
  43. KEY(5, 5, KEY_SEARCH),
  44. };
  45. static struct matrix_keymap_data u8500_keymap_data = {
  46. .keymap = u8500_keymap,
  47. .keymap_size = ARRAY_SIZE(u8500_keymap),
  48. };
  49. static struct tc3589x_keypad_platform_data tc35893_data = {
  50. .krow = TC_KPD_ROWS,
  51. .kcol = TC_KPD_COLUMNS,
  52. .debounce_period = TC_KPD_DEBOUNCE_PERIOD,
  53. .settle_time = TC_KPD_SETTLE_TIME,
  54. .irqtype = IRQF_TRIGGER_FALLING,
  55. .enable_wakeup = true,
  56. .keymap_data = &u8500_keymap_data,
  57. .no_autorepeat = true,
  58. };
  59. static struct tc3589x_platform_data tc3589x_keypad_data = {
  60. .block = TC3589x_BLOCK_KEYPAD,
  61. .keypad = &tc35893_data,
  62. .irq_base = MOP500_EGPIO_IRQ_BASE,
  63. };
  64. static struct i2c_board_info __initdata mop500_i2c0_devices_u8500[] = {
  65. {
  66. I2C_BOARD_INFO("tc3589x", 0x44),
  67. .platform_data = &tc3589x_keypad_data,
  68. .irq = NOMADIK_GPIO_TO_IRQ(218),
  69. .flags = I2C_CLIENT_WAKE,
  70. },
  71. };
  72. void __init mop500_u8500uib_init(void)
  73. {
  74. mop500_uib_i2c_add(3, mop500_i2c3_devices_u8500,
  75. ARRAY_SIZE(mop500_i2c3_devices_u8500));
  76. mop500_uib_i2c_add(0, mop500_i2c0_devices_u8500,
  77. ARRAY_SIZE(mop500_i2c0_devices_u8500));
  78. }