usb_phy.h 2.1 KB

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