2 * arch/arm/mach-tegra/include/mach/usb_phy.h
4 * Copyright (C) 2010 Google, Inc.
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
17 #ifndef __MACH_USB_PHY_H
18 #define __MACH_USB_PHY_H
20 #include <linux/platform_device.h>
21 #include <linux/clk.h>
23 #define USB_PHY_MAX_CONTEXT_REGS 10
25 struct tegra_utmip_config {
26 u8 hssync_start_delay;
35 enum tegra_usb_phy_port_speed {
36 TEGRA_USB_PHY_PORT_SPEED_FULL = 0,
37 TEGRA_USB_PHY_PORT_SPEED_LOW,
38 TEGRA_USB_PHY_PORT_HIGH,
41 struct tegra_utmip_context {
43 u32 regs[USB_PHY_MAX_CONTEXT_REGS];
45 enum tegra_usb_phy_port_speed port_speed;
48 enum tegra_usb_phy_mode {
49 TEGRA_USB_PHY_MODE_DEVICE,
50 TEGRA_USB_PHY_MODE_HOST,
53 struct tegra_usb_phy {
57 void __iomem *pad_regs;
60 enum tegra_usb_phy_mode mode;
61 struct tegra_utmip_config *config;
62 struct tegra_utmip_context context;
65 struct tegra_usb_phy *tegra_usb_phy_open(int instance, void __iomem *regs,
66 struct tegra_utmip_config *config,
67 enum tegra_usb_phy_mode phy_mode);
69 int tegra_usb_phy_power_on(struct tegra_usb_phy *phy);
71 int tegra_usb_phy_clk_disable(struct tegra_usb_phy *phy);
73 int tegra_usb_phy_clk_enable(struct tegra_usb_phy *phy);
75 int tegra_usb_phy_power_off(struct tegra_usb_phy *phy);
77 int tegra_usb_phy_close(struct tegra_usb_phy *phy);
79 #endif //__MACH_USB_PHY_H