1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 2010 Google, Inc.
6 #ifndef __TEGRA_USB_PHY_H
7 #define __TEGRA_USB_PHY_H
10 #include <linux/gpio.h>
11 #include <linux/regmap.h>
12 #include <linux/reset.h>
13 #include <linux/usb/otg.h>
16 * utmi_pll_config_in_car_module: true if the UTMI PLL configuration registers
17 * should be set up by clk-tegra, false if by the PHY code
18 * has_hostpc: true if the USB controller has the HOSTPC extension, which
19 * changes the location of the PHCD and PTS fields
20 * requires_usbmode_setup: true if the USBMODE register needs to be set to
22 * requires_extra_tuning_parameters: true if xcvr_hsslew, hssquelch_level
23 * and hsdiscon_level should be set for adequate signal quality
24 * requires_pmc_ao_power_up: true if USB AO is powered down by default
27 struct tegra_phy_soc_config {
28 bool utmi_pll_config_in_car_module;
30 bool requires_usbmode_setup;
31 bool requires_extra_tuning_parameters;
32 bool requires_pmc_ao_power_up;
35 struct tegra_utmip_config {
36 u8 hssync_start_delay;
40 bool xcvr_setup_use_fuses;
49 enum tegra_usb_phy_port_speed {
50 TEGRA_USB_PHY_PORT_SPEED_FULL = 0,
51 TEGRA_USB_PHY_PORT_SPEED_LOW,
52 TEGRA_USB_PHY_PORT_SPEED_HIGH,
55 struct tegra_xtal_freq;
57 struct tegra_usb_phy {
60 const struct tegra_xtal_freq *freq;
62 void __iomem *pad_regs;
66 struct regulator *vbus;
67 struct regmap *pmc_regmap;
68 enum usb_dr_mode mode;
70 const struct tegra_phy_soc_config *soc_config;
75 struct gpio_desc *reset_gpio;
76 struct reset_control *pad_rst;
82 void tegra_usb_phy_preresume(struct usb_phy *phy);
84 void tegra_usb_phy_postresume(struct usb_phy *phy);
86 void tegra_ehci_phy_restore_start(struct usb_phy *phy,
87 enum tegra_usb_phy_port_speed port_speed);
89 void tegra_ehci_phy_restore_end(struct usb_phy *phy);
91 #endif /* __TEGRA_USB_PHY_H */