tegra_usb_phy.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. struct tegra_xtal_freq;
  33. struct tegra_usb_phy {
  34. int instance;
  35. const struct tegra_xtal_freq *freq;
  36. void __iomem *regs;
  37. void __iomem *pad_regs;
  38. struct clk *clk;
  39. struct clk *pll_u;
  40. struct clk *pad_clk;
  41. struct regulator *vbus;
  42. enum usb_dr_mode mode;
  43. void *config;
  44. struct usb_phy *ulpi;
  45. struct usb_phy u_phy;
  46. bool is_legacy_phy;
  47. bool is_ulpi_phy;
  48. int reset_gpio;
  49. };
  50. void tegra_usb_phy_preresume(struct usb_phy *phy);
  51. void tegra_usb_phy_postresume(struct usb_phy *phy);
  52. void tegra_ehci_phy_restore_start(struct usb_phy *phy,
  53. enum tegra_usb_phy_port_speed port_speed);
  54. void tegra_ehci_phy_restore_end(struct usb_phy *phy);
  55. #endif /* __TEGRA_USB_PHY_H */