analysisDataOperation.c 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /*
  2. * linux/arch/arm/mach-omap2/board-am3517evm.c
  3. *
  4. * Copyright (C) 2009 Texas Instruments Incorporated
  5. * Author: Ranjith Lohithakshan <ranjithl@ti.com>
  6. *
  7. * Based on mach-omap2/board-omap3evm.c
  8. *
  9. * This program is free software; you can redistribute it and/or modify it
  10. * under the terms of the GNU General Public License as published by the
  11. * Free Software Foundation version 2.
  12. *
  13. * This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
  14. * whether express or implied; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * General Public License for more details.
  17. */
  18. #include <linux/kernel.h>
  19. #include <linux/init.h>
  20. #include <linux/clk.h>
  21. #include <linux/platform_device.h>
  22. #include <linux/gpio.h>
  23. #include <linux/i2c/pca953x.h>
  24. #include <linux/can/platform/ti_hecc.h>
  25. #include <linux/davinci_emac.h>
  26. #include <linux/mmc/host.h>
  27. #include <linux/usb/musb.h>
  28. #include <linux/platform_data/gpio-omap.h>
  29. #include "am35xx.h"
  30. #include <asm/mach-types.h>
  31. #include <asm/mach/arch.h>
  32. #include <asm/mach/map.h>
  33. #include "common.h"
  34. #include <video/omapdss.h>
  35. #include <video/omap-panel-generic-dpi.h>
  36. #include <video/omap-panel-tfp410.h>
  37. #include "am35xx-emac.h"
  38. #include "mux.h"
  39. #include "control.h"
  40. #include "hsmmc.h"
  41. #define LCD_PANEL_PWR 176
  42. #define LCD_PANEL_BKLIGHT_PWR 182
  43. #define LCD_PANEL_PWM 181
  44. static struct i2c_board_info __initdata am3517evm_i2c1_boardinfo[] = {
  45. {
  46. I2C_BOARD_INFO("s35390a", 0x30),
  47. },
  48. };
  49. /*
  50. * RTC - S35390A
  51. */
  52. #define GPIO_RTCS35390A_IRQ 55
  53. static void __init am3517_evm_rtc_init(void)
  54. {
  55. int r;
  56. omap_mux_init_gpio(GPIO_RTCS35390A_IRQ, OMAP_PIN_INPUT_PULLUP);
  57. r = gpio_request_one(GPIO_RTCS35390A_IRQ, GPIOF_IN, "rtcs35390a-irq");
  58. if (r < 0) {
  59. printk(KERN_WARNING "failed to request GPIO#%d\n",
  60. GPIO_RTCS35390A_IRQ);
  61. return;
  62. }
  63. am3517evm_i2c1_boardinfo[0].irq = gpio_to_irq(GPIO_RTCS35390A_IRQ);
  64. }
  65. /*
  66. * I2C GPIO Expander - TCA6416
  67. */
  68. /* Mounted on Base-Board */
  69. static struct pca953x_platform_data am3517evm_gpio_expander_info_0 = {
  70. .gpio_base = OMAP_MAX_GPIO_LINES,
  71. };
  72. static struct i2c_board_info __initdata am3517evm_i2c2_boardinfo[] = {
  73. {
  74. I2C_BOARD_INFO("tlv320aic23", 0x1A),
  75. },
  76. {
  77. I2C_BOARD_INFO("tca6416", 0x21),
  78. .platform_data = &am3517evm_gpio_expander_info_0,
  79. },
  80. };
  81. /* Mounted on UI Card */
  82. static struct pca953x_platform_data am3517evm_ui_gpio_expander_info_1 = {
  83. .gpio_base = OMAP_MAX_GPIO_LINES + 16,
  84. };
  85. static struct pca953x_platform_data am3517evm_ui_gpio_expander_info_2 = {
  86. .gpio_base = OMAP_MAX_GPIO_LINES + 32,
  87. };
  88. static struct i2c_board_info __initdata am3517evm_i2c3_boardinfo[] = {
  89. {
  90. I2C_BOARD_INFO("tca6416", 0x20),
  91. .platform_data = &am3517evm_ui_gpio_expander_info_1,
  92. },
  93. {
  94. I2C_BOARD_INFO("tca6416", 0x21),
  95. .platform_data = &am3517evm_ui_gpio_expander_info_2,
  96. },
  97. };
  98. static int __init am3517_evm_i2c_init(void)
  99. {
  100. omap_register_i2c_bus(1, 400, NULL, 0);
  101. omap_register_i2c_bus(2, 400, am3517evm_i2c2_boardinfo,
  102. ARRAY_SIZE(am3517evm_i2c2_boardinfo));
  103. omap_register_i2c_bus(3, 400, am3517evm_i2c3_boardinfo,