Shimrit Malichi | dbf43d7 | 2013-03-16 03:32:27 +0200 | [diff] [blame] | 1 | /* include/linux/usb/msm_hsusb.h |
Pavankumar Kondeti | e0c201f | 2010-12-07 17:53:55 +0530 | [diff] [blame] | 2 | * |
| 3 | * Copyright (C) 2008 Google, Inc. |
| 4 | * Author: Brian Swetland <swetland@google.com> |
Manu Gautam | 355270a | 2012-12-21 16:52:50 +0530 | [diff] [blame] | 5 | * Copyright (c) 2009-2013, The Linux Foundation. All rights reserved. |
Pavankumar Kondeti | e0c201f | 2010-12-07 17:53:55 +0530 | [diff] [blame] | 6 | * |
| 7 | * This software is licensed under the terms of the GNU General Public |
| 8 | * License version 2, as published by the Free Software Foundation, and |
| 9 | * may be copied, distributed, and modified under those terms. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | */ |
| 17 | |
| 18 | #ifndef __ASM_ARCH_MSM_HSUSB_H |
| 19 | #define __ASM_ARCH_MSM_HSUSB_H |
| 20 | |
| 21 | #include <linux/types.h> |
Ido Shayevitz | 9fb8345 | 2012-04-01 17:45:58 +0300 | [diff] [blame] | 22 | #include <linux/usb/ch9.h> |
| 23 | #include <linux/usb/gadget.h> |
Pavankumar Kondeti | e0c201f | 2010-12-07 17:53:55 +0530 | [diff] [blame] | 24 | #include <linux/usb/otg.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 25 | #include <linux/wakelock.h> |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 26 | #include <linux/pm_qos.h> |
Ido Shayevitz | 5a6178b | 2012-06-10 16:31:13 +0300 | [diff] [blame] | 27 | #include <linux/hrtimer.h> |
David Keitel | 272ce52 | 2012-08-17 16:25:24 -0700 | [diff] [blame] | 28 | #include <linux/power_supply.h> |
Pavankumar Kondeti | f1ffbdd | 2013-06-27 13:31:36 +0530 | [diff] [blame] | 29 | #include <linux/cdev.h> |
Ido Shayevitz | d1cb16c | 2012-03-28 18:57:47 +0200 | [diff] [blame] | 30 | /* |
| 31 | * The following are bit fields describing the usb_request.udc_priv word. |
| 32 | * These bit fields are set by function drivers that wish to queue |
| 33 | * usb_requests with sps/bam parameters. |
| 34 | */ |
| 35 | #define MSM_PIPE_ID_MASK (0x1F) |
| 36 | #define MSM_TX_PIPE_ID_OFS (16) |
| 37 | #define MSM_SPS_MODE BIT(5) |
| 38 | #define MSM_IS_FINITE_TRANSFER BIT(6) |
| 39 | #define MSM_PRODUCER BIT(7) |
| 40 | #define MSM_DISABLE_WB BIT(8) |
| 41 | #define MSM_ETD_IOC BIT(9) |
| 42 | #define MSM_INTERNAL_MEM BIT(10) |
| 43 | #define MSM_VENDOR_ID BIT(16) |
Pavankumar Kondeti | e0c201f | 2010-12-07 17:53:55 +0530 | [diff] [blame] | 44 | |
| 45 | /** |
Manu Gautam | e3a3908 | 2013-06-11 10:42:56 +0530 | [diff] [blame] | 46 | * Requested USB votes for BUS bandwidth |
| 47 | * |
| 48 | * USB_NO_PERF_VOTE BUS Vote for inactive USB session or disconnect |
| 49 | * USB_MAX_PERF_VOTE Maximum BUS bandwidth vote |
| 50 | * USB_MIN_PERF_VOTE Minimum BUS bandwidth vote (for some hw same as NO_PERF) |
| 51 | * |
| 52 | */ |
| 53 | enum usb_bus_vote { |
| 54 | USB_NO_PERF_VOTE = 0, |
| 55 | USB_MAX_PERF_VOTE, |
| 56 | USB_MIN_PERF_VOTE, |
| 57 | }; |
| 58 | |
| 59 | /** |
Pavankumar Kondeti | e0c201f | 2010-12-07 17:53:55 +0530 | [diff] [blame] | 60 | * Supported USB modes |
| 61 | * |
| 62 | * USB_PERIPHERAL Only peripheral mode is supported. |
| 63 | * USB_HOST Only host mode is supported. |
| 64 | * USB_OTG OTG mode is supported. |
| 65 | * |
| 66 | */ |
| 67 | enum usb_mode_type { |
| 68 | USB_NONE = 0, |
| 69 | USB_PERIPHERAL, |
| 70 | USB_HOST, |
| 71 | USB_OTG, |
| 72 | }; |
| 73 | |
| 74 | /** |
| 75 | * OTG control |
| 76 | * |
| 77 | * OTG_NO_CONTROL Id/VBUS notifications not required. Useful in host |
| 78 | * only configuration. |
| 79 | * OTG_PHY_CONTROL Id/VBUS notifications comes form USB PHY. |
| 80 | * OTG_PMIC_CONTROL Id/VBUS notifications comes from PMIC hardware. |
| 81 | * OTG_USER_CONTROL Id/VBUS notifcations comes from User via sysfs. |
| 82 | * |
| 83 | */ |
| 84 | enum otg_control_type { |
| 85 | OTG_NO_CONTROL = 0, |
| 86 | OTG_PHY_CONTROL, |
| 87 | OTG_PMIC_CONTROL, |
| 88 | OTG_USER_CONTROL, |
| 89 | }; |
| 90 | |
| 91 | /** |
Pavankumar Kondeti | d860852 | 2011-05-04 10:19:47 +0530 | [diff] [blame] | 92 | * PHY used in |
| 93 | * |
| 94 | * INVALID_PHY Unsupported PHY |
| 95 | * CI_45NM_INTEGRATED_PHY Chipidea 45nm integrated PHY |
| 96 | * SNPS_28NM_INTEGRATED_PHY Synopsis 28nm integrated PHY |
| 97 | * |
| 98 | */ |
| 99 | enum msm_usb_phy_type { |
| 100 | INVALID_PHY = 0, |
| 101 | CI_45NM_INTEGRATED_PHY, |
| 102 | SNPS_28NM_INTEGRATED_PHY, |
| 103 | }; |
| 104 | |
| 105 | #define IDEV_CHG_MAX 1500 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 106 | #define IDEV_CHG_MIN 500 |
Pavankumar Kondeti | d860852 | 2011-05-04 10:19:47 +0530 | [diff] [blame] | 107 | #define IUNIT 100 |
| 108 | |
Pavankumar Kondeti | aa449e1 | 2011-11-04 11:09:26 +0530 | [diff] [blame] | 109 | #define IDEV_ACA_CHG_MAX 1500 |
| 110 | #define IDEV_ACA_CHG_LIMIT 500 |
| 111 | |
Pavankumar Kondeti | d860852 | 2011-05-04 10:19:47 +0530 | [diff] [blame] | 112 | /** |
| 113 | * Different states involved in USB charger detection. |
| 114 | * |
| 115 | * USB_CHG_STATE_UNDEFINED USB charger is not connected or detection |
| 116 | * process is not yet started. |
| 117 | * USB_CHG_STATE_WAIT_FOR_DCD Waiting for Data pins contact. |
| 118 | * USB_CHG_STATE_DCD_DONE Data pin contact is detected. |
| 119 | * USB_CHG_STATE_PRIMARY_DONE Primary detection is completed (Detects |
| 120 | * between SDP and DCP/CDP). |
| 121 | * USB_CHG_STATE_SECONDARY_DONE Secondary detection is completed (Detects |
| 122 | * between DCP and CDP). |
| 123 | * USB_CHG_STATE_DETECTED USB charger type is determined. |
| 124 | * |
| 125 | */ |
| 126 | enum usb_chg_state { |
| 127 | USB_CHG_STATE_UNDEFINED = 0, |
| 128 | USB_CHG_STATE_WAIT_FOR_DCD, |
| 129 | USB_CHG_STATE_DCD_DONE, |
| 130 | USB_CHG_STATE_PRIMARY_DONE, |
| 131 | USB_CHG_STATE_SECONDARY_DONE, |
| 132 | USB_CHG_STATE_DETECTED, |
| 133 | }; |
| 134 | |
| 135 | /** |
| 136 | * USB charger types |
| 137 | * |
| 138 | * USB_INVALID_CHARGER Invalid USB charger. |
| 139 | * USB_SDP_CHARGER Standard downstream port. Refers to a downstream port |
| 140 | * on USB2.0 compliant host/hub. |
| 141 | * USB_DCP_CHARGER Dedicated charger port (AC charger/ Wall charger). |
| 142 | * USB_CDP_CHARGER Charging downstream port. Enumeration can happen and |
| 143 | * IDEV_CHG_MAX can be drawn irrespective of USB state. |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 144 | * USB_ACA_A_CHARGER B-device is connected on accessory port with charger |
| 145 | * connected on charging port. This configuration allows |
| 146 | * charging in host mode. |
| 147 | * USB_ACA_B_CHARGER No device (or A-device without VBUS) is connected on |
| 148 | * accessory port with charger connected on charging port. |
| 149 | * USB_ACA_C_CHARGER A-device (with VBUS) is connected on |
| 150 | * accessory port with charger connected on charging port. |
| 151 | * USB_ACA_DOCK_CHARGER A docking station that has one upstream port and one |
| 152 | * or more downstream ports. Capable of supplying |
| 153 | * IDEV_CHG_MAX irrespective of devices connected on |
| 154 | * accessory ports. |
Pavankumar Kondeti | 9ec21d3 | 2012-05-07 15:50:23 +0530 | [diff] [blame] | 155 | * USB_PROPRIETARY_CHARGER A proprietary charger pull DP and DM to specific |
| 156 | * voltages between 2.0-3.3v for identification. |
| 157 | * |
Pavankumar Kondeti | d860852 | 2011-05-04 10:19:47 +0530 | [diff] [blame] | 158 | */ |
| 159 | enum usb_chg_type { |
| 160 | USB_INVALID_CHARGER = 0, |
| 161 | USB_SDP_CHARGER, |
| 162 | USB_DCP_CHARGER, |
| 163 | USB_CDP_CHARGER, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 164 | USB_ACA_A_CHARGER, |
| 165 | USB_ACA_B_CHARGER, |
| 166 | USB_ACA_C_CHARGER, |
| 167 | USB_ACA_DOCK_CHARGER, |
Pavankumar Kondeti | 9ec21d3 | 2012-05-07 15:50:23 +0530 | [diff] [blame] | 168 | USB_PROPRIETARY_CHARGER, |
zhenhuah | b6d5edc | 2013-06-19 14:37:32 +0800 | [diff] [blame] | 169 | USB_FLOATED_CHARGER, |
Pavankumar Kondeti | d860852 | 2011-05-04 10:19:47 +0530 | [diff] [blame] | 170 | }; |
| 171 | |
| 172 | /** |
Mayank Rana | 248698c | 2012-04-19 00:03:16 +0530 | [diff] [blame] | 173 | * Used different VDDCX voltage voting mechnism |
| 174 | * VDDCX_CORNER Vote for VDDCX Corner voltage |
| 175 | * VDDCX Vote for VDDCX Absolute voltage |
| 176 | */ |
| 177 | enum usb_vdd_type { |
| 178 | VDDCX_CORNER = 0, |
| 179 | VDDCX, |
| 180 | VDD_TYPE_MAX, |
Pavankumar Kondeti | e0c201f | 2010-12-07 17:53:55 +0530 | [diff] [blame] | 181 | }; |
| 182 | |
| 183 | /** |
Amit Blay | d6ea610 | 2012-06-07 16:26:24 +0300 | [diff] [blame] | 184 | * Used different VDDCX voltage values |
| 185 | */ |
| 186 | enum usb_vdd_value { |
| 187 | VDD_NONE = 0, |
| 188 | VDD_MIN, |
| 189 | VDD_MAX, |
| 190 | VDD_VAL_MAX, |
| 191 | }; |
| 192 | |
| 193 | /** |
Pavankumar Kondeti | e0c201f | 2010-12-07 17:53:55 +0530 | [diff] [blame] | 194 | * struct msm_otg_platform_data - platform device data |
Pavankumar Kondeti | dfb2130 | 2011-03-04 22:45:02 +0530 | [diff] [blame] | 195 | * for msm_otg driver. |
Pavankumar Kondeti | e0c201f | 2010-12-07 17:53:55 +0530 | [diff] [blame] | 196 | * @phy_init_seq: PHY configuration sequence. val, reg pairs |
| 197 | * terminated by -1. |
Mayank Rana | 8549e63 | 2012-01-23 12:49:54 +0530 | [diff] [blame] | 198 | * @vbus_power: VBUS power on/off routine.It should return result |
| 199 | * as success(zero value) or failure(non-zero value). |
Pavankumar Kondeti | e0c201f | 2010-12-07 17:53:55 +0530 | [diff] [blame] | 200 | * @power_budget: VBUS power budget in mA (0 will be treated as 500mA). |
| 201 | * @mode: Supported mode (OTG/peripheral/host). |
| 202 | * @otg_control: OTG switch controlled by user/Id pin |
| 203 | * @default_mode: Default operational mode. Applicable only if |
| 204 | * OTG switch is controller by user. |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 205 | * @pmic_id_irq: IRQ number assigned for PMIC USB ID line. |
Jack Pham | 87f202f | 2012-08-06 00:24:22 -0700 | [diff] [blame] | 206 | * @mpm_otgsessvld_int: MPM wakeup pin assigned for OTG SESSVLD |
| 207 | * interrupt. Used when .otg_control == OTG_PHY_CONTROL. |
Vijayavardhan Vennapusa | 2239b2b | 2013-06-28 13:16:29 +0530 | [diff] [blame] | 208 | * @mpm_dpshv_int: MPM wakeup pin assigned for DP SHV interrupt. |
| 209 | * Used during host bus suspend. |
| 210 | * @mpm_dmshv_int: MPM wakeup pin assigned for DM SHV interrupt. |
| 211 | * Used during host bus suspend. |
Vijayavardhan Vennapusa | fc464f0 | 2011-11-04 21:54:00 +0530 | [diff] [blame] | 212 | * @mhl_enable: indicates MHL connector or not. |
Ofir Cohen | 4da266f | 2012-01-03 10:19:29 +0200 | [diff] [blame] | 213 | * @disable_reset_on_disconnect: perform USB PHY and LINK reset |
| 214 | * on USB cable disconnection. |
Manu Gautam | 0ddbd92 | 2012-09-21 17:17:38 +0530 | [diff] [blame] | 215 | * @pnoc_errata_fix: workaround needed for PNOC hardware bug that |
| 216 | * affects USB performance. |
Amit Blay | 6fa647a | 2012-05-24 14:12:08 +0300 | [diff] [blame] | 217 | * @enable_lpm_on_suspend: Enable the USB core to go into Low |
| 218 | * Power Mode, when USB bus is suspended but cable |
| 219 | * is connected. |
Amit Blay | 9b6e58b | 2012-06-18 13:12:49 +0300 | [diff] [blame] | 220 | * @core_clk_always_on_workaround: Don't disable core_clk when |
| 221 | * USB enters LPM. |
Amit Blay | d6f3828 | 2012-10-29 13:13:46 +0200 | [diff] [blame] | 222 | * @delay_lpm_on_disconnect: Use a delay before entering LPM |
| 223 | * upon USB cable disconnection. |
Manu Gautam | 0fd2d0e | 2013-03-26 18:09:11 +0530 | [diff] [blame] | 224 | * @enable_sec_phy: Use second HSPHY with USB2 core |
Manu Gautam | cd82e9d | 2011-12-20 14:17:28 +0530 | [diff] [blame] | 225 | * @bus_scale_table: parameters for bus bandwidth requirements |
Pavankumar Kondeti | 2aec9f3 | 2012-06-13 09:06:03 +0530 | [diff] [blame] | 226 | * @mhl_dev_name: MHL device name used to register with MHL driver. |
Amit Blay | b4f1453 | 2013-06-17 22:33:57 +0300 | [diff] [blame] | 227 | * @log2_itc: value of 2^(log2_itc-1) will be used as the |
| 228 | * interrupt threshold (ITC), when log2_itc is |
| 229 | * between 1 to 7. |
Shimrit Malichi | 5a2d5b5 | 2013-06-20 19:04:28 +0300 | [diff] [blame] | 230 | * @l1_supported: enable link power management support. |
Vijayavardhan Vennapusa | 8997e33 | 2013-07-15 09:53:51 +0530 | [diff] [blame] | 231 | * @dpdm_pulldown_added: Indicates whether pull down resistors are |
| 232 | connected on data lines or not. |
Pavankumar Kondeti | e0c201f | 2010-12-07 17:53:55 +0530 | [diff] [blame] | 233 | */ |
| 234 | struct msm_otg_platform_data { |
| 235 | int *phy_init_seq; |
Mayank Rana | 8549e63 | 2012-01-23 12:49:54 +0530 | [diff] [blame] | 236 | int (*vbus_power)(bool on); |
Pavankumar Kondeti | e0c201f | 2010-12-07 17:53:55 +0530 | [diff] [blame] | 237 | unsigned power_budget; |
| 238 | enum usb_mode_type mode; |
| 239 | enum otg_control_type otg_control; |
| 240 | enum usb_mode_type default_mode; |
Pavankumar Kondeti | d860852 | 2011-05-04 10:19:47 +0530 | [diff] [blame] | 241 | enum msm_usb_phy_type phy_type; |
Pavankumar Kondeti | e0c201f | 2010-12-07 17:53:55 +0530 | [diff] [blame] | 242 | void (*setup_gpio)(enum usb_otg_state state); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 243 | int pmic_id_irq; |
Jack Pham | 87f202f | 2012-08-06 00:24:22 -0700 | [diff] [blame] | 244 | unsigned int mpm_otgsessvld_int; |
Vijayavardhan Vennapusa | 2239b2b | 2013-06-28 13:16:29 +0530 | [diff] [blame] | 245 | unsigned int mpm_dpshv_int; |
| 246 | unsigned int mpm_dmshv_int; |
Vijayavardhan Vennapusa | fc464f0 | 2011-11-04 21:54:00 +0530 | [diff] [blame] | 247 | bool mhl_enable; |
Ofir Cohen | 4da266f | 2012-01-03 10:19:29 +0200 | [diff] [blame] | 248 | bool disable_reset_on_disconnect; |
Manu Gautam | 0ddbd92 | 2012-09-21 17:17:38 +0530 | [diff] [blame] | 249 | bool pnoc_errata_fix; |
Amit Blay | 6fa647a | 2012-05-24 14:12:08 +0300 | [diff] [blame] | 250 | bool enable_lpm_on_dev_suspend; |
Amit Blay | 9b6e58b | 2012-06-18 13:12:49 +0300 | [diff] [blame] | 251 | bool core_clk_always_on_workaround; |
Amit Blay | d6f3828 | 2012-10-29 13:13:46 +0200 | [diff] [blame] | 252 | bool delay_lpm_on_disconnect; |
Lena Salman | abde35d | 2013-04-25 15:29:43 +0300 | [diff] [blame] | 253 | bool delay_lpm_hndshk_on_disconnect; |
Vamsi Krishna | 1a1684b | 2013-03-02 16:14:52 -0800 | [diff] [blame] | 254 | bool dp_manual_pullup; |
Manu Gautam | 0fd2d0e | 2013-03-26 18:09:11 +0530 | [diff] [blame] | 255 | bool enable_sec_phy; |
Manu Gautam | cd82e9d | 2011-12-20 14:17:28 +0530 | [diff] [blame] | 256 | struct msm_bus_scale_pdata *bus_scale_table; |
Pavankumar Kondeti | 2aec9f3 | 2012-06-13 09:06:03 +0530 | [diff] [blame] | 257 | const char *mhl_dev_name; |
Amit Blay | b4f1453 | 2013-06-17 22:33:57 +0300 | [diff] [blame] | 258 | int log2_itc; |
Shimrit Malichi | 5a2d5b5 | 2013-06-20 19:04:28 +0300 | [diff] [blame] | 259 | bool l1_supported; |
Vijayavardhan Vennapusa | 8997e33 | 2013-07-15 09:53:51 +0530 | [diff] [blame] | 260 | bool dpdm_pulldown_added; |
Pavankumar Kondeti | e0c201f | 2010-12-07 17:53:55 +0530 | [diff] [blame] | 261 | }; |
| 262 | |
Vamsi Krishna | 1a1684b | 2013-03-02 16:14:52 -0800 | [diff] [blame] | 263 | /* phy related flags */ |
| 264 | #define ENABLE_DP_MANUAL_PULLUP BIT(0) |
Manu Gautam | 0fd2d0e | 2013-03-26 18:09:11 +0530 | [diff] [blame] | 265 | #define ENABLE_SECONDARY_PHY BIT(1) |
Vamsi Krishna | 1a1684b | 2013-03-02 16:14:52 -0800 | [diff] [blame] | 266 | |
Vijayavardhan Vennapusa | a315203 | 2012-03-05 16:29:30 +0530 | [diff] [blame] | 267 | /* Timeout (in msec) values (min - max) associated with OTG timers */ |
| 268 | |
| 269 | #define TA_WAIT_VRISE 100 /* ( - 100) */ |
| 270 | #define TA_WAIT_VFALL 500 /* ( - 1000) */ |
| 271 | |
| 272 | /* |
| 273 | * This option is set for embedded hosts or OTG devices in which leakage |
| 274 | * currents are very minimal. |
| 275 | */ |
| 276 | #ifdef CONFIG_USB_OTG |
| 277 | #define TA_WAIT_BCON 30000 /* (1100 - 30000) */ |
| 278 | #else |
| 279 | #define TA_WAIT_BCON -1 |
| 280 | #endif |
| 281 | |
| 282 | #define TA_AIDL_BDIS 500 /* (200 - ) */ |
| 283 | #define TA_BIDL_ADIS 155 /* (155 - 200) */ |
| 284 | #define TB_SRP_FAIL 6000 /* (5000 - 6000) */ |
| 285 | #define TB_ASE0_BRST 200 /* (155 - ) */ |
| 286 | |
| 287 | /* TB_SSEND_SRP and TB_SE0_SRP are combined */ |
| 288 | #define TB_SRP_INIT 2000 /* (1500 - ) */ |
| 289 | |
| 290 | #define TA_TST_MAINT 10100 /* (9900 - 10100) */ |
| 291 | #define TB_TST_SRP 3000 /* ( - 5000) */ |
| 292 | #define TB_TST_CONFIG 300 |
| 293 | |
| 294 | /* Timeout variables */ |
| 295 | |
| 296 | #define A_WAIT_VRISE 0 |
| 297 | #define A_WAIT_VFALL 1 |
| 298 | #define A_WAIT_BCON 2 |
| 299 | #define A_AIDL_BDIS 3 |
| 300 | #define A_BIDL_ADIS 4 |
| 301 | #define B_SRP_FAIL 5 |
| 302 | #define B_ASE0_BRST 6 |
| 303 | #define A_TST_MAINT 7 |
| 304 | #define B_TST_SRP 8 |
| 305 | #define B_TST_CONFIG 9 |
| 306 | |
Pavankumar Kondeti | e0c201f | 2010-12-07 17:53:55 +0530 | [diff] [blame] | 307 | /** |
| 308 | * struct msm_otg: OTG driver data. Shared by HCD and DCD. |
| 309 | * @otg: USB OTG Transceiver structure. |
| 310 | * @pdata: otg device platform data. |
| 311 | * @irq: IRQ number assigned for HSUSB controller. |
Manu Gautam | f8c4564 | 2012-08-10 10:20:56 -0700 | [diff] [blame] | 312 | * @async_irq: IRQ number used by some controllers during low power state |
Manu Gautam | 5143b25 | 2012-01-05 19:25:23 -0800 | [diff] [blame] | 313 | * @clk: clock struct of alt_core_clk. |
| 314 | * @pclk: clock struct of iface_clk. |
Manu Gautam | 5143b25 | 2012-01-05 19:25:23 -0800 | [diff] [blame] | 315 | * @core_clk: clock struct of core_bus_clk. |
Mayank Rana | dd1f1dc | 2013-07-24 17:02:45 +0530 | [diff] [blame] | 316 | * @sleep_clk: clock struct of sleep_clk for USB PHY. |
Mayank Rana | 3eaf28d | 2013-03-27 14:04:04 +0530 | [diff] [blame] | 317 | * @core_clk_rate: core clk max frequency |
Pavankumar Kondeti | e0c201f | 2010-12-07 17:53:55 +0530 | [diff] [blame] | 318 | * @regs: ioremapped register base address. |
| 319 | * @inputs: OTG state machine inputs(Id, SessValid etc). |
| 320 | * @sm_work: OTG state machine work. |
Pavankumar Kondeti | 87c0104 | 2010-12-07 17:53:58 +0530 | [diff] [blame] | 321 | * @in_lpm: indicates low power mode (LPM) state. |
Manu Gautam | f8c4564 | 2012-08-10 10:20:56 -0700 | [diff] [blame] | 322 | * @async_int: IRQ line on which ASYNC interrupt arrived in LPM. |
Pavankumar Kondeti | d860852 | 2011-05-04 10:19:47 +0530 | [diff] [blame] | 323 | * @cur_power: The amount of mA available from downstream port. |
| 324 | * @chg_work: Charger detection work. |
| 325 | * @chg_state: The state of charger detection process. |
| 326 | * @chg_type: The type of charger attached. |
| 327 | * @dcd_retires: The retry count used to track Data contact |
| 328 | * detection process. |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 329 | * @wlock: Wake lock struct to prevent system suspend when |
| 330 | * USB is active. |
| 331 | * @usbdev_nb: The notifier block used to know about the B-device |
| 332 | * connected. Useful only when ACA_A charger is |
| 333 | * connected. |
| 334 | * @mA_port: The amount of current drawn by the attached B-device. |
Pavankumar Kondeti | aa449e1 | 2011-11-04 11:09:26 +0530 | [diff] [blame] | 335 | * @id_timer: The timer used for polling ID line to detect ACA states. |
Anji jonnala | 7da3f26 | 2011-12-02 17:22:14 -0800 | [diff] [blame] | 336 | * @xo_handle: TCXO buffer handle |
Manu Gautam | cd82e9d | 2011-12-20 14:17:28 +0530 | [diff] [blame] | 337 | * @bus_perf_client: Bus performance client handle to request BUS bandwidth |
Pavankumar Kondeti | 2aec9f3 | 2012-06-13 09:06:03 +0530 | [diff] [blame] | 338 | * @mhl_enabled: MHL driver registration successful and MHL enabled. |
Vijayavardhan Vennapusa | 2239b2b | 2013-06-28 13:16:29 +0530 | [diff] [blame] | 339 | * @host_bus_suspend: indicates host bus suspend or not. |
Pavankumar Kondeti | 458d879 | 2012-09-28 14:45:18 +0530 | [diff] [blame] | 340 | * @chg_check_timer: The timer used to implement the workaround to detect |
| 341 | * very slow plug in of wall charger. |
Sujeet Kumar | ceee6e8 | 2013-09-06 11:22:49 +0530 | [diff] [blame] | 342 | * @ui_enabled: USB Intterupt is enabled or disabled. |
Pavankumar Kondeti | e0c201f | 2010-12-07 17:53:55 +0530 | [diff] [blame] | 343 | */ |
| 344 | struct msm_otg { |
Heikki Krogerus | 1d4c929 | 2012-02-13 13:24:09 +0200 | [diff] [blame] | 345 | struct usb_phy phy; |
Pavankumar Kondeti | e0c201f | 2010-12-07 17:53:55 +0530 | [diff] [blame] | 346 | struct msm_otg_platform_data *pdata; |
| 347 | int irq; |
Manu Gautam | f8c4564 | 2012-08-10 10:20:56 -0700 | [diff] [blame] | 348 | int async_irq; |
Vijayavardhan Vennapusa | 0cab617 | 2013-02-20 19:51:15 +0530 | [diff] [blame] | 349 | struct clk *xo_clk; |
Pavankumar Kondeti | e0c201f | 2010-12-07 17:53:55 +0530 | [diff] [blame] | 350 | struct clk *clk; |
| 351 | struct clk *pclk; |
Pavankumar Kondeti | e0c201f | 2010-12-07 17:53:55 +0530 | [diff] [blame] | 352 | struct clk *core_clk; |
Mayank Rana | dd1f1dc | 2013-07-24 17:02:45 +0530 | [diff] [blame] | 353 | struct clk *sleep_clk; |
Mayank Rana | 3eaf28d | 2013-03-27 14:04:04 +0530 | [diff] [blame] | 354 | long core_clk_rate; |
Pavankumar Kondeti | f1ffbdd | 2013-06-27 13:31:36 +0530 | [diff] [blame] | 355 | struct resource *io_res; |
Pavankumar Kondeti | e0c201f | 2010-12-07 17:53:55 +0530 | [diff] [blame] | 356 | void __iomem *regs; |
| 357 | #define ID 0 |
| 358 | #define B_SESS_VLD 1 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 359 | #define ID_A 2 |
| 360 | #define ID_B 3 |
| 361 | #define ID_C 4 |
Vijayavardhan Vennapusa | a315203 | 2012-03-05 16:29:30 +0530 | [diff] [blame] | 362 | #define A_BUS_DROP 5 |
| 363 | #define A_BUS_REQ 6 |
| 364 | #define A_SRP_DET 7 |
| 365 | #define A_VBUS_VLD 8 |
| 366 | #define B_CONN 9 |
| 367 | #define ADP_CHANGE 10 |
| 368 | #define POWER_UP 11 |
| 369 | #define A_CLR_ERR 12 |
| 370 | #define A_BUS_RESUME 13 |
| 371 | #define A_BUS_SUSPEND 14 |
| 372 | #define A_CONN 15 |
| 373 | #define B_BUS_REQ 16 |
Pavankumar Kondeti | 2aec9f3 | 2012-06-13 09:06:03 +0530 | [diff] [blame] | 374 | #define MHL 17 |
Pavankumar Kondeti | 458d879 | 2012-09-28 14:45:18 +0530 | [diff] [blame] | 375 | #define B_FALSE_SDP 18 |
Pavankumar Kondeti | e0c201f | 2010-12-07 17:53:55 +0530 | [diff] [blame] | 376 | unsigned long inputs; |
| 377 | struct work_struct sm_work; |
Jack Pham | 5ca279b | 2012-05-14 18:42:54 -0700 | [diff] [blame] | 378 | bool sm_work_pending; |
| 379 | atomic_t pm_suspended; |
Pavankumar Kondeti | 87c0104 | 2010-12-07 17:53:58 +0530 | [diff] [blame] | 380 | atomic_t in_lpm; |
| 381 | int async_int; |
Pavankumar Kondeti | d860852 | 2011-05-04 10:19:47 +0530 | [diff] [blame] | 382 | unsigned cur_power; |
| 383 | struct delayed_work chg_work; |
Vijayavardhan Vennapusa | 68d55cf | 2012-06-27 20:06:12 +0530 | [diff] [blame] | 384 | struct delayed_work pmic_id_status_work; |
Amit Blay | d0fe07b | 2012-09-05 16:42:09 +0300 | [diff] [blame] | 385 | struct delayed_work suspend_work; |
Pavankumar Kondeti | d860852 | 2011-05-04 10:19:47 +0530 | [diff] [blame] | 386 | enum usb_chg_state chg_state; |
| 387 | enum usb_chg_type chg_type; |
Pavankumar Kondeti | ebb4a2d | 2013-01-04 12:28:10 +0530 | [diff] [blame] | 388 | unsigned dcd_time; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 389 | struct wake_lock wlock; |
| 390 | struct notifier_block usbdev_nb; |
| 391 | unsigned mA_port; |
Pavankumar Kondeti | aa449e1 | 2011-11-04 11:09:26 +0530 | [diff] [blame] | 392 | struct timer_list id_timer; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 393 | unsigned long caps; |
Stephen Boyd | 30ad10b | 2012-03-01 14:51:04 -0800 | [diff] [blame] | 394 | struct msm_xo_voter *xo_handle; |
Manu Gautam | cd82e9d | 2011-12-20 14:17:28 +0530 | [diff] [blame] | 395 | uint32_t bus_perf_client; |
Pavankumar Kondeti | 2aec9f3 | 2012-06-13 09:06:03 +0530 | [diff] [blame] | 396 | bool mhl_enabled; |
Vijayavardhan Vennapusa | 2239b2b | 2013-06-28 13:16:29 +0530 | [diff] [blame] | 397 | bool host_bus_suspend; |
Pavankumar Kondeti | 458d879 | 2012-09-28 14:45:18 +0530 | [diff] [blame] | 398 | struct timer_list chg_check_timer; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 399 | /* |
| 400 | * Allowing PHY power collpase turns off the HSUSB 3.3v and 1.8v |
| 401 | * analog regulators while going to low power mode. |
Amit Blay | 81801aa | 2012-09-19 12:08:12 +0200 | [diff] [blame] | 402 | * Currently only 28nm PHY has the support to allowing PHY |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 403 | * power collapse since it doesn't have leakage currents while |
| 404 | * turning off the power rails. |
| 405 | */ |
| 406 | #define ALLOW_PHY_POWER_COLLAPSE BIT(0) |
| 407 | /* |
| 408 | * Allow PHY RETENTION mode before turning off the digital |
| 409 | * voltage regulator(VDDCX). |
| 410 | */ |
| 411 | #define ALLOW_PHY_RETENTION BIT(1) |
Amit Blay | 6fa647a | 2012-05-24 14:12:08 +0300 | [diff] [blame] | 412 | /* |
| 413 | * Allow putting the core in Low Power mode, when |
| 414 | * USB bus is suspended but cable is connected. |
| 415 | */ |
Amit Blay | 81801aa | 2012-09-19 12:08:12 +0200 | [diff] [blame] | 416 | #define ALLOW_LPM_ON_DEV_SUSPEND BIT(2) |
| 417 | /* |
| 418 | * Allowing PHY regulators LPM puts the HSUSB 3.3v and 1.8v |
| 419 | * analog regulators into LPM while going to USB low power mode. |
| 420 | */ |
| 421 | #define ALLOW_PHY_REGULATORS_LPM BIT(3) |
Vijayavardhan Vennapusa | 2239b2b | 2013-06-28 13:16:29 +0530 | [diff] [blame] | 422 | /* |
| 423 | * Allow PHY RETENTION mode before turning off the digital |
| 424 | * voltage regulator(VDDCX) during host mode. |
| 425 | */ |
| 426 | #define ALLOW_HOST_PHY_RETENTION BIT(4) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 427 | unsigned long lpm_flags; |
| 428 | #define PHY_PWR_COLLAPSED BIT(0) |
| 429 | #define PHY_RETENTIONED BIT(1) |
Vijayavardhan Vennapusa | bbdd608 | 2012-06-06 14:14:25 +0530 | [diff] [blame] | 430 | #define XO_SHUTDOWN BIT(2) |
Ido Shayevitz | c5c0f57 | 2012-07-31 13:58:45 +0300 | [diff] [blame] | 431 | #define CLOCKS_DOWN BIT(3) |
Amit Blay | 81801aa | 2012-09-19 12:08:12 +0200 | [diff] [blame] | 432 | #define PHY_REGULATORS_LPM BIT(4) |
Ofir Cohen | 4da266f | 2012-01-03 10:19:29 +0200 | [diff] [blame] | 433 | int reset_counter; |
Vijayavardhan Vennapusa | a315203 | 2012-03-05 16:29:30 +0530 | [diff] [blame] | 434 | unsigned long b_last_se0_sess; |
| 435 | unsigned long tmouts; |
| 436 | u8 active_tmout; |
| 437 | struct hrtimer timer; |
Mayank Rana | 248698c | 2012-04-19 00:03:16 +0530 | [diff] [blame] | 438 | enum usb_vdd_type vdd_type; |
David Keitel | 272ce52 | 2012-08-17 16:25:24 -0700 | [diff] [blame] | 439 | struct power_supply usb_psy; |
| 440 | unsigned int online; |
| 441 | unsigned int host_mode; |
Pavankumar Kondeti | 254e38d | 2013-07-16 11:13:05 +0530 | [diff] [blame] | 442 | unsigned int voltage_max; |
David Keitel | 272ce52 | 2012-08-17 16:25:24 -0700 | [diff] [blame] | 443 | unsigned int current_max; |
Wu Fenglin | 04ae6de | 2013-09-09 19:15:06 +0800 | [diff] [blame] | 444 | unsigned int usbin_health; |
Pavankumar Kondeti | f1ffbdd | 2013-06-27 13:31:36 +0530 | [diff] [blame] | 445 | |
| 446 | dev_t ext_chg_dev; |
| 447 | struct cdev ext_chg_cdev; |
| 448 | struct class *ext_chg_class; |
| 449 | struct device *ext_chg_device; |
| 450 | bool ext_chg_opened; |
| 451 | bool ext_chg_active; |
| 452 | struct completion ext_chg_wait; |
Sujeet Kumar | ceee6e8 | 2013-09-06 11:22:49 +0530 | [diff] [blame] | 453 | int ui_enabled; |
Pavankumar Kondeti | e0c201f | 2010-12-07 17:53:55 +0530 | [diff] [blame] | 454 | }; |
| 455 | |
Amit Blay | b4f1453 | 2013-06-17 22:33:57 +0300 | [diff] [blame] | 456 | struct ci13xxx_platform_data { |
| 457 | u8 usb_core_id; |
| 458 | /* |
| 459 | * value of 2^(log2_itc-1) will be used as the interrupt threshold |
| 460 | * (ITC), when log2_itc is between 1 to 7. |
| 461 | */ |
| 462 | int log2_itc; |
| 463 | void *prv_data; |
Shimrit Malichi | 5a2d5b5 | 2013-06-20 19:04:28 +0300 | [diff] [blame] | 464 | bool l1_supported; |
Amit Blay | b4f1453 | 2013-06-17 22:33:57 +0300 | [diff] [blame] | 465 | }; |
| 466 | |
Manu Gautam | caa99d4 | 2013-07-25 12:01:02 +0530 | [diff] [blame] | 467 | /** |
| 468 | * struct msm_hsic_host_platform_data - platform device data |
| 469 | * for msm_hsic_host driver. |
| 470 | * @phy_sof_workaround: Enable ALL PHY SOF bug related workarounds for |
| 471 | SUSPEND, RESET and RESUME. |
| 472 | * @phy_susp_sof_workaround: Enable PHY SOF workaround only for SUSPEND. |
| 473 | * |
| 474 | */ |
Vijayavardhan Vennapusa | e3316a1 | 2011-10-15 06:05:17 +0530 | [diff] [blame] | 475 | struct msm_hsic_host_platform_data { |
| 476 | unsigned strobe; |
| 477 | unsigned data; |
Manu Gautam | 863b7413 | 2012-11-21 14:30:04 +0530 | [diff] [blame] | 478 | bool ignore_cal_pad_config; |
Manu Gautam | 3c59839 | 2013-03-22 16:59:10 +0530 | [diff] [blame] | 479 | bool phy_sof_workaround; |
Manu Gautam | caa99d4 | 2013-07-25 12:01:02 +0530 | [diff] [blame] | 480 | bool phy_susp_sof_workaround; |
Ming-yi Lin | 9eed5e0 | 2013-07-18 14:06:24 +0800 | [diff] [blame] | 481 | u32 reset_delay; |
Manu Gautam | 863b7413 | 2012-11-21 14:30:04 +0530 | [diff] [blame] | 482 | int strobe_pad_offset; |
| 483 | int data_pad_offset; |
| 484 | |
Hemant Kumar | e627597 | 2012-02-29 20:06:21 -0800 | [diff] [blame] | 485 | struct msm_bus_scale_pdata *bus_scale_table; |
Hemant Kumar | 30d361c | 2012-08-20 14:44:40 -0700 | [diff] [blame] | 486 | unsigned log2_irq_thresh; |
Hemant Kumar | bc8bdf6 | 2012-10-17 12:29:51 -0700 | [diff] [blame] | 487 | |
Vamsi Krishna | bef9183 | 2013-03-11 14:10:20 -0700 | [diff] [blame] | 488 | /* gpio used to resume peripheral */ |
| 489 | unsigned resume_gpio; |
| 490 | |
Hemant Kumar | bc8bdf6 | 2012-10-17 12:29:51 -0700 | [diff] [blame] | 491 | /*swfi latency is required while driving resume on to the bus */ |
Pavankumar Kondeti | 4f5dc3b | 2012-09-07 15:33:09 +0530 | [diff] [blame] | 492 | u32 swfi_latency; |
Hemant Kumar | bc8bdf6 | 2012-10-17 12:29:51 -0700 | [diff] [blame] | 493 | |
| 494 | /*standalone latency is required when HSCI is active*/ |
| 495 | u32 standalone_latency; |
Shimrit Malichi | 36a0c85 | 2013-03-10 11:39:10 +0200 | [diff] [blame] | 496 | bool pool_64_bit_align; |
Shimrit Malichi | 82d7cbc | 2013-03-12 15:36:54 +0200 | [diff] [blame] | 497 | bool enable_hbm; |
Shimrit Malichi | 08f0734 | 2013-04-24 13:09:12 +0300 | [diff] [blame] | 498 | bool disable_park_mode; |
Ido Shayevitz | aa165c5 | 2013-05-12 16:01:28 +0200 | [diff] [blame] | 499 | bool consider_ipa_handshake; |
Amit Blay | 1dfbbcc | 2013-05-26 17:33:13 +0300 | [diff] [blame] | 500 | bool ahb_async_bridge_bypass; |
Vamsi Krishna | 4f66c2c | 2013-06-21 11:33:59 -0700 | [diff] [blame] | 501 | bool disable_cerr; |
Vijayavardhan Vennapusa | e3316a1 | 2011-10-15 06:05:17 +0530 | [diff] [blame] | 502 | }; |
| 503 | |
Manu Gautam | 91223e0 | 2011-11-08 15:27:22 +0530 | [diff] [blame] | 504 | struct msm_usb_host_platform_data { |
| 505 | unsigned int power_budget; |
Vijayavardhan Vennapusa | 4fa1369 | 2012-08-02 14:35:03 +0530 | [diff] [blame] | 506 | int pmic_gpio_dp_irq; |
Hemant Kumar | 5692535 | 2012-02-13 16:59:52 -0800 | [diff] [blame] | 507 | unsigned int dock_connect_irq; |
Vijayavardhan Vennapusa | 1f5da0b | 2013-01-08 20:03:57 +0530 | [diff] [blame] | 508 | bool use_sec_phy; |
Hemant Kumar | b8fc959 | 2013-04-17 19:29:39 -0700 | [diff] [blame] | 509 | bool no_selective_suspend; |
Hemant Kumar | a7d531d | 2013-06-18 22:12:18 -0700 | [diff] [blame] | 510 | int resume_gpio; |
Manu Gautam | 91223e0 | 2011-11-08 15:27:22 +0530 | [diff] [blame] | 511 | }; |
| 512 | |
Amit Blay | 9b6e58b | 2012-06-18 13:12:49 +0300 | [diff] [blame] | 513 | /** |
| 514 | * struct msm_hsic_peripheral_platform_data: HSIC peripheral |
| 515 | * platform data. |
| 516 | * @core_clk_always_on_workaround: Don't disable core_clk when |
| 517 | * HSIC enters LPM. |
| 518 | */ |
Amit Blay | 4d57d36 | 2012-04-28 11:00:21 +0300 | [diff] [blame] | 519 | struct msm_hsic_peripheral_platform_data { |
Amit Blay | 9b6e58b | 2012-06-18 13:12:49 +0300 | [diff] [blame] | 520 | bool core_clk_always_on_workaround; |
Amit Blay | 4d57d36 | 2012-04-28 11:00:21 +0300 | [diff] [blame] | 521 | }; |
| 522 | |
Jack Pham | fadd643 | 2012-12-07 19:03:41 -0800 | [diff] [blame] | 523 | /** |
| 524 | * struct usb_ext_notification: event notification structure |
| 525 | * @notify: pointer to client function to call when ID event is detected. |
Jack Pham | b720915 | 2013-07-03 17:04:53 -0700 | [diff] [blame] | 526 | * The function parameter is provided by driver to be called back when |
Jack Pham | fadd643 | 2012-12-07 19:03:41 -0800 | [diff] [blame] | 527 | * external client indicates it is done using the USB. This function |
| 528 | * should return 0 if handled successfully, otherise an error code. |
| 529 | * @ctxt: client-specific context pointer |
| 530 | * |
| 531 | * This structure should be used by clients wishing to register (via |
| 532 | * msm_register_usb_ext_notification) for event notification whenever a USB |
| 533 | * cable is plugged in and ID pin status changes. Clients must provide a |
| 534 | * callback function pointer. If this callback returns 0, the USB driver will |
| 535 | * assume the client is "taking over" the connection, and will relinquish any |
| 536 | * further processing until its callback (passed via the third parameter) is |
| 537 | * called with the online parameter set to false. |
| 538 | */ |
| 539 | struct usb_ext_notification { |
Jack Pham | b720915 | 2013-07-03 17:04:53 -0700 | [diff] [blame] | 540 | int (*notify)(void *, int, void (*)(void *, int online), void *); |
Jack Pham | fadd643 | 2012-12-07 19:03:41 -0800 | [diff] [blame] | 541 | void *ctxt; |
| 542 | }; |
Lena Salman | abde35d | 2013-04-25 15:29:43 +0300 | [diff] [blame] | 543 | #ifdef CONFIG_USB_BAM |
| 544 | bool msm_bam_lpm_ok(void); |
Ido Shayevitz | 44ca03c | 2013-07-09 15:57:21 +0300 | [diff] [blame] | 545 | void msm_bam_notify_lpm_resume(void); |
Ido Shayevitz | aa165c5 | 2013-05-12 16:01:28 +0200 | [diff] [blame] | 546 | void msm_bam_set_hsic_host_dev(struct device *dev); |
| 547 | void msm_bam_wait_for_hsic_prod_granted(void); |
| 548 | bool msm_bam_hsic_lpm_ok(void); |
| 549 | void msm_bam_hsic_notify_on_resume(void); |
Lena Salman | abde35d | 2013-04-25 15:29:43 +0300 | [diff] [blame] | 550 | #else |
| 551 | static inline bool msm_bam_lpm_ok(void) { return true; } |
Ido Shayevitz | 44ca03c | 2013-07-09 15:57:21 +0300 | [diff] [blame] | 552 | static inline void msm_bam_notify_lpm_resume(void) {} |
Ido Shayevitz | aa165c5 | 2013-05-12 16:01:28 +0200 | [diff] [blame] | 553 | static inline void msm_bam_set_hsic_host_dev(struct device *dev) {} |
| 554 | static inline void msm_bam_wait_for_hsic_prod_granted(void) {} |
| 555 | static inline bool msm_bam_hsic_lpm_ok(void) { return true; } |
| 556 | static inline void msm_bam_hsic_notify_on_resume(void) {} |
Lena Salman | abde35d | 2013-04-25 15:29:43 +0300 | [diff] [blame] | 557 | #endif |
Amit Blay | 1572b49 | 2012-11-27 16:45:32 +0200 | [diff] [blame] | 558 | #ifdef CONFIG_USB_CI13XXX_MSM |
| 559 | void msm_hw_bam_disable(bool bam_disable); |
Amit Blay | 1572b49 | 2012-11-27 16:45:32 +0200 | [diff] [blame] | 560 | #else |
| 561 | static inline void msm_hw_bam_disable(bool bam_disable) |
| 562 | { |
| 563 | } |
| 564 | #endif |
| 565 | |
Shimrit Malichi | 255b534 | 2012-08-02 21:01:43 +0300 | [diff] [blame] | 566 | #ifdef CONFIG_USB_DWC3_MSM |
Ido Shayevitz | 9fb8345 | 2012-04-01 17:45:58 +0300 | [diff] [blame] | 567 | int msm_ep_config(struct usb_ep *ep); |
| 568 | int msm_ep_unconfig(struct usb_ep *ep); |
Vijayavardhan Vennapusa | fc3db60 | 2013-08-20 17:54:54 +0530 | [diff] [blame] | 569 | void dwc3_tx_fifo_resize_request(struct usb_ep *ep, bool qdss_enable); |
Shimrit Malichi | 255b534 | 2012-08-02 21:01:43 +0300 | [diff] [blame] | 570 | int msm_data_fifo_config(struct usb_ep *ep, u32 addr, u32 size, |
| 571 | u8 dst_pipe_idx); |
Ido Shayevitz | 9fb8345 | 2012-04-01 17:45:58 +0300 | [diff] [blame] | 572 | |
Jack Pham | 62c19a4 | 2013-07-09 17:55:09 -0700 | [diff] [blame] | 573 | void msm_dwc3_restart_usb_session(struct usb_gadget *gadget); |
Jack Pham | fadd643 | 2012-12-07 19:03:41 -0800 | [diff] [blame] | 574 | |
Manu Gautam | 6eb13e3 | 2013-02-01 15:19:15 +0530 | [diff] [blame] | 575 | int msm_register_usb_ext_notification(struct usb_ext_notification *info); |
Shimrit Malichi | 255b534 | 2012-08-02 21:01:43 +0300 | [diff] [blame] | 576 | #else |
| 577 | static inline int msm_data_fifo_config(struct usb_ep *ep, u32 addr, u32 size, |
| 578 | u8 dst_pipe_idx) |
| 579 | { |
| 580 | return -ENODEV; |
| 581 | } |
| 582 | |
| 583 | static inline int msm_ep_config(struct usb_ep *ep) |
| 584 | { |
| 585 | return -ENODEV; |
| 586 | } |
| 587 | |
| 588 | static inline int msm_ep_unconfig(struct usb_ep *ep) |
| 589 | { |
| 590 | return -ENODEV; |
| 591 | } |
Jack Pham | fadd643 | 2012-12-07 19:03:41 -0800 | [diff] [blame] | 592 | |
Vijayavardhan Vennapusa | fc3db60 | 2013-08-20 17:54:54 +0530 | [diff] [blame] | 593 | static inline void dwc3_tx_fifo_resize_request( |
| 594 | struct usb_ep *ep, bool qdss_enable) |
| 595 | { |
| 596 | return; |
| 597 | } |
| 598 | |
Jack Pham | 62c19a4 | 2013-07-09 17:55:09 -0700 | [diff] [blame] | 599 | static inline void msm_dwc3_restart_usb_session(struct usb_gadget *gadget) |
Manu Gautam | 6eb13e3 | 2013-02-01 15:19:15 +0530 | [diff] [blame] | 600 | { |
| 601 | return; |
| 602 | } |
| 603 | |
Jack Pham | fadd643 | 2012-12-07 19:03:41 -0800 | [diff] [blame] | 604 | static inline int msm_register_usb_ext_notification( |
| 605 | struct usb_ext_notification *info) |
| 606 | { |
| 607 | return -ENODEV; |
| 608 | } |
Shimrit Malichi | 255b534 | 2012-08-02 21:01:43 +0300 | [diff] [blame] | 609 | #endif |
Pavankumar Kondeti | e0c201f | 2010-12-07 17:53:55 +0530 | [diff] [blame] | 610 | #endif |