summaryrefslogtreecommitdiff
path: root/drivers/usb
AgeCommit message (Collapse)Author
2016-01-13Merge tag 'usb-4.5-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB updates from Greg KH: "Here is the big USB drivers update for 4.5-rc1. Lots of gadget driver updates and fixes, like usual, and a mix of other USB driver updates as well. Full details in the shortlog. All of these have been in linux-next for a while" * tag 'usb-4.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (191 commits) MAINTAINERS: change my email address USB: usbmon: remove assignment from IS_ERR argument USB: mxu11x0: drop redundant function name from error messages USB: mxu11x0: fix debug-message typos USB: mxu11x0: rename usb-serial driver USB: mxu11x0: fix modem-control handling on B0-transitions USB: mxu11x0: fix memory leak on firmware download USB: mxu11x0: fix memory leak in port-probe error path USB: serial: add Moxa UPORT 11x0 driver USB: cp210x: add ID for ELV Marble Sound Board 1 usb: chipidea: otg: use usb autosuspend to suspend bus for HNP usb: chipidea: host: set host to be null after hcd is freed usb: chipidea: removing of_find_property usb: chipidea: implement platform shutdown callback usb: chipidea: clean up CONFIG_USB_CHIPIDEA_DEBUG reference usb: chipidea: delete static debug support usb: chipidea: support debugfs without CONFIG_USB_CHIPIDEA_DEBUG usb: chipidea: udc: improve error handling on _hardware_enqueue usb: chipidea: udc: _ep_queue and _hw_queue cleanup usb: dwc3: of-simple: fix build warning on !PM ...
2016-01-13Merge branch 'work.misc' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull misc vfs updates from Al Viro: "All kinds of stuff. That probably should've been 5 or 6 separate branches, but by the time I'd realized how large and mixed that bag had become it had been too close to -final to play with rebasing. Some fs/namei.c cleanups there, memdup_user_nul() introduction and switching open-coded instances, burying long-dead code, whack-a-mole of various kinds, several new helpers for ->llseek(), assorted cleanups and fixes from various people, etc. One piece probably deserves special mention - Neil's lookup_one_len_unlocked(). Similar to lookup_one_len(), but gets called without ->i_mutex and tries to avoid ever taking it. That, of course, means that it's not useful for any directory modifications, but things like getting inode attributes in nfds readdirplus are fine with that. I really should've asked for moratorium on lookup-related changes this cycle, but since I hadn't done that early enough... I *am* asking for that for the coming cycle, though - I'm going to try and get conversion of i_mutex to rwsem with ->lookup() done under lock taken shared. There will be a patch closer to the end of the window, along the lines of the one Linus had posted last May - mechanical conversion of ->i_mutex accesses to inode_lock()/inode_unlock()/inode_trylock()/ inode_is_locked()/inode_lock_nested(). To quote Linus back then: ----- | This is an automated patch using | | sed 's/mutex_lock(&\(.*\)->i_mutex)/inode_lock(\1)/' | sed 's/mutex_unlock(&\(.*\)->i_mutex)/inode_unlock(\1)/' | sed 's/mutex_lock_nested(&\(.*\)->i_mutex,[ ]*I_MUTEX_\([A-Z0-9_]*\))/inode_lock_nested(\1, I_MUTEX_\2)/' | sed 's/mutex_is_locked(&\(.*\)->i_mutex)/inode_is_locked(\1)/' | sed 's/mutex_trylock(&\(.*\)->i_mutex)/inode_trylock(\1)/' | | with a very few manual fixups ----- I'm going to send that once the ->i_mutex-affecting stuff in -next gets mostly merged (or when Linus says he's about to stop taking merges)" * 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (63 commits) nfsd: don't hold i_mutex over userspace upcalls fs:affs:Replace time_t with time64_t fs/9p: use fscache mutex rather than spinlock proc: add a reschedule point in proc_readfd_common() logfs: constify logfs_block_ops structures fcntl: allow to set O_DIRECT flag on pipe fs: __generic_file_splice_read retry lookup on AOP_TRUNCATED_PAGE fs: xattr: Use kvfree() [s390] page_to_phys() always returns a multiple of PAGE_SIZE nbd: use ->compat_ioctl() fs: use block_device name vsprintf helper lib/vsprintf: add %*pg format specifier fs: use gendisk->disk_name where possible poll: plug an unused argument to do_poll amdkfd: don't open-code memdup_user() cdrom: don't open-code memdup_user() rsxx: don't open-code memdup_user() mtip32xx: don't open-code memdup_user() [um] mconsole: don't open-code memdup_user_nul() [um] hostaudio: don't open-code memdup_user() ...
2016-01-11Merge branch 'patchwork' into v4l_for_linusMauro Carvalho Chehab
* patchwork: (204 commits) [media] rc: sunxi-cir: Initialize the spinlock properly [media] rtl2832: do not filter out slave TS null packets [media] rtl2832: print reg number on error case [media] rtl28xxu: return demod reg page from driver cache [media] coda: enable MPEG-2 ES decoding [media] coda: don't start streaming without queued buffers [media] coda: hook up vidioc_prepare_buf [media] coda: relax coda_jpeg_check_buffer for trailing bytes [media] coda: make to_coda_video_device static [media] s5p-mfc: remove volatile attribute from MFC register addresses [media] s5p-mfc: merge together s5p_mfc_hw_call and s5p_mfc_hw_call_void [media] s5p-mfc: use spinlock to protect MFC context [media] s5p-mfc: remove unnecessary callbacks [media] s5p-mfc: make queue cleanup code common [media] s5p-mfc: use one implementation of s5p_mfc_get_new_ctx [media] s5p-mfc: constify s5p_mfc_codec_ops structures [media] au8522: Avoid memory leak for device config data [media] ir-lirc-codec.c: don't leak lirc->drv-rbuf [media] uvcvideo: small cleanup in uvc_video_clock_update() [media] uvcvideo: Fix reading the current exposure value of UVC ...
2016-01-04Merge branch 'memdup_user_nul' into work.miscAl Viro
2016-01-04USB: usbmon: remove assignment from IS_ERR argumentJulia Lawall
The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression e1,e2; statement S1,S2; @@ +e1 = e2; if (IS_ERR( e1 - = e2 )) S1 else S2 // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-01-03Merge tag 'usb-serial-4.4-rc8' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-next Johan writes: USB-serial fixes for v4.4-rc8 Here's another device id for cp210x. Signed-off-by: Johan Hovold <johan@kernel.org>
2016-01-03Merge tag 'usb-serial-4.5-rc1' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-next Johan writes: USB-serial updates for v4.5-rc1 These updates add support for Moxa UPort 1100-series devices through a new mxu11x0 driver. The cp210x driver gains proper support for cp2108 devices by working around a couple of firmware bugs, and generic wait-until-sent support (e.g. for tcdrain) is also added. Included are also some general clean ups. Signed-off-by: Johan Hovold <johan@kernel.org>
2015-12-29USB: mxu11x0: drop redundant function name from error messagesJohan Hovold
Drop redundant function name from a few error messages. Drop redundant error message when generic open fails. Signed-off-by: Johan Hovold <johan@kernel.org>
2015-12-29USB: mxu11x0: fix debug-message typosJohan Hovold
Fix a couple of debug-message typos, and do some minor clean ups. Signed-off-by: Johan Hovold <johan@kernel.org>
2015-12-29USB: mxu11x0: rename usb-serial driverJohan Hovold
Rename the usb-serial driver "mxu11x0" to match the USB driver name. Signed-off-by: Johan Hovold <johan@kernel.org>
2015-12-29USB: mxu11x0: fix modem-control handling on B0-transitionsJohan Hovold
Make sure to raise DTR and RTS on transitions from B0 and leave the other bits unchanged. Signed-off-by: Johan Hovold <johan@kernel.org>
2015-12-29USB: mxu11x0: fix memory leak on firmware downloadJohan Hovold
Make sure to release the private data before returning -ENODEV after having downloaded the firmware during first probe. Clean up the error paths while at it. Signed-off-by: Johan Hovold <johan@kernel.org>
2015-12-29USB: mxu11x0: fix memory leak in port-probe error pathJohan Hovold
Fix memory leak in port-probe error path by verifying the interrupt-in urb before allocating the private data. Signed-off-by: Johan Hovold <johan@kernel.org>
2015-12-29USB: serial: add Moxa UPORT 11x0 driverMathieu OTHACEHE
Add a driver which supports : - UPort 1110 : 1 port RS-232 USB to Serial Hub. - UPort 1130 : 1 port RS-422/485 USB to Serial Hub. - UPort 1130I : 1 port RS-422/485 USB to Serial Hub with Isolation. - UPort 1150 : 1 port RS-232/422/485 USB to Serial Hub. - UPort 1150I : 1 port RS-232/422/485 USB to Serial Hub with Isolation. This driver is based on GPL MOXA driver written by Hen Huang and available on MOXA website. The original driver was based on io_ti serial driver. Signed-off-by: Mathieu OTHACEHE <m.othacehe@gmail.com> Signed-off-by: Johan Hovold <johan@kernel.org>
2015-12-28USB: cp210x: add ID for ELV Marble Sound Board 1Oliver Freyermuth
Add the USB device ID for ELV Marble Sound Board 1. Signed-off-by: Oliver Freyermuth <o.freyermuth@googlemail.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Johan Hovold <johan@kernel.org>
2015-12-27Merge tag 'usb-ci-v4.5-rc1' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/peter.chen/usb into usb-testing Peter writes: The chipidea changes for v4.5-rc1 - Delete static debug for chipidea driver. - Suspend USB core when A device tries to switch to peripheral mode, at former design, it just stopped SoF simply but USB core doesn't know it. - Several small changes.
2015-12-27Merge tag 'usb-for-v4.5' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next Felipe writes: usb: patches for v4.5 A ton of improvements to dwc2 have been made. The driver should be a lot more stable on v4.5 then ever before. Our good old dwc3 got a few cleanups and misc fixes and also added support to Xilinx's integration of this IP. Yoshihiro Shimoda gives us support for a new USB3 peripheral controller from Renesas. Other than these, the usual misc fixes all over the place.
2015-12-24usb: chipidea: otg: use usb autosuspend to suspend bus for HNPLi Jun
Directly manipulate the controller regsiter to suspend the usb bus for HNP is not the proper way, this should be done through the usbcore by usb autosuspend. So to start HNP, autosuspend support should be added for OTG devices interface driver if it's not enabled. Signed-off-by: Li Jun <jun.li@freescale.com> Signed-off-by: Peter Chen <peter.chen@freescale.com>
2015-12-24usb: chipidea: host: set host to be null after hcd is freedLi Jun
Set ci->hcd and ci->otg.host to be null in host_stop since the hcd already freed. Signed-off-by: Li Jun <jun.li@freescale.com> Signed-off-by: Peter Chen <peter.chen@freescale.com>
2015-12-24usb: chipidea: removing of_find_propertySaurabh Sengar
call to of_find_property() before of_property_read_u32() is unnecessary. of_property_read_u32() anyway calls to of_find_property() only. Signed-off-by: Saurabh Sengar <saurabh.truth@gmail.com> Signed-off-by: Peter Chen <peter.chen@freescale.com>
2015-12-24usb: chipidea: implement platform shutdown callbackAndreas Fenkart
disable wakeup irq during shutdown, otherwise kexec fails for kernels that setup irq handlers before resetting the hardware Signed-off-by: Andreas Fenkart <andreas.fenkart@dev.digitalstrom.org> Signed-off-by: Peter Chen <peter.chen@freescale.com>
2015-12-24usb: chipidea: clean up CONFIG_USB_CHIPIDEA_DEBUG referencePeter Chen
Since this configuration option has deleted, cleans up all its references. Signed-off-by: Peter Chen <peter.chen@freescale.com> Reported-by: Valentin Rothberg <valentinrothberg@gmail.com>
2015-12-24usb: chipidea: delete static debug supportPeter Chen
Since we have dynamic debug support, delete static debug for chipidea Signed-off-by: Peter Chen <peter.chen@freescale.com>
2015-12-24usb: chipidea: support debugfs without CONFIG_USB_CHIPIDEA_DEBUGPeter Chen
Since we need to mount debugfs to show/store the things we want to debug, it is duplicated to add another configuration to enable it. Meanwhile, with CONFIG_USB_CHIPIDEA_DEBUG, we can't support chipidea debugfs at runtime. Signed-off-by: Peter Chen <peter.chen@freescale.com> Cc: Jun Li <jun.li@freescale.com>
2015-12-24usb: chipidea: udc: improve error handling on _hardware_enqueueFelipe F. Tonello
_hardware_enqueue() didn't check for errors when using add_td_to_list() which can fail if dma_pool_alloc fails, thus causing a kernel panic when lastnode->ptr is NULL. Signed-off-by: Felipe F. Tonello <eu@felipetonello.com> Signed-off-by: Peter Chen <peter.chen@freescale.com>
2015-12-24usb: chipidea: udc: _ep_queue and _hw_queue cleanupFelipe F. Tonello
Update comments to reflect current state of functions. Signed-off-by: Felipe F. Tonello <eu@felipetonello.com> Signed-off-by: Peter Chen <peter.chen@freescale.com>
2015-12-23new helpers: no_seek_end_llseek{,_size}()Al Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-12-23usb: dwc3: of-simple: fix build warning on !PMFelipe Balbi
if we have a !PM kernel build, our runtime suspend/resume callbacks will be left defined but unused. Add a ifdef CONFIG_PM guard. Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-12-23usb: dwc3: gadget: don't send extra ZLPJohn Youn
If the request->length is zero, a ZLP should already be sent due to that and another ZLP is not needed to terminate the transfer. Fixes: 04c03d10e507 ("usb: dwc3: gadget: handle request->zero") Signed-off-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-12-23usb: gadget: renesas_usb3: add support for Renesas USB3.0 peripheral controllerYoshihiro Shimoda
R-Car H3 has USB3.0 peripheral controllers. This controller's has the following features: - Supports super, high and full speed - Contains 30 pipes for bulk or interrupt transfer - Contains dedicated DMA controller This driver doesn't support the dedicated DMAC for now. Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-12-22usb: dwc2: add shutdown callback to platform variantHeiko Stübner
In specific conditions (involving usb hubs) dwc2 devices can create a lot of interrupts, even to the point of overwhelming devices running at low frequencies. Some devices need to do special clock handling at shutdown-time which may bring the system clock below the threshold of being able to handle the dwc2 interrupts. Disabling dwc2-irqs in a shutdown callbacks prevents reboots/poweroffs from getting stuck in such cases. The hsotg struct already contains an unused irq element, so we can just use it to store the irq number for the shutdown callback. Reviewed-by: Douglas Anderson <dianders@chromium.org> Acked-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Heiko Stuebner <heiko.stuebner@collabora.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-12-22usb: gadget: bcm63xx_udc: use list_for_each_entry_safeGeliang Tang
Use list_for_each_entry_safe() instead of list_for_each_safe() to simplify the code. Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-12-22usb: musb: core: call init and shutdown for the usb phyUwe Kleine-König
The phy's init routine must be called before it can be used. Do so in musb_init_controller and the matching shutdown in musb_remove. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-12-22usb: dwc2: gadget: Repair DSTS register decodingMarek Vasut
The "enumspd" field is located in register DSTS[2:1], but the code which checks the bitfield does not shift the value accordingly. This in turn causes incorrect detection of gadget link partner speed in dwc2_hsotg_irq_enumdone() . Shift the value accordingly to fix the problem with speed detection. Acked-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Marek Vasut <marex@denx.de> Cc: Felipe Balbi <balbi@ti.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: John Youn <johnyoun@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-12-22usb: dwc2: gadget: Remove call to dwc2_hsotg_init()John Youn
Remove call to dwc2_hsotg_init() from dwc2_gadget_init(). The gadget_init function should not access any device registers because the mode isn't guaranteed here. Also, this is already called elsewhere before anything starts on the gadget so it is not necessary here. Signed-off-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-12-22usb: dwc2: Remove redundant reset in probeJohn Youn
Reset already happens before this so just force the dr_mode. Signed-off-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-12-22usb: dwc2: Reduce delay when forcing mode in resetJohn Youn
The delay for force mode is only 25ms according to the databook. Signed-off-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-12-22usb: dwc2: gadget: Replace dwc2_hsotg_corereset()John Youn
The dwc2_core_reset() function exists in the core so use that one instead. Signed-off-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-12-22usb: dwc2: gadget: Use hw params from coreJohn Youn
Use the previously cached hw params in the gadget. This saves a reset and force mode in the gadget initialization during probe and makes getting the hardware parameters consistent between gadget and host. Signed-off-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-12-22usb: dwc2: Improve handling of host and device hwparamsJohn Youn
Adds separate functions to get the host and device specific hardware parameters. The functions check whether the parameters need to be read at all, depending on dr_mode, and forces the mode only if necessary. This saves some delays during probe. This also adds two device mode parameters that will be used by the gadget. Signed-off-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-12-22usb: dwc2: Add functions to set and clear force modeJohn Youn
Added functions to set force mode for host and device. These functions will check the current mode and only force if needed thus avoiding unnecessary force mode delays. However clearing the mode is currently done unconditionally and with the delay in place. This is needed during the connector ID status change interrupt in order to ensure that the mode has changed properly. This preserves the old behavior only for this case. The warning comment about this is moved into the clear mode condition. Signed-off-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-12-22usb: dwc2: Move reset into dwc2_get_hwparams()John Youn
The reset is required to get reset values of the hardware parameters but the force mode is not. Move the base reset into dwc2_get_hwparams() and do the reset and force mode afterwards. Signed-off-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-12-22usb: dwc2: Move mode querying functions into core.hJohn Youn
These functions should go in core.h where they can be called from core, device, or host. Signed-off-by: John Youn <johnyoun@synopsys.com> Reviewed-by: Douglas Anderson <dianders@chromium.org> Tested-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-12-22usb: dwc2: Fix dr_mode validationJohn Youn
The dr_mode parameter was being checked against how the dwc2 module was being configured at compile time. But it wasn't checked against the hardware capabilities, nor were the hardware capabilities checked against the compilation parameters. This commit adds those checks and adjusts dr_mode to an appropriate value, if needed. If the hardware capabilities and module compilation do not match then we fail as it wouldn't be possible to run properly. The hardware, module, and dr_mode, can each be set to host, device, or otg. Check that all these values are compatible and adjust the value of dr_mode if possible. The following table summarizes the behavior: actual HW MOD dr_mode dr_mode ------------------------------ HST HST any : HST HST DEV any : --- HST OTG any : HST DEV HST any : --- DEV DEV any : DEV DEV OTG any : DEV OTG HST any : HST OTG DEV any : DEV OTG OTG any : dr_mode Signed-off-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-12-22usb: dwc2: Add functions to check the HW OTG configJohn Youn
Added functions to query the GHWCFG2.OTG_MODE. This tells us whether the controller hardware is configured for OTG, device-only, or host-only. Signed-off-by: John Youn <johnyoun@synopsys.com> Tested-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-12-22usb: dwc2: Add dwc2_core_reset()John Youn
dwc2_core_reset() was previously renamed to dwc2_core_reset_and_dr_force_mode(). Now add back dwc2_core_reset() which performs only a basic core reset without forcing the mode. Signed-off-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-12-22usb: dwc2: Rename dwc2_core_reset()John Youn
Renamed dwc2_core_reset() to dwc2_core_reset_and_force_dr_mode(). This describes what it is doing more accurately. This is in preparation of introducing a plain dwc2_core_reset() function that only performs the reset and doesn't force the mode. Signed-off-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-12-22usb: dwc2: Reorder AHBIDLE and CSFTRST in dwc2_core_reset()John Youn
According to the databook, the core soft reset should be done before checking for AHBIDLE. The gadget version of core reset had it correct but the hcd version did not. This fixes the hcd version. Signed-off-by: John Youn <johnyoun@synopsys.com> Reviewed-by: Douglas Anderson <dianders@chromium.org> Tested-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-12-22usb: dwc2: Avoid more calls to dwc2_core_reset()Douglas Anderson
Calls to dwc2_core_reset() are currently very slow, taking at least 150ms (possibly more). It behooves us to take as many of these calls out as possible. It turns out that the calls in dwc2_fs_phy_init() and dwc2_hs_phy_init() should (as documented in the code) only be needed if we need to do a PHY SELECT. That means that if we see that we can avoid the PHY SELECT then we can avoid the reset. This patch appears to successfully bypass two resets (one per USB device) on rk3288-based ARM Chromebooks. Signed-off-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2015-12-22usb: dwc2: reduce dwc2 driver probe timeYunzhi Li
I found that the probe function of dwc2 driver takes much time when kernel boot up. There are many long delays in the probe function these take almost 1 second. This patch trying to reduce unnecessary delay time. In dwc2_core_reset() I see it use two at least 20ms delays to wait AHB idle and core soft reset, but dwc2 data book said that dwc2 core soft reset and AHB idle just need a few clocks (I think it refers to AHB clock, and AHB clock run at 150MHz in my RK3288 board), so 20ms is too long, delay 1us for wait AHB idle and soft reset is enough. And in dwc2_get_hwparams() it takes 150ms to wait ForceHostMode and ForceDeviceMode valid but in data book it said software must wait at least 25ms before the change to take effect, so I reduce this time to 25ms~50ms. By the way, is there any state bit show that the force mode take effect ? Could we poll curmod bit for figuring out if the change take effect ? It seems that usleep_range() at boot time will pick the longest value in the range. In dwc2_core_reset() there is a very long delay takes 200ms, and this function run twice when probe, could any one tell me is this delay time resonable ? I have tried this patch in my RK3288-evb board. It works well. Signed-off-by: Yunzhi Li <lyz@rock-chips.com> Signed-off-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: John Youn <johnyoun@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com>