1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 2010 Google, Inc.
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
16 #ifndef __TEGRA_USB_PHY_H
17 #define __TEGRA_USB_PHY_H
19 #include <linux/clk.h>
20 #include <linux/usb/otg.h>
23 * utmi_pll_config_in_car_module: true if the UTMI PLL configuration registers
24 * should be set up by clk-tegra, false if by the PHY code
25 * has_hostpc: true if the USB controller has the HOSTPC extension, which
26 * changes the location of the PHCD and PTS fields
27 * requires_usbmode_setup: true if the USBMODE register needs to be set to
29 * requires_extra_tuning_parameters: true if xcvr_hsslew, hssquelch_level
30 * and hsdiscon_level should be set for adequate signal quality
33 struct tegra_phy_soc_config
{
34 bool utmi_pll_config_in_car_module
;
36 bool requires_usbmode_setup
;
37 bool requires_extra_tuning_parameters
;
40 struct tegra_utmip_config
{
41 u8 hssync_start_delay
;
45 bool xcvr_setup_use_fuses
;
54 enum tegra_usb_phy_port_speed
{
55 TEGRA_USB_PHY_PORT_SPEED_FULL
= 0,
56 TEGRA_USB_PHY_PORT_SPEED_LOW
,
57 TEGRA_USB_PHY_PORT_SPEED_HIGH
,
60 struct tegra_xtal_freq
;
62 struct tegra_usb_phy
{
64 const struct tegra_xtal_freq
*freq
;
66 void __iomem
*pad_regs
;
70 struct regulator
*vbus
;
71 enum usb_dr_mode mode
;
73 const struct tegra_phy_soc_config
*soc_config
;
81 void tegra_usb_phy_preresume(struct usb_phy
*phy
);
83 void tegra_usb_phy_postresume(struct usb_phy
*phy
);
85 void tegra_ehci_phy_restore_start(struct usb_phy
*phy
,
86 enum tegra_usb_phy_port_speed port_speed
);
88 void tegra_ehci_phy_restore_end(struct usb_phy
*phy
);
90 #endif /* __TEGRA_USB_PHY_H */