[ARM] tegra: usb_phy: Moved suspend/resume code to ehci driver
[firefly-linux-kernel-4.4.55.git] / arch / arm / mach-tegra / include / mach / usb_phy.h
1 /*
2  * arch/arm/mach-tegra/include/mach/usb_phy.h
3  *
4  * Copyright (C) 2010 Google, Inc.
5  *
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.
9  *
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.
14  *
15  */
16
17 #ifndef __MACH_USB_PHY_H
18 #define __MACH_USB_PHY_H
19
20 #include <linux/platform_device.h>
21 #include <linux/clk.h>
22
23 #define USB_PHY_MAX_CONTEXT_REGS 10
24
25 struct tegra_utmip_config {
26         u8 hssync_start_delay;
27         u8 elastic_limit;
28         u8 idle_wait_delay;
29         u8 term_range_adj;
30         u8 xcvr_setup;
31         u8 xcvr_lsfslew;
32         u8 xcvr_lsrslew;
33 };
34
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,
39 };
40
41 struct tegra_utmip_context {
42         bool valid;
43         u32 regs[USB_PHY_MAX_CONTEXT_REGS];
44         int regs_count;
45         enum tegra_usb_phy_port_speed port_speed;
46 };
47
48 enum tegra_usb_phy_mode {
49         TEGRA_USB_PHY_MODE_DEVICE,
50         TEGRA_USB_PHY_MODE_HOST,
51 };
52
53 struct tegra_usb_phy {
54         int instance;
55         int freq_sel;
56         void __iomem *regs;
57         void __iomem *pad_regs;
58         struct clk *pll_u;
59         struct clk *pad_clk;
60         enum tegra_usb_phy_mode mode;
61         struct tegra_utmip_config *config;
62         struct tegra_utmip_context context;
63 };
64
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);
68
69 int tegra_usb_phy_power_on(struct tegra_usb_phy *phy);
70
71 int tegra_usb_phy_clk_disable(struct tegra_usb_phy *phy);
72
73 int tegra_usb_phy_clk_enable(struct tegra_usb_phy *phy);
74
75 int tegra_usb_phy_power_off(struct tegra_usb_phy *phy);
76
77 int tegra_usb_phy_close(struct tegra_usb_phy *phy);
78
79 #endif //__MACH_USB_PHY_H