aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/mtu3
AgeCommit message (Collapse)AuthorFilesLines
2020-11-06usb: mtu3: fix panic in mtu3_gadget_stop()Macpaul Lin1-0/+1
This patch fixes a possible issue when mtu3_gadget_stop() already assigned NULL to mtu->gadget_driver during mtu_gadget_disconnect(). [<ffffff9008161974>] notifier_call_chain+0xa4/0x128 [<ffffff9008161fd4>] __atomic_notifier_call_chain+0x84/0x138 [<ffffff9008162ec0>] notify_die+0xb0/0x120 [<ffffff900809e340>] die+0x1f8/0x5d0 [<ffffff90080d03b4>] __do_kernel_fault+0x19c/0x280 [<ffffff90080d04dc>] do_bad_area+0x44/0x140 [<ffffff90080d0f9c>] do_translation_fault+0x4c/0x90 [<ffffff9008080a78>] do_mem_abort+0xb8/0x258 [<ffffff90080849d0>] el1_da+0x24/0x3c [<ffffff9009bde01c>] mtu3_gadget_disconnect+0xac/0x128 [<ffffff9009bd576c>] mtu3_irq+0x34c/0xc18 [<ffffff90082ac03c>] __handle_irq_event_percpu+0x2ac/0xcd0 [<ffffff90082acae0>] handle_irq_event_percpu+0x80/0x138 [<ffffff90082acc44>] handle_irq_event+0xac/0x148 [<ffffff90082b71cc>] handle_fasteoi_irq+0x234/0x568 [<ffffff90082a8708>] generic_handle_irq+0x48/0x68 [<ffffff90082a96ac>] __handle_domain_irq+0x264/0x1740 [<ffffff90080819f4>] gic_handle_irq+0x14c/0x250 [<ffffff9008084cec>] el1_irq+0xec/0x194 [<ffffff90085b985c>] dma_pool_alloc+0x6e4/0xae0 [<ffffff9008d7f890>] cmdq_mbox_pool_alloc_impl+0xb0/0x238 [<ffffff9008d80904>] cmdq_pkt_alloc_buf+0x2dc/0x7c0 [<ffffff9008d80f60>] cmdq_pkt_add_cmd_buffer+0x178/0x270 [<ffffff9008d82320>] cmdq_pkt_perf_begin+0x108/0x148 [<ffffff9008d824d8>] cmdq_pkt_create+0x178/0x1f0 [<ffffff9008f96230>] mtk_crtc_config_default_path+0x328/0x7a0 [<ffffff90090246cc>] mtk_drm_idlemgr_kick+0xa6c/0x1460 [<ffffff9008f9bbb4>] mtk_drm_crtc_atomic_begin+0x1a4/0x1a68 [<ffffff9008e8df9c>] drm_atomic_helper_commit_planes+0x154/0x878 [<ffffff9008f2fb70>] mtk_atomic_complete.isra.16+0xe80/0x19c8 [<ffffff9008f30910>] mtk_atomic_commit+0x258/0x898 [<ffffff9008ef142c>] drm_atomic_commit+0xcc/0x108 [<ffffff9008ef7cf0>] drm_mode_atomic_ioctl+0x1c20/0x2580 [<ffffff9008ebc768>] drm_ioctl_kernel+0x118/0x1b0 [<ffffff9008ebcde8>] drm_ioctl+0x5c0/0x920 [<ffffff900863b030>] do_vfs_ioctl+0x188/0x1820 [<ffffff900863c754>] SyS_ioctl+0x8c/0xa0 Fixes: df2069acb005 ("usb: Add MediaTek USB3 DRD driver") Signed-off-by: Macpaul Lin <[email protected]> Acked-by: Chunfeng Yun <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-08-18usb: mtu3: Remove unsused inline function is_first_entryYueHaibing1-6/+0
It is never used, so can be removed. Signed-off-by: YueHaibing <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-07-29usb: mtu3: simplify mtu3_req_complete()Chunfeng Yun1-10/+7
Use argument req directly instead of mreq->request, they are the same usb request. Signed-off-by: Chunfeng Yun <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-07-29usb: mtu3: clear dual mode of u3port when disable deviceChunfeng Yun1-1/+5
If not clear u3port's dual mode when disable device, the IP will fail to enter sleep mode when suspend. Signed-off-by: Chunfeng Yun <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-07-29usb: mtu3: use MTU3_EP_WEDGE flagChunfeng Yun3-7/+5
Use MTU3_EP_WEDGE flag instead of the member @wedged in mtu3_ep struct, then @wedged can be removed. Signed-off-by: Chunfeng Yun <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-07-29usb: mtu3: remove useless member @busy in mtu3_ep structChunfeng Yun2-7/+0
The member @busy in mtu3_ep struct is unnecessary, so remove it. Signed-off-by: Chunfeng Yun <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-07-29usb: mtu3: remove repeated error logChunfeng Yun1-7/+1
The caller already print error log. Signed-off-by: Chunfeng Yun <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-07-29usb: mtu3: add ->udc_set_speed()Chunfeng Yun3-28/+58
Make use of the method to make sure connect on speeds supported by the gadget driver. Signed-off-by: Chunfeng Yun <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-07-29usb: mtu3: introduce a funtion to check maximum speedChunfeng Yun1-20/+28
The max_speed got from DTS may be not supported by the hardware, so need check it, and assign a proper default value. And make it clear by introducing a funtion. Signed-off-by: Chunfeng Yun <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-07-29usb: mtu3: clear interrupts status when disable interruptsChunfeng Yun1-13/+12
When disable interrupts, will also want to clear their status, ensure it by calling mtu3_intr_status_clear() in mtu3_intr_disable(). Signed-off-by: Chunfeng Yun <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-07-29usb: mtu3: reinitialize CSR registersChunfeng Yun1-29/+32
The CSR registers will be reset as default value if the ports are disabled, so reinitialize them when the ports are enabled again. Signed-off-by: Chunfeng Yun <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-07-29usb: mtu3: fix macro for maximum number of packetsChunfeng Yun1-2/+2
The bits field for maximum number of packets is 8 bits. Signed-off-by: Chunfeng Yun <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-07-29usb: mtu3: remove unnecessary pointer checksChunfeng Yun1-19/+6
The class driver will ensure the parameters are valid pointers before call the hook function of usb_ep_ops, so no need check them again. Signed-off-by: Chunfeng Yun <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-07-29usb: mtu3: convert to devm_platform_ioremap_resource_bynameChunfeng Yun2-6/+2
Use devm_platform_ioremap_resource_byname() to simplify code Signed-off-by: Chunfeng Yun <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-07-15usb: mtu3: mtu3_trace: Supply missing mtu3_debug.h include fileLee Jones1-0/+1
If the header file containing a function's prototype isn't included by the sourcefile containing the associated function, the build system complains of missing prototypes. Fixes the following W=1 kernel build warning(s): drivers/usb/mtu3/mtu3_trace.c:13:6: warning: no previous prototype for ‘mtu3_dbg_trace’ [-Wmissing-prototypes] 13 | void mtu3_dbg_trace(struct device *dev, const char *fmt, ...) | ^~~~~~~~~~~~~~ Cc: Chunfeng Yun <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Lee Jones <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-07-15usb: mtu3: mtu3_trace: Function headers are not suitable for kerneldocLee Jones1-1/+1
Kerneldoc headers should only be used to document functions and data structures. Cc: Chunfeng Yun <[email protected]> Cc: [email protected] Signed-off-by: Lee Jones <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-07-09usb: mtu3: mtu3_debug: Add forward declaration of 'struct ssusb_mtk'Lee Jones1-0/+2
Without it, the build system complains that it was declared inside the parameter list. Fixes the following W=1 kernel build warning(s): In file included from drivers/usb/mtu3/mtu3_trace.c:11: drivers/usb/mtu3/mtu3_debug.h:29:36: warning: ‘struct ssusb_mtk’ declared inside parameter list will not be visible outside of this definition or declaration 29 | void ssusb_dev_debugfs_init(struct ssusb_mtk *ssusb); | ^~~~~~~~~ drivers/usb/mtu3/mtu3_debug.h:30:35: warning: ‘struct ssusb_mtk’ declared inside parameter list will not be visible outside of this definition or declaration 30 | void ssusb_dr_debugfs_init(struct ssusb_mtk *ssusb); | ^~~~~~~~~ drivers/usb/mtu3/mtu3_debug.h:31:39: warning: ‘struct ssusb_mtk’ declared inside parameter list will not be visible outside of this definition or declaration 31 | void ssusb_debugfs_create_root(struct ssusb_mtk *ssusb); | ^~~~~~~~~ drivers/usb/mtu3/mtu3_debug.h:32:39: warning: ‘struct ssusb_mtk’ declared inside parameter list will not be visible outside of this definition or declaration 32 | void ssusb_debugfs_remove_root(struct ssusb_mtk *ssusb); | ^~~~~~~~~ Cc: Chunfeng Yun <[email protected]> Cc: [email protected] Signed-off-by: Lee Jones <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-07-03usb: mtu3: mtu3_core: Demote obvious misuse of kerneldoc to standard comment ↵Lee Jones1-1/+1
block No attempt has been made to document the function. Fixes the following W=1 kernel build warning(s): drivers/usb/mtu3/mtu3_core.c:805: warning: Function parameter or member 'mtu' not described in 'mtu3_set_dma_mask' Cc: Chunfeng Yun <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Lee Jones <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-06-24USB: ch9: add "USB_" prefix in front of TEST definesGreg Kroah-Hartman1-8/+8
For some reason, the TEST_ defines in the usb/ch9.h files did not have the USB_ prefix on it, making it a bit confusing when reading the file, as well as not the nicest thing to do in a uapi file. So fix that up and add the USB_ prefix on to them, and fix up all in-kernel usages. This included deleting the duplicate copy in the net2272.h file. Cc: Felipe Balbi <[email protected]> Cc: Michal Simek <[email protected]> Cc: Mathias Nyman <[email protected]> Cc: Pawel Laszczak <[email protected]> Cc: YueHaibing <[email protected]> Cc: Nathan Chancellor <[email protected]> Cc: Jason Yan <[email protected]> Cc: Jia-Ju Bai <[email protected]> Cc: Stephen Boyd <[email protected]> Cc: Christophe JAILLET <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Jules Irenge <[email protected]> Cc: Alan Stern <[email protected]> Cc: Thinh Nguyen <[email protected]> Cc: Rob Gill <[email protected]> Cc: Macpaul Lin <[email protected]> Acked-by: Minas Harutyunyan <[email protected]> Acked-by: Bin Liu <[email protected]> Acked-by: Chunfeng Yun <[email protected]> Acked-by: Peter Chen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-05-18Merge 5.7-rc6 into usb-nextGreg Kroah-Hartman1-2/+2
We need the USB fixes in here as well. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-05-14usb: mtu3: constify struct debugfs_reg32Rikard Falkeborn1-2/+2
mtu3_prb_regs is never changed and can therefore be made const. This allows the compiler to put it in the text section instead of the data section. Before: text data bss dec hex filename 19966 7120 0 27086 69ce drivers/usb/mtu3/mtu3_debugfs.o After: text data bss dec hex filename 20142 6992 0 27134 69fe drivers/usb/mtu3/mtu3_debugfs.o Signed-off-by: Rikard Falkeborn <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-04-16USB: mtu3: Use the correct style for SPDX License IdentifierNishad Kamdar6-6/+6
This patch corrects the SPDX License Identifier style in header files related to MediaTek USB3 Dual Role controller. For C header files Documentation/process/license-rules.rst mandates C-like comments (opposed to C source files where C++ style should be used). Changes made by using a script provided by Joe Perches here: https://lkml.org/lkml/2019/2/7/46. Suggested-by: Joe Perches <[email protected]> Signed-off-by: Nishad Kamdar <[email protected]> Reviewed-by: Chunfeng Yun <[email protected]> Link: https://lore.kernel.org/r/20200404103728.GA6011@nishad Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-03-04usb: roles: Provide the switch drivers handle to the switch in the APIHeikki Krogerus1-4/+5
The USB role callback functions had a parameter pointing to the parent device (struct device) of the switch. The assumption was that the switch parent is always the controller. Firstly, that may not be true in every case, and secondly, it prevents us from supporting devices that supply multiple muxes. Changing the first parameter of usb_role_switch_set_t and usb_role_switch_get_t from struct device to struct usb_role_switch. Cc: Peter Chen <[email protected]> Cc: Felipe Balbi <[email protected]> Cc: Chunfeng Yun <[email protected]> Cc: Bin Liu <[email protected]> Signed-off-by: Heikki Krogerus <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-11-04Merge 5.4-rc6 into usb-nextGreg Kroah-Hartman1-0/+1
We need the USB fixes in here to build on top of. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-10-27usb: mtu3: fix missing include of mtu3_dr.hBen Dooks (Codethink)1-0/+1
The declarations of ssusb_gadget_{init,exit} are in the mtu3_dr.h file but the code does that implements them does not include this. Add the include to fix the following sparse warnigns: drivers/usb/mtu3/mtu3_core.c:825:5: warning: symbol 'ssusb_gadget_init' was not declared. Should it be static? drivers/usb/mtu3/mtu3_core.c:925:6: warning: symbol 'ssusb_gadget_exit' was not declared. Should it be static? Acked-by: Chunfeng Yun <[email protected]> Signed-off-by: Ben Dooks <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2019-10-10usb: mtu3: fix race condition about delayed_statusChunfeng Yun1-2/+10
usb_composite_setup_continue() may be called before composite_setup() return USB_GADGET_DELAYED_STATUS, then the controller driver will delay status stage after composite_setup() finish, but the class driver don't ask the controller to continue delayed status anymore, this will cause control transfer timeout. happens when use mass storage (also enabled other class driver): cpu1: cpu2 handle_setup(SET_CONFIG) //gadget driver unlock (g->lock) gadget_driver->setup() composite_setup() lock(cdev->lock) set_config() fsg_set_alt() // maybe some times due to many class are enabled raise FSG_STATE_CONFIG_CHANGE return USB_GADGET_DELAYED_STATUS handle_exception() usb_composite_setup_continue() unlock(cdev->lock) lock(cdev->lock) ep0_queue() lock (g->lock) //no delayed status, nothing todo unlock (g->lock) unlock(cdev->lock) return USB_GADGET_DELAYED_STATUS // composite_setup lock (g->lock) get USB_GADGET_DELAYED_STATUS //handle_setup [1] Try to fix the race condition as following: After the driver gets USB_GADGET_DELAYED_STATUS at [1], if we find there is a usb_request in ep0 request list, it means composite already asked us to continue delayed status by usb_composite_setup_continue(), so we skip request about delayed_status by composite_setup() and still do status stage. Signed-off-by: Chunfeng Yun <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-10-10usb: mtu3: add a new function to do status stageChunfeng Yun1-11/+12
Exact a new static function to do status stage Signed-off-by: Chunfeng Yun <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-09-03usb: mtu3: register a USB Role Switch for dual role modeChunfeng Yun6-7/+60
Because extcon is not allowed for new bindings, and the dual role switch is supported by USB Role Switch, especially for Type-C drivers, so register a USB Role Switch to support the new way Signed-off-by: Chunfeng Yun <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-07-30usb: Remove dev_err() usage after platform_get_irq()Stephen Boyd1-3/+1
We don't need dev_err() messages when platform_get_irq() fails now that platform_get_irq() prints an error message itself when something goes wrong. Let's remove these prints with a simple semantic patch. // <smpl> @@ expression ret; struct platform_device *E; @@ ret = ( platform_get_irq(E, ...) | platform_get_irq_byname(E, ...) ); if ( \( ret < 0 \| ret <= 0 \) ) { ( -if (ret != -EPROBE_DEFER) -{ ... -dev_err(...); -... } | ... -dev_err(...); ) ... } // </smpl> While we're here, remove braces on if statements that only have one statement (manually). Signed-off-by: Stephen Boyd <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-06-10Revert "usb: mtu3: fix up undefined reference to usb_debug_root"Chunfeng Yun1-1/+2
It's not needed after [1] is applied, because usb_debug_root is created by usb common core but not usbcore now. [1] 812086d362a1 ("USB: move usb debugfs directory creation to the usb common core") Signed-off-by: Chunfeng Yun <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-05-21usb: mtu3: fix up undefined reference to usb_debug_rootChunfeng Yun1-2/+1
When CONFIG_USB is not set, and CONFIG_USB_GADGET is set, there is an issue: ld: drivers/usb/mtu3/mtu3_debugfs.o: in function 'ssusb_debugfs_create_root': mtu3_debugfs.c:(.text+0xba3): undefined reference to 'usb_debug_root' usb_debug_root is only built when CONFIG_USB is enabled, so here drop it and use NULL instead. Reported-by: Randy Dunlap <[email protected]> Signed-off-by: Chunfeng Yun <[email protected]> Acked-by: Randy Dunlap <[email protected]> # build-tested Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-04-19usb: mtu3: get optional clock by devm_clk_get_optional()Chunfeng Yun1-16/+3
Use devm_clk_get_optional() to get optional clock instead of optional_clk_get() which uses devm_clk_get() to get clock and checks for -EPROBE_DEFER but not -ENOENT as devm_clk_get_optional() does, in fact, only ignoring -ENOENT will cover more errors, so the replacement doesn't change original purpose. Signed-off-by: Chunfeng Yun <[email protected]> Reviewed-by: Matthias Brugger <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-04-01Merge 5.1-rc3 into usb-nextGreg Kroah-Hartman1-0/+1
We want the USB fixes in here as well. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-03-26usb: mtu3: fix EXTCON dependencyArnd Bergmann1-0/+1
When EXTCON is a loadable module, mtu3 fails to link as built-in: drivers/usb/mtu3/mtu3_plat.o: In function `mtu3_probe': mtu3_plat.c:(.text+0x690): undefined reference to `extcon_get_edev_by_phandle' Add a Kconfig dependency to force mtu3 also to be a loadable module if extconn is, but still allow it to be built without extcon. Fixes: d0ed062a8b75 ("usb: mtu3: dual-role mode support") Signed-off-by: Arnd Bergmann <[email protected]> Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-03-26usb: mtu3: add a function to switch mailbox state to stringChunfeng Yun1-2/+18
By introducing mailbox_state_string(), allow to make debug log more readable Signed-off-by: Chunfeng Yun <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-03-26usb: mtu3: add tracepoints to help debugChunfeng Yun9-1/+347
This patch implements a few initial tracepoints for the mtu3 driver. More traces can be added as necessary in order to ease the task of debugging. Signed-off-by: Chunfeng Yun <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-03-26usb: mtu3: move vbus and mode debugfs interfaces into mtu3_debugfs.cChunfeng Yun4-110/+110
Due to the separated debugfs files are added, move vbus and mode debugfs interfaces related with dual-role switch from mtu3_dr.c into mtu3_debugfs.c Signed-off-by: Chunfeng Yun <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-03-26usb: mtu3: add debugfs interface filesChunfeng Yun7-13/+503
This adds more debugfs consumers. The debugfs entries read some important registers, fifo status, QMU ring, endpoint status, and IPPC probe interface to get internal status. With these entries, users can check the registers, endpoint and GPD used during run time. Signed-off-by: Chunfeng Yun <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-03-26usb: mtu3: supports new QMU formatChunfeng Yun6-22/+66
In order to support U3gen2 ISOC transfer upto 96DPs, extend the data buffer length. Signed-off-by: Chunfeng Yun <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-03-26usb: mtu3: rebuild qmu_gpd struct to prepare to support new QMU formatChunfeng Yun2-59/+42
To support USB3 Gen2 ISOC, the data buffer length need be extended, it's hard to make the current qmu_gpd struct compatible, so here rebuild qmu_gpd struct and make easy to support new QMU format Signed-off-by: Chunfeng Yun <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-03-26usb: mtu3: fix transfer error of USB3 Gen2 isocChunfeng Yun3-10/+51
To support USB3 Gen2 ISOC, the registers of TXCSR1 and RXCSR1 are adjusted to support greater maxpkt and mult value, this patch fix this issue Signed-off-by: Chunfeng Yun <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-03-26usb: mtu3: rebuild the code of getting vbus regulatorChunfeng Yun1-5/+3
Remove local variable @vbus and use @dev instead of @pdev->dev Signed-off-by: Chunfeng Yun <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-03-26usb: mtu3: remove unnecessary local variable @reqChunfeng Yun1-5/+2
The local variable @req is unnecessary in qmu_tx_zlp_error_handler, so remove it. Signed-off-by: Chunfeng Yun <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-03-26usb: mtu3: print useful information also for device and host modesChunfeng Yun1-2/+3
Print useful information not only dual-role mode but also device mode and host mode. Signed-off-by: Chunfeng Yun <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-03-26usb: mtu3: check return value of devm_extcon_register_notifier()Chunfeng Yun2-5/+16
Check the return value of devm_extcon_register_notifier() and add error handling. Signed-off-by: Chunfeng Yun <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-01-22USB: add missing SPDX lines to Kconfig and MakefilesGreg Kroah-Hartman1-0/+2
There are a few remaining drivers/usb/ files that do not have SPDX identifiers in them, all of these are either Kconfig or Makefiles. Add the correct GPL-2.0 identifier to them to make scanning tools happy. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-12-07usb: mtu3: fix dbginfo in qmu_tx_zlp_error_handlerYueHaibing1-1/+1
Fixes gcc '-Wunused-but-set-variable' warning: drivers/usb/mtu3/mtu3_qmu.c: In function 'qmu_tx_zlp_error_handler': drivers/usb/mtu3/mtu3_qmu.c:385:22: warning: variable 'req' set but not used [-Wunused-but-set-variable] It seems dbginfo original intention is print 'req' other than 'mreq' Acked-by: Chunfeng Yun <[email protected]> Signed-off-by: YueHaibing <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2018-12-05usb: mtu3: clear SOFTCONN when clear USB3_EN if work as HS modeChunfeng Yun2-0/+7
When the controller supports SS mode, but works as HS mode, the SOFTCONN will not be cleared automatically when clear USB3_EN by default, this cause an issue that can't disconnect from host, so clear SOFTCONN when clear USB3_EN when the class driver want to disable the D+ pullup. Signed-off-by: Chunfeng Yun <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2018-12-05usb: mtu3: enable SETUPENDISR interruptChunfeng Yun3-2/+7
If the controller receives a new SETUP during SETUP data stage, and will generate SETUPENDISR interrupt, the driver should abort the current SETUP command and process the new one. Signed-off-by: Chunfeng Yun <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2018-12-05usb: mtu3: fix the issue about SetFeature(U1/U2_Enable)Chunfeng Yun2-5/+7
Fix the issue: device doesn't accept LGO_U1/U2: 1. set SW_U1/U2_ACCEPT_ENABLE to eanble controller to accept LGO_U1/U2 by default; 2. enable/disable controller to initiate requests for transition into U1/U2 by SW_U1/U2_REQUEST_ENABLE instead of SW_U1/U2_ACCEPT_ENABLE; Signed-off-by: Chunfeng Yun <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>