tegra_usb_phy.h 2.3 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
/*
 * Copyright (C) 2010 Google, Inc.
 *
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
 * may be copied, distributed, and modified under those terms.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 */

15 16
#ifndef __TEGRA_USB_PHY_H
#define __TEGRA_USB_PHY_H
17 18 19 20

#include <linux/clk.h>
#include <linux/usb/otg.h>

21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
/*
 * utmi_pll_config_in_car_module: true if the UTMI PLL configuration registers
 *     should be set up by clk-tegra, false if by the PHY code
 * has_hostpc: true if the USB controller has the HOSTPC extension, which
 *     changes the location of the PHCD and PTS fields
 * requires_usbmode_setup: true if the USBMODE register needs to be set to
 *      enter host mode
 * requires_extra_tuning_parameters: true if xcvr_hsslew, hssquelch_level
 *      and hsdiscon_level should be set for adequate signal quality
 */

struct tegra_phy_soc_config {
	bool utmi_pll_config_in_car_module;
	bool has_hostpc;
	bool requires_usbmode_setup;
	bool requires_extra_tuning_parameters;
};

39 40 41 42 43
struct tegra_utmip_config {
	u8 hssync_start_delay;
	u8 elastic_limit;
	u8 idle_wait_delay;
	u8 term_range_adj;
44
	bool xcvr_setup_use_fuses;
45 46 47
	u8 xcvr_setup;
	u8 xcvr_lsfslew;
	u8 xcvr_lsrslew;
48 49 50
	u8 xcvr_hsslew;
	u8 hssquelch_level;
	u8 hsdiscon_level;
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
};

enum tegra_usb_phy_port_speed {
	TEGRA_USB_PHY_PORT_SPEED_FULL = 0,
	TEGRA_USB_PHY_PORT_SPEED_LOW,
	TEGRA_USB_PHY_PORT_SPEED_HIGH,
};

struct tegra_xtal_freq;

struct tegra_usb_phy {
	int instance;
	const struct tegra_xtal_freq *freq;
	void __iomem *regs;
	void __iomem *pad_regs;
	struct clk *clk;
	struct clk *pll_u;
	struct clk *pad_clk;
69
	struct regulator *vbus;
70
	enum usb_dr_mode mode;
71
	void *config;
72
	const struct tegra_phy_soc_config *soc_config;
73
	struct usb_phy *ulpi;
74
	struct usb_phy u_phy;
75
	bool is_legacy_phy;
76
	bool is_ulpi_phy;
77
	int reset_gpio;
78 79
};

80
void tegra_usb_phy_preresume(struct usb_phy *phy);
81

82
void tegra_usb_phy_postresume(struct usb_phy *phy);
83

84
void tegra_ehci_phy_restore_start(struct usb_phy *phy,
85 86
				 enum tegra_usb_phy_port_speed port_speed);

87
void tegra_ehci_phy_restore_end(struct usb_phy *phy);
88

89
#endif /* __TEGRA_USB_PHY_H */
反馈
建议
客服 返回
顶部