summaryrefslogtreecommitdiff
path: root/drivers/usb
AgeCommit message (Collapse)Author
2016-12-19Merge "usb: gadget: composite: Add spinlock protection for usb string ↵Linux Build Service Account
descriptor"
2016-12-13Merge "USB: dwc3: msm: Fail probe if core-clk-rate is not passed from dts"Linux Build Service Account
2016-12-13Merge "USB: dwc3-msm: Check endpoint status and request queued or not first"Linux Build Service Account
2016-12-13Merge "USB: dwc3-msm: Initialize DBM ep before BAM pipe reset"Linux Build Service Account
2016-12-13Merge "usb: dwc3-msm: Set PROP_BOOST_CURRENT for direct attach devices"Linux Build Service Account
2016-12-12USB: dwc3: msm: Fail probe if core-clk-rate is not passed from dtsVijayavardhan Vennapusa
Currently USB driver is not failing probe if USB core-clk-rate property is not exist. This leads to USB enumeration failures across connect/ disconnect. Hence make core-clk-rate property mandatory and if in case not defined, fail the probe. Also Fail probe if extcon property not defined in case of OTG mode. Also return error if dwc3_core_pre_init() fails during dwc3-msm_resume() due to phy init fails and don't go ahead with setting up event buffers as event buffers allocation is done. Change-Id: I3927ad2f670e45acd10f8568857cf9f3434df657 Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
2016-12-12usb: dwc3-msm: Set PROP_BOOST_CURRENT for direct attach devicesJack Pham
If PMIC provides boost power for VBUS in host mode, it may need to know the amount of current of an attached device in order to optimize for overall power consumption. We can pass the bMaxPower obtained from a device's configuration descriptor when it is attached. This only affects devices (including hubs) directly attached to the root port, as any device downstream of a hub will either consume part of the hub's budget or has external power. Change-Id: I1ad2cfecb7a2f6bdeaced29a1753cdc1bf3849db Signed-off-by: Jack Pham <jackp@codeaurora.org>
2016-12-12dwc3: gadget: Increase TXFIFO size as 3KB with endless USB IN endpointMayank Rana
Current code is resizing each USB IN endpoint's TXFIFO to 1KB if it is not USB GSI endpoint or bursting is not enable. In some high throughput test case where there is contention in terms of accessing DDR memory through SNOC between USB3 and other peripheral PCIE, there are many underrun errors (i.e. Bad Data Length/Bad CRC) observed. These errors results into retransmision of USB packets and sometime dropping packets causing diffrent kind of data stalls. Hence fix this issue by increasing TXFIFO size as 3KB with endless USB IN endpoint (i.e. USB BAM2BAM endpoint) which helps to successfully retransmit packets. Change-Id: I73860a7bb252a0226b591a5f732e6a7b864911cf Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2016-12-12USB: dwc3-msm: Check endpoint status and request queued or not firstVijayavardhan Vennapusa
When function driver calls dwc3_msm_ep_queue() to queue endless request, first check endpoint status and whether any request already queued or not. If that is the case, return error. Else go ahead with queuing request to USB HW. This helps in resolving the crash seen when request is being queued again. Change-Id: I3d6a603c693d1df36719f57684ffad409e1a0e78 Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org> Signed-off-by: Chandana Kishori Chiluveru <cchiluve@codeaurora.org>
2016-12-12USB: dwc3-msm: Initialize DBM ep before BAM pipe resetVijayavardhan Vennapusa
On new platforms, endpoint clock gating is added for dbm endpoints with Synopsys USB3.0 controller. This hardware feature requires initialization of DBM endpoint before BAM pipe reset for bam2bam mode data transfers working. Hence change sequence such that do DBM endpoint initialization first followed by BAM pipe reset and do start transfer as last operation. CRs-Fixed: 965207 Change-Id: Ib5bfd1a7d258fe336a4c9924850fc9223c1c81f6 Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org> Signed-off-by: Chandana Kishori Chiluveru <cchiluve@codeaurora.org>
2016-12-08usb: phy: qusb2: Add support to vote for regulator L2aHemant Kumar
L2a is required to lock the phy PLL upon bus resume when exiting from XO shutdown. This LDO powers REFGEN block which is required to be powered on so that phy PLL gets locked as part of wakeup from XO shutdown. Change-Id: Ia0e3d574de7c78534832e4f8749672eb6fcde1f0 Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
2016-12-06Merge "USB: dwc3: msm: Add support for vote/devote aggre2_snoc_axi_clk"Linux Build Service Account
2016-12-02Merge "usb: gadget: f_rmnet: Add support for configfs"Linux Build Service Account
2016-12-02USB: dwc3: msm: Add support for vote/devote aggre2_snoc_axi_clkVijayavardhan Vennapusa
It is required to put/get vote for aggre2_snoc_axi_clk before turning ON USB core clock for read/write transactions to be successful over NOC from USB->DDR. Hence add support for voting aggre2_snoc_axi_clk before enabling USB core clock as part of exiting low power mode. Change-Id: Icb17d65fbbe49d93971905948c3dc9ab17de152a Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
2016-12-01usb: gadget: composite: Add spinlock protection for usb string descriptorChandana Kishori Chiluveru
During composition switch, android driver stops data transfers first and removes configuration before disabling the pullup. With this sequence there is a possibility for a race where usb_remove_config is in progress during which pullup is active and sending the setup request for strings with zero configuration value. Hence fix the issue by adding spinlock protection for get_sring descriptor. Change-Id: I13c601f0e48d847b322a2761cd52268963cacf01 Signed-off-by: Chandana Kishori Chiluveru <cchiluve@codeaurora.org>
2016-12-01usb: gadget: f_rmnet: Add support for configfsAjay Agarwal
Add APIs to allocate and instanciate f_rmnet function driver using configFS. Change-Id: Iad76a7e317dd9caf846dbe870baee63a8c5ce6c1 Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
2016-11-30usb: gadget: Add RMNET support using IPA over BAM2BAMAjay Agarwal
This change adds RMNET support using IPA over BAM2BAM. Removes all different supported control and data transports and assumes BAM2BAM_IPA as default mode. Cleans up QTI Control driver to support only RMNET and DPL. Change-Id: I5b763acfb28c2f1832874af786704835314fa9c7 Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
2016-11-29Merge "usb: gadget: Notify QTI upon cable connect for DPL"Linux Build Service Account
2016-11-28Merge "usb: pd: pdphy: Update Tx Trim setting"Linux Build Service Account
2016-11-28Merge "USB: dwc3-msm: clear in_restart flag always in restart work"Linux Build Service Account
2016-11-28Merge "USB: dwc3-msm: Fix issue related to error recovery for ERRATIC ERROR"Linux Build Service Account
2016-11-26Merge "usb: dwc3-msm: Fix restart usb work functionality"Linux Build Service Account
2016-11-26Merge "usb: pd: Support Android dual_role_usb sysfs class"Linux Build Service Account
2016-11-26Merge "usb: pd: Fix VDM and misc timing issues"Linux Build Service Account
2016-11-25USB: dwc3-msm: Fix issue related to error recovery for ERRATIC ERRORVijayavardhan Vennapusa
If ERRATIC event irq is triggered by USB controller, it requires to perform block reset USB controller as recovery mechanism as per SNPS data book. Error recovery happens through allowing USB entering low power mode and exit low power mode. We might see recovery failing as check for P3 state is true as part of suspend and results in USB not entering low power mode. Fix this issue by allowing USB enter low power mode in case of recovery flag mdwc->in_restart set. CRs-Fixed: 1060831 Change-Id: I41f935da3d4af1dd04eb4b3299e36a0f528633da Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
2016-11-24usb: dwc3-msm: Fix restart usb work functionalityAzhar Shaikh
Commit 18cd808986ba101d ("usb: dwc3-msm: Make power collapse and power-on-reset mandatory") removed the device tree properties for power-collapse due to which the dwc3_restart_usb_work() which was supposed to do a full POR sequence by simulating a cable disconnection-reconnection sequence now only does a dbm reset. Fix this, so that dwc3_restart_usb_work(), does a full POR. CRs-Fixed: 975249 Change-Id: Iaabe9283ec80954a2e504a55f2b4cdf93ca8ae46 Signed-off-by: Azhar Shaikh <azhars@codeaurora.org>
2016-11-25USB: dwc3-msm: clear in_restart flag always in restart workVijayavardhan Vennapusa
Currenlty driver is clearing mdwc->inrestart flag only if vbus_active is high only after making sure USB entered low power mode. There is a chance cable is disconnected during execution of restart work and endup not clearing mdwc->in_restart flag if disconnect happens. Hence fix this by clearing mdwc->in_restart flag always irrespective of vbus_active set or cleared. Change-Id: I15fa1893c798946c7514bf8cb23773b5784e671e Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
2016-11-24Merge "USB: gagget: f_fs: Return error if TX req is queued during device ↵Linux Build Service Account
offline"
2016-11-23usb: pd: pdphy: Update Tx Trim settingJack Pham
HW recommendation is to set the TX_TRIM_3 value to 0x2 for a steeper slope. This improves eye diagram testing result. This register is secure access so write to the SEC_ACCESS prior to setting this. Change-Id: I80b0a02feb0e4d1fb382407087fa30f390641ccb Signed-off-by: Jack Pham <jackp@codeaurora.org>
2016-11-23usb: pd: Fix VDM and misc timing issuesJack Pham
Decrease the wait time from 5ms to 2ms when preparing a VDM response to ensure that it gets sent out timely within tSenderResponse (15ms). To avoid possible collision with an incoming packet, check that there has not been any queued Rx message just prior to sending a VDM. Also check the result of the transmit and simply try again later if -EBUSY is returned. While at it, fix a couple other miscellaneous timing issues. Setting PD_ACTIVE=1 has considerable delay due to the charger's voting mechanism, so move setting it to after starting the SenderResponse timer when sending the Source Capabilities, and similarly after sending a Request as a sink, in order to make sure response timing is met. For source hard reset, increase the tSrcRecover delay slightly from the spec minimum to account for additional VBUS rise/fall delays before sending PS_RDY. Finally, add a delay for VCONN_SWAP before sending PS_RDY for similar reason. Change-Id: I5760fadb66cad6faf02e95a1e1bb975289ef8e9f Signed-off-by: Jack Pham <jackp@codeaurora.org>
2016-11-23usb: pd: pdphy: Acknowledge Rx soonerJack Pham
To avoid missing an incoming packet that was quickly sent while still processing the previous packet, clear the acknowledge bit as soon as the message is consumed from the Rx FIFO. This gives the hardware a chance to send a GoodCRC without causing the sender to retry. Change-Id: I8a9ef42685576ab68aa65efab1bebc40d801990d Signed-off-by: Jack Pham <jackp@codeaurora.org>
2016-11-23usb: pd: Avoid spurious state machine work on CC changeJack Pham
If an unexpected or delayed Type-C mode change notification arrives from the charger driver, it could falsely kick the state machine and could cause it to prematurely hard reset since it preempted an expected message. This is particularly true for the PR Swap operation in which the timing of PS_RDY and resulting power negotiation is disrupted by the CC change notification which is catching up. The previous way of handling this by using the pd->in_pr_swap flag to mask the typec_mode changes is quite fragile due to the uncertainty of when said flag should be cleared. Hence, demote the use of the in_pr_swap flag for only ignoring the expected disconnect the happens in between the role change. Then, for typec_mode changes, determine if current_pr is changed or not to decide whether to kick the state machine. Finally, since disconnect now is signaled by pd->current_pr==PR_NONE, we'll need to keep track of whether VBUS had been enabled with a separate flag rather than relying on pd->current_pr==PR_SRC. Change-Id: I66be40091b75726d25c7be4478f1248a6af9ca3c Signed-off-by: Jack Pham <jackp@codeaurora.org>
2016-11-23usb: pd: Reset msgid counters properlyJack Pham
Make sure to reset both Tx and Rx msgid counters when the protocol layer needs to be reset. This occurs after hard/soft reset as well as when starting up a new sink or source session. Put this in a common function pd_reset_protocol(). Change-Id: I643a60a28e6498ca16b6f46293b8aa05eff40266 Signed-off-by: Jack Pham <jackp@codeaurora.org>
2016-11-23usb: pd: Fix sink hard reset timingJack Pham
The current hard reset handling (most recently fixed with commit 172cec3a2c76 ("usb: pd: Improve sink hard reset handling")) is based on a maximum timeout for the longest possible (according to spec) duration that VBUS may turn off and back on again, just under 2s, before re-starting the sink and waiting for capabilities again. However, this method is prone to timing errors, particularly tTypeCSinkWaitCap, which should be based on when VBUS turns on. Fix this by making use of the VBUS presence notification from the charger (PROP_PRESENT). Keep track of this in the psy_changed() callback and use the falling notification to determine when to transition out of PE_SNK_TRANSITION_TO_DEFAULT into PE_SNK_STARTUP. Bring back PE_SNK_DISCOVERY which is now used as a waiting state until the VBUS rising notification comes and transition to PE_SNK_WAIT_FOR_CAPABILITIES. And move setting of PROP_VOLTAGE_MAX to PE_SNK_STARTUP after VBUS has turned off to avoid tripping the charger's overvoltage detection. Also since aforementioned commit, the CC HW is now able to handle VBUS going away and not treating it as a false disconnect, so we can remove the workaround as a disconnect can now be treated as a disconnect. Change-Id: I885f3f4c219e102758fd09c8aae9257d093ebb72 Signed-off-by: Jack Pham <jackp@codeaurora.org>
2016-11-23usb: pd: Support Android dual_role_usb sysfs classJack Pham
Export an instance of the dual_role_usb class using the provided helpers. This is an alternate set of sysfs nodes that the Android framework uses to allow for user interactive control of role switching. Writing to the various properties achieves the following: - mode: toggles between UFP/Sink and DFP/Source via soft disconnect/reconnect without invoking PD. - power_role: toggles between Source and Sink modes via the PR_Swap operation - data_role: toggles between UFP (device) and DFP (host) via the DR_Swap operation Android currently expects a single instance named "otg_default". Change-Id: I7060b6f379bc8bed24b59d9df4ca2fb331437363 Signed-off-by: Jack Pham <jackp@codeaurora.org>
2016-11-18Merge "usb: pd: Don't suspend charging unless changing voltages"Linux Build Service Account
2016-11-18Merge "usb: phy: qusb: Make sure QUSB PHY is into proper state"Linux Build Service Account
2016-11-18Merge "USB: phy: qusb: Turn on vdd along with 1p8/3p3 LDOs when PMI requests"Linux Build Service Account
2016-11-18USB: gagget: f_fs: Return error if TX req is queued during device offlineVijayavardhan Vennapusa
when USB cable is disconnected during TX data transfers, endpoints will be disabled during function disable. If userspace client tries to queue requests on disabled endpoints, driver will wait till endpoints are enabled and then queues previous session requests. This results in kernel driver and userspace driver out of sync and due to this, stall will be seen. Hence fix this issue by returning error value if client tries to queue requests on TX endpoint during device offline. CRs-Fixed: 633497 Change-Id: I3e43b8a704367aff7fe8dd88159315aef811c51c Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org> Signed-off-by: Mayank Rana <mrana@codeaurora.org>
2016-11-18usb: gadget: Notify QTI upon cable connect for DPLHemant Kumar
QTI needs an indication of cable connect for DPL. Since host DPL driver does not send DTR indication send zero length packet to QTI upon cable connect. Change-Id: I545771f9a84ecc9c2f641c17e057673a32b1f305 Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
2016-11-18Merge "usb: pd: Stop processing SVDM if handler found"Linux Build Service Account
2016-11-18Merge "USB: Allow skipping device resume during system resume"Linux Build Service Account
2016-11-17usb: pd: Don't suspend charging unless changing voltagesJack Pham
To optimize charging during power negotiation and the voltage is not changing, for example when transitioning from implicit contract to the default 5V PDO, there is no requirement to suspend the charging and hence setting the charger's PROP_PD_CURRENT_MAX can be avoided. It is only needed when changing voltages, in which case current limit should be calculated based on pSnkStdby (2.5W), or when staying at the same voltage and decreasing current. Also fix the incorrect setting of PROP_CURRENT_MAX to PROP_PD_CURRENT_MAX when doing a sink->source swap. Change-Id: Ib53902459646e590df4dc7fcb00f833d5e8f41ed Signed-off-by: Jack Pham <jackp@codeaurora.org>
2016-11-16USB: Allow skipping device resume during system resumeHemant Kumar
This allows xHC to remain in low power mode and not resume the bus when system wide resume happens. Controller comes out of low power mode only when usb device issues a remote wakeup or if there is a host initiated bus resume. Change-Id: I96cdcb9e3642906b4afa08d9bde07e123d9b3977 Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
2016-11-15usb: pd: Stop processing SVDM if handler foundJack Pham
If a client matching the SVID for an incoming SVDM is found, assume it has handled the message completely and simply return. This avoids the case when it handles an Attention message by queuing another VDM request, only to have it inadvertently deleted in the generic handling below. But we also lose tracking of Discover/Enter/Exit Mode exchanges though that was only used for informational purposes. Change-Id: Ie23d473302d7fbda9b243a150e5c52d025007e4f Signed-off-by: Jack Pham <jackp@codeaurora.org>
2016-11-15Merge "usb: gadget: f_mtp: Increase default TX buffer size"Linux Build Service Account
2016-11-14Merge "usb: host: skip xHCI power management upon port suspend"Linux Build Service Account
2016-11-11Merge "usb: gadget: Do not disconnect unregistered dev"Linux Build Service Account
2016-11-11Merge "usb: core: Add support to skip extended bus resume delay"Linux Build Service Account
2016-11-10usb: host: skip xHCI power management upon port suspendHemant Kumar
xHC gets powered down when host mode is stopped. xHCI power management is intended for ACPI based power management which is defined for PC architecture. Hence there is no need to clear run/stop bit and save the runtime register states upon port suspend. Change-Id: I9d0b31021e7c47084cd92c8c70e17cff3d057655 Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>