2 * Copyright (C) 2010 Google, Inc.
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.
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.
15 #ifndef __TEGRA_USB_PHY_H
16 #define __TEGRA_USB_PHY_H
18 #include <linux/clk.h>
19 #include <linux/usb/otg.h>
21 struct tegra_utmip_config
{
22 u8 hssync_start_delay
;
31 struct tegra_ulpi_config
{
36 enum tegra_usb_phy_port_speed
{
37 TEGRA_USB_PHY_PORT_SPEED_FULL
= 0,
38 TEGRA_USB_PHY_PORT_SPEED_LOW
,
39 TEGRA_USB_PHY_PORT_SPEED_HIGH
,
42 enum tegra_usb_phy_mode
{
43 TEGRA_USB_PHY_MODE_DEVICE
,
44 TEGRA_USB_PHY_MODE_HOST
,
47 struct tegra_xtal_freq
;
49 struct tegra_usb_phy
{
51 const struct tegra_xtal_freq
*freq
;
53 void __iomem
*pad_regs
;
57 enum tegra_usb_phy_mode mode
;
66 struct tegra_usb_phy
*tegra_usb_phy_open(struct device
*dev
, int instance
,
67 void __iomem
*regs
, void *config
, enum tegra_usb_phy_mode phy_mode
);
69 void tegra_usb_phy_preresume(struct usb_phy
*phy
);
71 void tegra_usb_phy_postresume(struct usb_phy
*phy
);
73 void tegra_ehci_phy_restore_start(struct usb_phy
*phy
,
74 enum tegra_usb_phy_port_speed port_speed
);
76 void tegra_ehci_phy_restore_end(struct usb_phy
*phy
);
78 void tegra_ehci_set_pts(struct usb_phy
*x
, u8 pts_val
);
80 void tegra_ehci_set_phcd(struct usb_phy
*x
, bool enable
);
82 #endif /* __TEGRA_USB_PHY_H */