tegra_usb_phy.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. struct tegra_ulpi_config {
  28. int reset_gpio;
  29. const char *clk;
  30. };
  31. enum tegra_usb_phy_port_speed {
  32. TEGRA_USB_PHY_PORT_SPEED_FULL = 0,
  33. TEGRA_USB_PHY_PORT_SPEED_LOW,
  34. TEGRA_USB_PHY_PORT_SPEED_HIGH,
  35. };
  36. enum tegra_usb_phy_mode {
  37. TEGRA_USB_PHY_MODE_DEVICE,
  38. TEGRA_USB_PHY_MODE_HOST,
  39. };
  40. struct tegra_xtal_freq;
  41. struct tegra_usb_phy {
  42. int instance;
  43. const struct tegra_xtal_freq *freq;
  44. void __iomem *regs;
  45. void __iomem *pad_regs;
  46. struct clk *clk;
  47. struct clk *pll_u;
  48. struct clk *pad_clk;
  49. enum tegra_usb_phy_mode mode;
  50. void *config;
  51. struct usb_phy *ulpi;
  52. struct usb_phy u_phy;
  53. struct device *dev;
  54. };
  55. struct tegra_usb_phy *tegra_usb_phy_open(struct device *dev, int instance,
  56. void __iomem *regs, void *config, enum tegra_usb_phy_mode phy_mode);
  57. void tegra_usb_phy_clk_disable(struct tegra_usb_phy *phy);
  58. void tegra_usb_phy_clk_enable(struct tegra_usb_phy *phy);
  59. void tegra_usb_phy_preresume(struct tegra_usb_phy *phy);
  60. void tegra_usb_phy_postresume(struct tegra_usb_phy *phy);
  61. void tegra_ehci_phy_restore_start(struct tegra_usb_phy *phy,
  62. enum tegra_usb_phy_port_speed port_speed);
  63. void tegra_ehci_phy_restore_end(struct tegra_usb_phy *phy);
  64. #endif /* __TEGRA_USB_PHY_H */