averageValueOfWaterPressure.c 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. /*
  2. * marzen board support
  3. *
  4. * Copyright (C) 2011 Renesas Solutions Corp.
  5. * Copyright (C) 2011 Magnus Damm
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; version 2 of the License.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  19. */
  20. #include <linux/kernel.h>
  21. #include <linux/init.h>
  22. #include <linux/interrupt.h>
  23. #include <linux/irq.h>
  24. #include <linux/platform_device.h>
  25. #include <linux/delay.h>
  26. #include <linux/io.h>
  27. #include <linux/gpio.h>
  28. #include <linux/dma-mapping.h>
  29. #include <linux/regulator/fixed.h>
  30. #include <linux/regulator/machine.h>
  31. #include <linux/smsc911x.h>
  32. #include <linux/spi/spi.h>
  33. #include <linux/spi/sh_hspi.h>
  34. #include <linux/mmc/sh_mobile_sdhi.h>
  35. #include <linux/mfd/tmio.h>
  36. #include <linux/usb/otg.h>
  37. #include <linux/usb/ehci_pdriver.h>
  38. #include <linux/usb/ohci_pdriver.h>
  39. #include <linux/pm_runtime.h>
  40. #include <mach/hardware.h>
  41. #include <mach/r8a7779.h>
  42. #include <mach/common.h>
  43. #include <mach/irqs.h>
  44. #include <asm/mach-types.h>
  45. #include <asm/mach/arch.h>
  46. #include <asm/hardware/gic.h>
  47. #include <asm/traps.h>
  48. /* Fixed 3.3V regulator to be used by SDHI0 */
  49. static struct regulator_consumer_supply fixed3v3_power_consumers[] = {
  50. REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
  51. REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"),
  52. };
  53. /* Dummy supplies, where voltage doesn't matter */
  54. static struct regulator_consumer_supply dummy_supplies[] = {
  55. REGULATOR_SUPPLY("vddvario", "smsc911x"),
  56. REGULATOR_SUPPLY("vdd33a", "smsc911x"),
  57. };
  58. /* SMSC LAN89218 */
  59. static struct resource smsc911x_resources[] = {
  60. [0] = {
  61. .start = 0x18000000, /* ExCS0 */
  62. .end = 0x180000ff, /* A1->A7 */
  63. .flags = IORESOURCE_MEM,
  64. },
  65. [1] = {
  66. .start = gic_spi(28), /* IRQ 1 */
  67. .flags = IORESOURCE_IRQ,
  68. },
  69. };
  70. static struct smsc911x_platform_config smsc911x_platdata = {
  71. .flags = SMSC911X_USE_32BIT, /* 32-bit SW on 16-bit HW bus */
  72. .phy_interface = PHY_INTERFACE_MODE_MII,
  73. .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
  74. .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
  75. };
  76. static struct platform_device eth_device = {
  77. .name = "smsc911x",
  78. .id = -1,
  79. .dev = {
  80. .platform_data = &smsc911x_platdata,
  81. },
  82. .resource = smsc911x_resources,
  83. .num_resources = ARRAY_SIZE(smsc911x_resources),
  84. };
  85. static struct resource sdhi0_resources[] = {
  86. [0] = {
  87. .name = "sdhi0",
  88. .start = 0xffe4c000,
  89. .end = 0xffe4c0ff,
  90. .flags = IORESOURCE_MEM,
  91. },
  92. [1] = {
  93. .start = gic_spi(104),
  94. .flags = IORESOURCE_IRQ,
  95. },
  96. };
  97. static struct sh_mobile_sdhi_info sdhi0_platform_data = {
  98. .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_HAS_IDLE_WAIT,
  99. .tmio_caps = MMC_CAP_SD_HIGHSPEED,
  100. };
  101. static struct platform_device sdhi0_device = {
  102. .name = "sh_mobile_sdhi",
  103. .num_resources = ARRAY_SIZE(sdhi0_resources),
  104. .resource = sdhi0_resources,
  105. .id = 0,
  106. .dev = {
  107. .platform_data = &sdhi0_platform_data,
  108. }
  109. };
  110. /* Thermal */
  111. static struct resource thermal_resources[] = {
  112. [0] = {
  113. .start = 0xFFC48000,
  114. .end = 0xFFC48038 - 1,
  115. .flags = IORESOURCE_MEM,
  116. },
  117. };
  118. static struct platform_device thermal_device = {