summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorRakesh Bodla <rbodla@nvidia.com>2012-05-24 14:59:02 +0530
committerSimone Willett <swillett@nvidia.com>2012-05-24 14:49:45 -0700
commitd85b5e5703ef0113cbf10d4c5177a942c9b092ba (patch)
treed54441a0b0f6f5850367e3f7701eeb911a40d58a /include/linux
parent2285ec5a2c09d0f3e0469a65291ffe983918d112 (diff)
usb: tegra: modify USB platform data structures
Modify USB structures of platform data. Based on the new platform data structures modifying the initialization in board files. Bug 887361 Change-Id: Ie6347a078c9a596a4debe21a353e127ddde35220 Signed-off-by: Rakesh Bodla <rbodla@nvidia.com> Reviewed-on: http://git-master/r/103597 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/platform_data/tegra_usb.h139
1 files changed, 119 insertions, 20 deletions
diff --git a/include/linux/platform_data/tegra_usb.h b/include/linux/platform_data/tegra_usb.h
index e6377c379b48..911175086977 100644
--- a/include/linux/platform_data/tegra_usb.h
+++ b/include/linux/platform_data/tegra_usb.h
@@ -16,33 +16,132 @@
#ifndef _TEGRA_USB_H_
#define _TEGRA_USB_H_
-enum tegra_usb_operating_modes {
- TEGRA_USB_DEVICE,
- TEGRA_USB_HOST,
- TEGRA_USB_OTG,
+/**
+ * defines operation mode of the USB controller
+ */
+enum tegra_usb_operation_mode {
+ TEGRA_USB_OPMODE_DEVICE,
+ TEGRA_USB_OPMODE_HOST,
};
-enum tegra_usb_phy_type {
- TEGRA_USB_PHY_TYPE_UTMIP = 0,
- TEGRA_USB_PHY_TYPE_LINK_ULPI = 1,
- TEGRA_USB_PHY_TYPE_NULL_ULPI = 2,
- TEGRA_USB_PHY_TYPE_HSIC = 3,
- TEGRA_USB_PHY_TYPE_ICUSB = 4,
+/**
+ * defines the various phy interface mode supported by controller
+ */
+enum tegra_usb_phy_interface {
+ TEGRA_USB_PHY_INTF_UTMI = 0,
+ TEGRA_USB_PHY_INTF_ULPI_LINK = 1,
+ TEGRA_USB_PHY_INTF_ULPI_NULL = 2,
+ TEGRA_USB_PHY_INTF_HSIC = 3,
+ TEGRA_USB_PHY_INTF_ICUSB = 4,
};
-struct tegra_ehci_platform_data {
- enum tegra_usb_operating_modes operating_mode;
- /* power down the phy on bus suspend */
- int power_down_on_bus_suspend;
- int hotplug;
- int default_enable;
- void *phy_config;
- enum tegra_usb_phy_type phy_type;
+/**
+ * configuration structure for setting up utmi phy
+ */
+struct tegra_utmi_config {
+ u8 hssync_start_delay;
+ u8 elastic_limit;
+ u8 idle_wait_delay;
+ u8 term_range_adj;
+ u8 xcvr_setup;
+ u8 xcvr_lsfslew;
+ u8 xcvr_lsrslew;
+ signed char xcvr_setup_offset;
+ u8 xcvr_use_fuses;
};
-struct tegra_otg_platform_data {
+/**
+ * configuration structure for setting up ulpi phy
+ */
+struct tegra_ulpi_config {
+ u8 shadow_clk_delay;
+ u8 clock_out_delay;
+ u8 data_trimmer;
+ u8 stpdirnxt_trimmer;
+ u8 dir_trimmer;
+ const char *clk;
+};
+
+/**
+ * configuration structure for setting up hsic phy
+ */
+struct tegra_hsic_config {
+ u8 sync_start_delay;
+ u8 idle_wait_delay;
+ u8 term_range_adj;
+ u8 elastic_underrun_limit;
+ u8 elastic_overrun_limit;
+};
+
+/**
+ * Platform specific operations that will be controlled
+ * during the phy operations.
+ */
+struct tegra_usb_phy_platform_ops {
+ void (*open)(void);
+ void (*init)(void);
+ void (*pre_suspend)(void);
+ void (*post_suspend)(void);
+ void (*pre_resume)(void);
+ void (*post_resume)(void);
+ void (*pre_phy_off)(void);
+ void (*post_phy_off)(void);
+ void (*pre_phy_on)(void);
+ void (*post_phy_on)(void);
+ void (*port_power)(void);
+ void (*close)(void);
+};
+
+/**
+ * defines structure for platform dependent device parameters
+ */
+struct tegra_usb_dev_mode_data {
+ int vbus_pmu_irq;
+ int vbus_gpio;
+ bool charging_supported;
+ bool remote_wakeup_supported;
+};
+
+/**
+ * defines structure for platform dependent host parameters
+ */
+struct tegra_usb_host_mode_data {
+ int vbus_gpio;
+ const char *vbus_reg;
+ bool hot_plug;
+ bool remote_wakeup_supported;
+ bool power_off_on_suspend;
+};
+
+/**
+ * defines structure for usb platform data
+ */
+struct tegra_usb_platform_data {
+ bool port_otg;
+ bool has_hostpc;
+ enum tegra_usb_phy_interface phy_intf;
+ enum tegra_usb_operation_mode op_mode;
+
+ union {
+ struct tegra_usb_dev_mode_data dev;
+ struct tegra_usb_host_mode_data host;
+ } u_data;
+
+ union {
+ struct tegra_utmi_config utmi;
+ struct tegra_ulpi_config ulpi;
+ struct tegra_hsic_config hsic;
+ } u_cfg;
+
+ struct tegra_usb_phy_platform_ops *ops;
+};
+
+/**
+ * defines structure for platform dependent OTG parameters
+ */
+struct tegra_usb_otg_data {
struct platform_device *ehci_device;
- struct tegra_ehci_platform_data *ehci_pdata;
+ struct tegra_usb_platform_data *ehci_pdata;
};
#endif /* _TEGRA_USB_H_ */