tavorevb3.c 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. /*
  2. * linux/arch/arm/mach-pxa/tavorevb3.c
  3. *
  4. * Support for the Marvell EVB3 Development Platform.
  5. *
  6. * Copyright: (C) Copyright 2008-2010 Marvell International Ltd.
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * publishhed by the Free Software Foundation.
  11. */
  12. #include <linux/init.h>
  13. #include <linux/kernel.h>
  14. #include <linux/platform_device.h>
  15. #include <linux/interrupt.h>
  16. #include <linux/i2c.h>
  17. #include <linux/i2c/pxa-i2c.h>
  18. #include <linux/gpio.h>
  19. #include <linux/mfd/88pm860x.h>
  20. #include <asm/mach-types.h>
  21. #include <asm/mach/arch.h>
  22. #include <mach/pxa930.h>
  23. #include "devices.h"
  24. #include "generic.h"
  25. #define TAVOREVB3_NR_IRQS (IRQ_BOARD_START + 24)
  26. static mfp_cfg_t evb3_mfp_cfg[] __initdata = {
  27. /* UART */
  28. GPIO53_UART1_TXD,
  29. GPIO54_UART1_RXD,
  30. /* PMIC */
  31. PMIC_INT_GPIO83,
  32. };
  33. #if defined(CONFIG_I2C_PXA) || defined(CONFIG_I2C_PXA_MODULE)
  34. static struct pm860x_touch_pdata evb3_touch = {
  35. .gpadc_prebias = 1,
  36. .slot_cycle = 1,
  37. .tsi_prebias = 6,
  38. .pen_prebias = 16,
  39. .pen_prechg = 2,
  40. .res_x = 300,
  41. };
  42. static struct pm860x_backlight_pdata evb3_backlight[] = {
  43. {
  44. .id = PM8606_ID_BACKLIGHT,
  45. .iset = PM8606_WLED_CURRENT(24),
  46. .flags = PM8606_BACKLIGHT1,
  47. },
  48. {},
  49. };
  50. static struct pm860x_led_pdata evb3_led[] = {
  51. {
  52. .id = PM8606_ID_LED,
  53. .iset = PM8606_LED_CURRENT(12),
  54. .flags = PM8606_LED1_RED,
  55. }, {
  56. .id = PM8606_ID_LED,
  57. .iset = PM8606_LED_CURRENT(12),
  58. .flags = PM8606_LED1_GREEN,
  59. }, {
  60. .id = PM8606_ID_LED,
  61. .iset = PM8606_LED_CURRENT(12),
  62. .flags = PM8606_LED1_BLUE,
  63. }, {
  64. .id = PM8606_ID_LED,
  65. .iset = PM8606_LED_CURRENT(12),
  66. .flags = PM8606_LED2_RED,
  67. }, {
  68. .id = PM8606_ID_LED,
  69. .iset = PM8606_LED_CURRENT(12),
  70. .flags = PM8606_LED2_GREEN,
  71. }, {
  72. .id = PM8606_ID_LED,
  73. .iset = PM8606_LED_CURRENT(12),
  74. .flags = PM8606_LED2_BLUE,
  75. },
  76. };
  77. static struct pm860x_platform_data evb3_pm8607_info = {
  78. .touch = &evb3_touch,
  79. .backlight = &evb3_backlight[0],
  80. .led = &evb3_led[0],
  81. .companion_addr = 0x10,
  82. .irq_mode = 0,
  83. .irq_base = IRQ_BOARD_START,
  84. .i2c_port = GI2C_PORT,
  85. };
  86. static struct i2c_board_info evb3_i2c_info[] = {
  87. {
  88. .type = "88PM860x",
  89. .addr = 0x34,
  90. .platform_data = &evb3_pm8607_info,
  91. .irq = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO83)),
  92. },
  93. };
  94. static void __init evb3_init_i2c(void)
  95. {
  96. pxa_set_i2c_info(NULL);
  97. i2c_register_board_info(0, ARRAY_AND_SIZE(evb3_i2c_info));
  98. }
  99. #else
  100. static inline void evb3_init_i2c(void) {}
  101. #endif
  102. static void __init evb3_init(void)
  103. {
  104. /* initialize MFP configurations */
  105. pxa3xx_mfp_config(ARRAY_AND_SIZE(evb3_mfp_cfg));
  106. pxa_set_ffuart_info(NULL);
  107. evb3_init_i2c();
  108. }
  109. MACHINE_START(TAVOREVB3, "PXA950 Evaluation Board (aka TavorEVB3)")
  110. .boot_params = 0xa0000100,
  111. .map_io = pxa3xx_map_io,
  112. .nr_irqs = TAVOREVB3_NR_IRQS,
  113. .init_irq = pxa3xx_init_irq,
  114. .handle_irq = pxa3xx_handle_irq,
  115. .timer = &pxa_timer,
  116. .init_machine = evb3_init,
  117. MACHINE_END