waterTankDataOperation.c 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /*
  2. * usb-host.c - OMAP USB Host
  3. *
  4. * This file will contain the board specific details for the
  5. * Synopsys EHCI/OHCI host controller on OMAP3430 and onwards
  6. *
  7. * Copyright (C) 2007-2011 Texas Instruments
  8. * Author: Vikram Pandita <vikram.pandita@ti.com>
  9. * Author: Keshava Munegowda <keshava_mgowda@ti.com>
  10. *
  11. * Generalization by:
  12. * Felipe Balbi <balbi@ti.com>
  13. *
  14. * This program is free software; you can redistribute it and/or modify
  15. * it under the terms of the GNU General Public License version 2 as
  16. * published by the Free Software Foundation.
  17. */
  18. #include <linux/types.h>
  19. #include <linux/errno.h>
  20. #include <linux/delay.h>
  21. #include <linux/platform_device.h>
  22. #include <linux/slab.h>
  23. #include <linux/dma-mapping.h>
  24. #include <asm/io.h>
  25. #include "soc.h"
  26. #include "omap_device.h"
  27. #include "mux.h"
  28. #include "usb.h"
  29. #ifdef CONFIG_MFD_OMAP_USB_HOST
  30. #define OMAP_USBHS_DEVICE "usbhs_omap"
  31. #define OMAP_USBTLL_DEVICE "usbhs_tll"
  32. #define USBHS_UHH_HWMODNAME "usb_host_hs"
  33. #define USBHS_TLL_HWMODNAME "usb_tll_hs"
  34. static struct usbhs_omap_platform_data usbhs_data;
  35. static struct usbtll_omap_platform_data usbtll_data;
  36. static struct ehci_hcd_omap_platform_data ehci_data;
  37. static struct ohci_hcd_omap_platform_data ohci_data;
  38. static struct omap_device_pm_latency omap_uhhtll_latency[] = {
  39. {
  40. .deactivate_func = omap_device_idle_hwmods,
  41. .activate_func = omap_device_enable_hwmods,
  42. .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
  43. },
  44. };
  45. /* MUX settings for EHCI pins */
  46. /*
  47. * setup_ehci_io_mux - initialize IO pad mux for USBHOST
  48. */
  49. static void __init setup_ehci_io_mux(const enum usbhs_omap_port_mode *port_mode)
  50. {
  51. switch (port_mode[0]) {
  52. case OMAP_EHCI_PORT_MODE_PHY:
  53. omap_mux_init_signal("hsusb1_stp", OMAP_PIN_OUTPUT);
  54. omap_mux_init_signal("hsusb1_clk", OMAP_PIN_OUTPUT);
  55. omap_mux_init_signal("hsusb1_dir", OMAP_PIN_INPUT_PULLDOWN);
  56. omap_mux_init_signal("hsusb1_nxt", OMAP_PIN_INPUT_PULLDOWN);
  57. omap_mux_init_signal("hsusb1_data0", OMAP_PIN_INPUT_PULLDOWN);
  58. omap_mux_init_signal("hsusb1_data1", OMAP_PIN_INPUT_PULLDOWN);
  59. omap_mux_init_signal("hsusb1_data2", OMAP_PIN_INPUT_PULLDOWN);
  60. omap_mux_init_signal("hsusb1_data3", OMAP_PIN_INPUT_PULLDOWN);
  61. omap_mux_init_signal("hsusb1_data4", OMAP_PIN_INPUT_PULLDOWN);
  62. omap_mux_init_signal("hsusb1_data5", OMAP_PIN_INPUT_PULLDOWN);
  63. omap_mux_init_signal("hsusb1_data6", OMAP_PIN_INPUT_PULLDOWN);
  64. omap_mux_init_signal("hsusb1_data7", OMAP_PIN_INPUT_PULLDOWN);
  65. break;
  66. case OMAP_EHCI_PORT_MODE_TLL:
  67. omap_mux_init_signal("hsusb1_tll_stp",
  68. OMAP_PIN_INPUT_PULLUP);
  69. omap_mux_init_signal("hsusb1_tll_clk",
  70. OMAP_PIN_INPUT_PULLDOWN);
  71. omap_mux_init_signal("hsusb1_tll_dir",
  72. OMAP_PIN_INPUT_PULLDOWN);
  73. omap_mux_init_signal("hsusb1_tll_nxt",
  74. OMAP_PIN_INPUT_PULLDOWN);
  75. omap_mux_init_signal("hsusb1_tll_data0",
  76. OMAP_PIN_INPUT_PULLDOWN);
  77. omap_mux_init_signal("hsusb1_tll_data1",
  78. OMAP_PIN_INPUT_PULLDOWN);
  79. omap_mux_init_signal("hsusb1_tll_data2",
  80. OMAP_PIN_INPUT_PULLDOWN);
  81. omap_mux_init_signal("hsusb1_tll_data3",
  82. OMAP_PIN_INPUT_PULLDOWN);
  83. omap_mux_init_signal("hsusb1_tll_data4",
  84. OMAP_PIN_INPUT_PULLDOWN);
  85. omap_mux_init_signal("hsusb1_tll_data5",
  86. OMAP_PIN_INPUT_PULLDOWN);
  87. omap_mux_init_signal("hsusb1_tll_data6",
  88. OMAP_PIN_INPUT_PULLDOWN);
  89. omap_mux_init_signal("hsusb1_tll_data7",
  90. OMAP_PIN_INPUT_PULLDOWN);
  91. break;
  92. case OMAP_USBHS_PORT_MODE_UNUSED:
  93. /* FALLTHROUGH */
  94. default:
  95. break;
  96. }
  97. switch (port_mode[1]) {
  98. case OMAP_EHCI_PORT_MODE_PHY:
  99. omap_mux_init_signal("hsusb2_stp", OMAP_PIN_OUTPUT);
  100. omap_mux_init_signal("hsusb2_clk", OMAP_PIN_OUTPUT);
  101. omap_mux_init_signal("hsusb2_dir", OMAP_PIN_INPUT_PULLDOWN);
  102. omap_mux_init_signal("hsusb2_nxt", OMAP_PIN_INPUT_PULLDOWN);
  103. omap_mux_init_signal("hsusb2_data0",
  104. OMAP_PIN_INPUT_PULLDOWN);
  105. omap_mux_init_signal("hsusb2_data1",
  106. OMAP_PIN_INPUT_PULLDOWN);
  107. omap_mux_init_signal("hsusb2_data2",
  108. OMAP_PIN_INPUT_PULLDOWN);
  109. omap_mux_init_signal("hsusb2_data3",
  110. OMAP_PIN_INPUT_PULLDOWN);
  111. omap_mux_init_signal("hsusb2_data4",
  112. OMAP_PIN_INPUT_PULLDOWN);
  113. omap_mux_init_signal("hsusb2_data5",
  114. OMAP_PIN_INPUT_PULLDOWN);
  115. omap_mux_init_signal("hsusb2_data6",
  116. OMAP_PIN_INPUT_PULLDOWN);
  117. omap_mux_init_signal("hsusb2_data7",
  118. OMAP_PIN_INPUT_PULLDOWN);
  119. break;
  120. case OMAP_EHCI_PORT_MODE_TLL:
  121. omap_mux_init_signal("hsusb2_tll_stp",