2 * Copyright (C) 2010 Google, Inc.
3 * Copyright (c) 2010-2014, NVIDIA CORPORATION. All rights reserved.
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.
20 * defines operation mode of the USB controller
22 enum tegra_usb_operation_mode {
23 TEGRA_USB_OPMODE_DEVICE,
24 TEGRA_USB_OPMODE_HOST,
28 * defines the various phy interface mode supported by controller
30 enum tegra_usb_phy_interface {
31 TEGRA_USB_PHY_INTF_UTMI = 0,
32 TEGRA_USB_PHY_INTF_ULPI_LINK = 1,
33 TEGRA_USB_PHY_INTF_ULPI_NULL = 2,
34 TEGRA_USB_PHY_INTF_HSIC = 3,
35 TEGRA_USB_PHY_INTF_ICUSB = 4,
39 * defines the various ID cable detection types
41 enum tegra_usb_id_detection {
44 TEGRA_USB_GPIO_ID = 2,
45 TEGRA_USB_VIRTUAL_ID = 3,
49 * Set the maximum voltage that can be supplied
50 * over USB vbus that the board supports if we use
51 * a quick charge 2 wall charger.
52 * a low value means longer charge time
53 * a too high value will blow up the board.
54 * if not sure what board supports use 5V.
59 * TEGRA_USB_QC2_20V (probably not safe)
61 * specify the maximum current that the internal charger
62 * can draw from an external wall charger
64 enum tegra_usb_qc2_voltage {
67 TEGRA_USB_QC2_12V = 2,
68 TEGRA_USB_QC2_20V = 3,
73 * configuration structure for setting up utmi phy
75 struct tegra_utmi_config {
76 u8 hssync_start_delay;
83 signed char xcvr_setup_offset;
87 unsigned char xcvr_hsslew_lsb:2;
88 unsigned char xcvr_hsslew_msb:7;
92 * configuration structure for setting up ulpi phy
94 struct tegra_ulpi_config {
101 int phy_restore_gpio;
105 * Platform specific operations that will be controlled
106 * during the phy operations.
108 struct tegra_usb_phy_platform_ops {
111 void (*pre_suspend)(void);
112 void (*post_suspend)(void);
113 void (*pre_resume)(void);
114 void (*post_resume)(void);
115 void (*post_remote_wakeup)(void);
116 void (*pre_phy_off)(void);
117 void (*post_phy_off)(void);
118 void (*pre_phy_on)(void);
119 void (*post_phy_on)(void);
120 void (*port_power)(void);
125 * defines structure for platform dependent device parameters
127 struct tegra_usb_dev_mode_data {
129 int dcp_current_limit_ma;
130 int qc2_current_limit_ma;
131 bool charging_supported;
132 bool remote_wakeup_supported;
137 * defines structure for platform dependent host parameters
139 struct tegra_usb_host_mode_data {
141 bool remote_wakeup_supported;
142 bool power_off_on_suspend;
143 bool turn_off_vbus_on_lp0;
144 bool support_y_cable;
148 * defines structure for usb platform data
150 struct tegra_usb_platform_data {
153 bool unaligned_dma_buf_supported;
154 bool support_pmu_vbus;
155 const char *vbus_extcon_dev_name;
156 const char *id_extcon_dev_name;
157 enum tegra_usb_id_detection id_det_type;
158 enum tegra_usb_phy_interface phy_intf;
159 enum tegra_usb_operation_mode op_mode;
160 enum tegra_usb_qc2_voltage qc2_voltage;
163 struct tegra_usb_dev_mode_data dev;
164 struct tegra_usb_host_mode_data host;
168 struct tegra_utmi_config utmi;
169 struct tegra_ulpi_config ulpi;
172 struct tegra_usb_phy_platform_ops *ops;
176 * defines structure for platform dependent OTG parameters
178 struct tegra_usb_otg_data {
179 struct platform_device *ehci_device;
180 struct tegra_usb_platform_data *ehci_pdata;
185 #endif /* _TEGRA_USB_H_ */