dataMonitoring.c 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. /*
  2. * linux/arch/arm/mach-omap1/devices.c
  3. *
  4. * OMAP1 platform device setup/initialization
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. */
  11. #include <linux/dma-mapping.h>
  12. #include <linux/gpio.h>
  13. #include <linux/module.h>
  14. #include <linux/kernel.h>
  15. #include <linux/init.h>
  16. #include <linux/platform_device.h>
  17. #include <linux/spi/spi.h>
  18. #include <linux/platform_data/omap-wd-timer.h>
  19. #include <asm/mach/map.h>
  20. #include <mach/tc.h>
  21. #include <mach/mux.h>
  22. #include <mach/omap7xx.h>
  23. #include <mach/camera.h>
  24. #include <mach/hardware.h>
  25. #include "common.h"
  26. #include "clock.h"
  27. #include "dma.h"
  28. #include "mmc.h"
  29. #include "sram.h"
  30. #if defined(CONFIG_SND_SOC) || defined(CONFIG_SND_SOC_MODULE)
  31. static struct platform_device omap_pcm = {
  32. .name = "omap-pcm-audio",
  33. .id = -1,
  34. };
  35. static void omap_init_audio(void)
  36. {
  37. platform_device_register(&omap_pcm);
  38. }
  39. #else
  40. static inline void omap_init_audio(void) {}
  41. #endif
  42. /*-------------------------------------------------------------------------*/
  43. #if defined(CONFIG_RTC_DRV_OMAP) || defined(CONFIG_RTC_DRV_OMAP_MODULE)
  44. #define OMAP_RTC_BASE 0xfffb4800
  45. static struct resource rtc_resources[] = {
  46. {
  47. .start = OMAP_RTC_BASE,
  48. .end = OMAP_RTC_BASE + 0x5f,
  49. .flags = IORESOURCE_MEM,
  50. },
  51. {
  52. .start = INT_RTC_TIMER,
  53. .flags = IORESOURCE_IRQ,
  54. },
  55. {
  56. .start = INT_RTC_ALARM,
  57. .flags = IORESOURCE_IRQ,
  58. },
  59. };
  60. static struct platform_device omap_rtc_device = {
  61. .name = "omap_rtc",
  62. .id = -1,
  63. .num_resources = ARRAY_SIZE(rtc_resources),
  64. .resource = rtc_resources,
  65. };
  66. static void omap_init_rtc(void)
  67. {
  68. (void) platform_device_register(&omap_rtc_device);
  69. }
  70. #else
  71. static inline void omap_init_rtc(void) {}
  72. #endif
  73. static inline void omap_init_mbox(void) { }
  74. /*-------------------------------------------------------------------------*/
  75. #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
  76. static inline void omap1_mmc_mux(struct omap_mmc_platform_data *mmc_controller,
  77. int controller_nr)
  78. {
  79. if (controller_nr == 0) {
  80. if (cpu_is_omap7xx()) {
  81. omap_cfg_reg(MMC_7XX_CMD);
  82. omap_cfg_reg(MMC_7XX_CLK);
  83. omap_cfg_reg(MMC_7XX_DAT0);
  84. } else {
  85. omap_cfg_reg(MMC_CMD);
  86. omap_cfg_reg(MMC_CLK);
  87. omap_cfg_reg(MMC_DAT0);
  88. }
  89. if (cpu_is_omap1710()) {
  90. omap_cfg_reg(M15_1710_MMC_CLKI);
  91. omap_cfg_reg(P19_1710_MMC_CMDDIR);
  92. omap_cfg_reg(P20_1710_MMC_DATDIR0);
  93. }
  94. if (mmc_controller->slots[0].wires == 4 && !cpu_is_omap7xx()) {
  95. omap_cfg_reg(MMC_DAT1);
  96. /* NOTE: DAT2 can be on W10 (here) or M15 */
  97. if (!mmc_controller->slots[0].nomux)
  98. omap_cfg_reg(MMC_DAT2);
  99. omap_cfg_reg(MMC_DAT3);
  100. }
  101. }
  102. /* Block 2 is on newer chips, and has many pinout options */
  103. if (cpu_is_omap16xx() && controller_nr == 1) {
  104. if (!mmc_controller->slots[1].nomux) {
  105. omap_cfg_reg(Y8_1610_MMC2_CMD);
  106. omap_cfg_reg(Y10_1610_MMC2_CLK);
  107. omap_cfg_reg(R18_1610_MMC2_CLKIN);
  108. omap_cfg_reg(W8_1610_MMC2_DAT0);
  109. if (mmc_controller->slots[1].wires == 4) {
  110. omap_cfg_reg(V8_1610_MMC2_DAT1);
  111. omap_cfg_reg(W15_1610_MMC2_DAT2);
  112. omap_cfg_reg(R10_1610_MMC2_DAT3);
  113. }
  114. /* These are needed for the level shifter */