blob: a095c98184d0653ee1a4cef4ae0324567f847398 [file] [log] [blame]
Benoit Goby91525d02011-03-09 16:28:55 -08001/*
Benoit Goby91525d02011-03-09 16:28:55 -08002 * Copyright (C) 2010 Google, Inc.
3 *
4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and
6 * may be copied, distributed, and modified under those terms.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 */
14
Venu Byravarasu1ba82162012-09-05 18:50:23 +053015#ifndef __TEGRA_USB_PHY_H
16#define __TEGRA_USB_PHY_H
Benoit Goby91525d02011-03-09 16:28:55 -080017
18#include <linux/clk.h>
19#include <linux/usb/otg.h>
20
21struct tegra_utmip_config {
22 u8 hssync_start_delay;
23 u8 elastic_limit;
24 u8 idle_wait_delay;
25 u8 term_range_adj;
26 u8 xcvr_setup;
27 u8 xcvr_lsfslew;
28 u8 xcvr_lsrslew;
29};
30
Benoit Goby91525d02011-03-09 16:28:55 -080031enum tegra_usb_phy_port_speed {
32 TEGRA_USB_PHY_PORT_SPEED_FULL = 0,
33 TEGRA_USB_PHY_PORT_SPEED_LOW,
34 TEGRA_USB_PHY_PORT_SPEED_HIGH,
35};
36
37enum tegra_usb_phy_mode {
38 TEGRA_USB_PHY_MODE_DEVICE,
39 TEGRA_USB_PHY_MODE_HOST,
Venu Byravarasu9cd93842013-05-16 19:42:59 +053040 TEGRA_USB_PHY_MODE_OTG,
Benoit Goby91525d02011-03-09 16:28:55 -080041};
42
43struct tegra_xtal_freq;
44
45struct tegra_usb_phy {
46 int instance;
47 const struct tegra_xtal_freq *freq;
48 void __iomem *regs;
49 void __iomem *pad_regs;
50 struct clk *clk;
51 struct clk *pll_u;
52 struct clk *pad_clk;
Mikko Perttunenf5b8c8b2013-07-17 10:37:49 +030053 struct regulator *vbus;
Benoit Goby91525d02011-03-09 16:28:55 -080054 enum tegra_usb_phy_mode mode;
55 void *config;
Heikki Krogerus86753812012-02-13 13:24:02 +020056 struct usb_phy *ulpi;
Venu Byravarasu1ba82162012-09-05 18:50:23 +053057 struct usb_phy u_phy;
Venu Byravarasu3a55c6a2013-01-16 03:30:20 +000058 bool is_legacy_phy;
Venu Byravarasu3f9db1a2013-01-16 03:30:21 +000059 bool is_ulpi_phy;
Venu Byravarasu12ea18e2013-05-16 19:43:00 +053060 int reset_gpio;
Benoit Goby91525d02011-03-09 16:28:55 -080061};
62
Venu Byravarasuab137d02013-01-24 15:57:03 +053063void tegra_usb_phy_preresume(struct usb_phy *phy);
Benoit Goby91525d02011-03-09 16:28:55 -080064
Venu Byravarasuab137d02013-01-24 15:57:03 +053065void tegra_usb_phy_postresume(struct usb_phy *phy);
Benoit Goby91525d02011-03-09 16:28:55 -080066
Venu Byravarasuab137d02013-01-24 15:57:03 +053067void tegra_ehci_phy_restore_start(struct usb_phy *phy,
Benoit Goby91525d02011-03-09 16:28:55 -080068 enum tegra_usb_phy_port_speed port_speed);
69
Venu Byravarasuab137d02013-01-24 15:57:03 +053070void tegra_ehci_phy_restore_end(struct usb_phy *phy);
Benoit Goby91525d02011-03-09 16:28:55 -080071
Venu Byravarasu1ba82162012-09-05 18:50:23 +053072#endif /* __TEGRA_USB_PHY_H */