tegra_usb_phy.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * Copyright (C) 2010 Google, Inc.
  3. *
  4. * This software is licensed under the terms of the GNU General Public
  5. * License version 2, as published by the Free Software Foundation, and
  6. * may be copied, distributed, and modified under those terms.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. */
  14. #ifndef __TEGRA_USB_PHY_H
  15. #define __TEGRA_USB_PHY_H
  16. #include <linux/clk.h>
  17. #include <linux/usb/otg.h>
  18. struct tegra_utmip_config {
  19. u8 hssync_start_delay;
  20. u8 elastic_limit;
  21. u8 idle_wait_delay;
  22. u8 term_range_adj;
  23. u8 xcvr_setup;
  24. u8 xcvr_lsfslew;
  25. u8 xcvr_lsrslew;
  26. };
  27. enum tegra_usb_phy_port_speed {
  28. TEGRA_USB_PHY_PORT_SPEED_FULL = 0,
  29. TEGRA_USB_PHY_PORT_SPEED_LOW,
  30. TEGRA_USB_PHY_PORT_SPEED_HIGH,
  31. };
  32. enum tegra_usb_phy_mode {
  33. TEGRA_USB_PHY_MODE_DEVICE,
  34. TEGRA_USB_PHY_MODE_HOST,
  35. TEGRA_USB_PHY_MODE_OTG,
  36. };
  37. struct tegra_xtal_freq;
  38. struct tegra_usb_phy {
  39. int instance;
  40. const struct tegra_xtal_freq *freq;
  41. void __iomem *regs;
  42. void __iomem *pad_regs;
  43. struct clk *clk;
  44. struct clk *pll_u;
  45. struct clk *pad_clk;
  46. struct regulator *vbus;
  47. enum tegra_usb_phy_mode mode;
  48. void *config;
  49. struct usb_phy *ulpi;
  50. struct usb_phy u_phy;
  51. bool is_legacy_phy;
  52. bool is_ulpi_phy;
  53. int reset_gpio;
  54. };
  55. void tegra_usb_phy_preresume(struct usb_phy *phy);
  56. void tegra_usb_phy_postresume(struct usb_phy *phy);
  57. void tegra_ehci_phy_restore_start(struct usb_phy *phy,
  58. enum tegra_usb_phy_port_speed port_speed);
  59. void tegra_ehci_phy_restore_end(struct usb_phy *phy);
  60. #endif /* __TEGRA_USB_PHY_H */