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>
22 * utmi_pll_config_in_car_module: true if the UTMI PLL configuration registers
23 * should be set up by clk-tegra, false if by the PHY code
24 * has_hostpc: true if the USB controller has the HOSTPC extension, which
25 * changes the location of the PHCD and PTS fields
26 * requires_usbmode_setup: true if the USBMODE register needs to be set to
28 * requires_extra_tuning_parameters: true if xcvr_hsslew, hssquelch_level
29 * and hsdiscon_level should be set for adequate signal quality
32 struct tegra_phy_soc_config
{
33 bool utmi_pll_config_in_car_module
;
35 bool requires_usbmode_setup
;
36 bool requires_extra_tuning_parameters
;
39 struct tegra_utmip_config
{
40 u8 hssync_start_delay
;
44 bool xcvr_setup_use_fuses
;
53 enum tegra_usb_phy_port_speed
{
54 TEGRA_USB_PHY_PORT_SPEED_FULL
= 0,
55 TEGRA_USB_PHY_PORT_SPEED_LOW
,
56 TEGRA_USB_PHY_PORT_SPEED_HIGH
,
59 struct tegra_xtal_freq
;
61 struct tegra_usb_phy
{
63 const struct tegra_xtal_freq
*freq
;
65 void __iomem
*pad_regs
;
69 struct regulator
*vbus
;
70 enum usb_dr_mode mode
;
72 const struct tegra_phy_soc_config
*soc_config
;
80 void tegra_usb_phy_preresume(struct usb_phy
*phy
);
82 void tegra_usb_phy_postresume(struct usb_phy
*phy
);
84 void tegra_ehci_phy_restore_start(struct usb_phy
*phy
,
85 enum tegra_usb_phy_port_speed port_speed
);
87 void tegra_ehci_phy_restore_end(struct usb_phy
*phy
);
89 #endif /* __TEGRA_USB_PHY_H */