board-mop500-u8500uib.c 2.1 KB

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