aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb
AgeCommit message (Collapse)AuthorFilesLines
2020-03-17usb: musb: jz4740: Add support for DMAPaul Cercueil2-7/+15
Add support for using the DMA channels built into the Inventra IP. Signed-off-by: Paul Cercueil <[email protected]> Tested-by: Artur Rojek <[email protected]> Signed-off-by: Bin Liu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-03-17usb: musb: remove redundant assignment to variable retColin Ian King1-1/+1
Variable ret is being initialized with a value that is never read, it is assigned a new value later on. The assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Bin Liu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-03-17Merge tag 'usb-ci-v5.7-rc1' of ↵Greg Kroah-Hartman8-14/+18
git://git.kernel.org/pub/scm/linux/kernel/git/peter.chen/usb into usb-next Peter writes: - Improve the runtime pm - Cover one cover case during suspend/resume - Some SPDX License changes The code changes are at my ci-for-usb-next many days, no issue is reported. * tag 'usb-ci-v5.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/peter.chen/usb: USB: chipidea: Use the correct style for SPDX License Identifier usb: chipidea: otg: handling vbus disconnect event occurred during system suspend usb: chipidea: udc: using structure ci_hdrc device for runtime PM
2020-03-16scsi: treewide: Consolidate {get,put}_unaligned_[bl]e24() definitionsBart Van Assche2-5/+1
Move the get_unaligned_be24(), get_unaligned_le24() and put_unaligned_le24() definitions from various drivers into include/linux/unaligned/generic.h. Add a put_unaligned_be24() implementation. Link: https://lore.kernel.org/r/[email protected] Cc: Keith Busch <[email protected]> Cc: Sagi Grimberg <[email protected]> Cc: Jens Axboe <[email protected]> Cc: Harvey Harrison <[email protected]> Cc: Martin K. Petersen <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Andrew Morton <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> # For drivers/usb Reviewed-by: Felipe Balbi <[email protected]> # For drivers/usb/gadget Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2020-03-16usb: get rid of 'choice' for legacy gadget driversMasahiro Yamada1-26/+22
drivers/usb/gadget/legacy/Kconfig creates a 'choice' inside another 'choice'. The outer choice: line 17 "USB Gadget precomposed configurations" The inner choice: line 484 "EHCI Debug Device mode" I wondered why the whole legacy gadget drivers reside in such a big choice block. This dates back to 2003, "[PATCH] USB: fix for multiple definition of `usb_gadget_get_string'". [1] At that time, the global function, usb_gadget_get_string(), was linked into multiple drivers. That was why only one driver was able to become built-in at the same time. Later, commit a84d9e5361bc ("usb: gadget: start with libcomposite") moved usb_gadget_get_string() to a separate module, libcomposite.ko instead of including usbstring.c from multiple modules. More and more refactoring was done, and after commit 1bcce939478f ("usb: gadget: multi: convert to new interface of f_mass_storage"), you can link multiple gadget drivers into vmlinux without causing multiple definition error. This is the only user of the nested choice structure ever. Removing this mess will make some Kconfig cleanups possible. [1]: https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/commit/?id=fee4cf49a81381e072c063571d1aadbb29207408 Signed-off-by: Masahiro Yamada <[email protected]> Acked-by: Felipe Balbi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-03-16usb: dwc3: fix up for role switch API changeStephen Rothwell1-4/+6
After merging the usb-gadget tree, today's linux-next build (arm multi_v7_defconfig) failed like this: drivers/usb/dwc3/drd.c: In function 'dwc3_setup_role_switch': drivers/usb/dwc3/drd.c:551:23: error: assignment to 'usb_role_switch_set_t' {aka 'int (*)(struct usb_role_switch *, enum usb_role)'} from incompatible pointer type 'int (*)(struct device *, enum usb_role)' [-Werror=incompatible-pointer-types] 551 | dwc3_role_switch.set = dwc3_usb_role_switch_set; | ^ drivers/usb/dwc3/drd.c:552:23: error: assignment to 'usb_role_switch_get_t' {aka 'enum usb_role (*)(struct usb_role_switch *)'} from incompatible pointer type 'enum usb_role (*)(struct device *)' [-Werror=incompatible-pointer-types] 552 | dwc3_role_switch.get = dwc3_usb_role_switch_get; | ^ Caused by commit 8a0a13799744 ("usb: dwc3: Registering a role switch in the DRD code.") interacting with commit bce3052f0c16 ("usb: roles: Provide the switch drivers handle to the switch in the API") from the usb tree. Signed-off-by: Stephen Rothwell <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-03-16Merge tag 'usb-for-v5.7' of ↵Greg Kroah-Hartman27-160/+3004
git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next Felipe writes: USB: changes for v5.7 merge window Lots of changes on dwc3 this time, most of them from Thinh fixing a bunch of really old mishaps on the driver. DWC2 got support for STM32MP15 and a couple RockChip SoCs while DWC3 learned about Amlogic A1 family. Apart from these, we have a few spelling fixes and other minor non-critical fixes all over the place. Signed-off-by: Felipe Balbi <[email protected]> * tag 'usb-for-v5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb: (41 commits) dt-bindings: usb: add documentation for aspeed usb-vhub ARM: dts: aspeed-g4: add vhub port and endpoint properties ARM: dts: aspeed-g5: add vhub port and endpoint properties ARM: dts: aspeed-g6: add usb functions usb: gadget: aspeed: add ast2600 vhub support usb: gadget: aspeed: read vhub properties from device tree usb: gadget: aspeed: support per-vhub usb descriptors usb: gadget: f_phonet: Replace zero-length array with flexible-array member usb: gadget: composite: Inform controller driver of self-powered usb: gadget: amd5536udc: fix spelling mistake "reserverd" -> "reserved" udc: s3c-hsudc: Silence warning about supplies during deferred probe usb: dwc2: Silence warning about supplies during deferred probe dt-bindings: usb: dwc2: add compatible property for rk3368 usb dt-bindings: usb: dwc2: add compatible property for rk3328 usb usb: gadget: add raw-gadget interface usb: dwc2: Implement set_selfpowered() usb: dwc3: qcom: Replace <linux/clk-provider.h> by <linux/of_clk.h> usb: dwc3: core: don't do suspend for device mode if already suspended usb: dwc3: Rework resets initialization to be more flexible usb: dwc3: Rework clock initialization to be more flexible ...
2020-03-16USB: chipidea: Use the correct style for SPDX License IdentifierNishad Kamdar6-6/+6
This patch corrects the SPDX License Identifier style in header files related to ChipIdea Highspeed 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://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flkml.org%2Flkml%2F2019%2F2%2F7%2F46&amp;data=02%7C01%7CPeter.Chen%40nxp.com%7Cbea69ff84b574ca6b48e08d7c8cf58cf%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637198665199494622&amp;sdata=bk1n4%2BvnrfRS6ZDrps%2BuXiImdzaxKZ00YskBg6pjtn4%3D&amp;reserved=0. Suggested-by: Joe Perches <[email protected]> Signed-off-by: Nishad Kamdar <[email protected]> Signed-off-by: Peter Chen <[email protected]>
2020-03-16usb: chipidea: otg: handling vbus disconnect event occurred during system ↵Peter Chen1-0/+7
suspend During system suspend, the role switch may occur, eg, from gadget->host. In this case, the vbus disconnect event is lost, we add this handling in role switch routine in this commit. Signed-off-by: Peter Chen <[email protected]>
2020-03-16usb: chipidea: udc: using structure ci_hdrc device for runtime PMPeter Chen1-8/+5
At current code, it doesn't maintain ci->gadget.dev's runtime PM status well, eg, during the PM operation, the PM counter for ci->gadget.dev doesn't be changed accordingly. In this commit, we use ci_hdrc device instead of ci->gadget.dev for runtime PM APIs at udc driver, in the way, we handle runtime PM APIs using unify device structure between core and udc driver. Reviewed-by: Jun Li <[email protected]> Signed-off-by: Peter Chen <[email protected]>
2020-03-15usb: gadget: aspeed: add ast2600 vhub supportTao Ren2-2/+5
Add AST2600 support in aspeed-vhub driver. There are 3 major differences between AST2500 and AST2600 vhub: - AST2600 supports 7 downstream ports while AST2500 supports 5. - AST2600 supports 21 generic endpoints while AST2500 supports 15. - EP0 data buffer's 8-byte DMA alignment restriction is removed from AST2600. Signed-off-by: Tao Ren <[email protected]> Reviewed-by: Andrew Jeffery <[email protected]> Acked-by: Benjamin Herrenschmidt <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-03-15usb: gadget: aspeed: read vhub properties from device treeTao Ren5-57/+88
The patch introduces 2 DT properties ("aspeed,vhub-downstream-ports" and "aspeed,vhub-generic-endpoints") which replaces hardcoded port/endpoint number. It is to make it more convenient to add support for newer vhub revisions with different number of ports and endpoints. Signed-off-by: Tao Ren <[email protected]> Reviewed-by: Joel Stanley <[email protected]> Acked-by: Benjamin Herrenschmidt <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-03-15usb: gadget: aspeed: support per-vhub usb descriptorsTao Ren2-12/+46
This patch store vhub's standard usb descriptors in struct "ast_vhub" so it's more convenient to customize descriptors and potentially support multiple vhub instances in the future. Signed-off-by: Tao Ren <[email protected]> Acked-by: Benjamin Herrenschmidt <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-03-15usb: gadget: f_phonet: Replace zero-length array with flexible-array memberGustavo A. R. Silva1-1/+1
The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertenly introduced[3] to the codebase from now on. This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-03-15usb: gadget: composite: Inform controller driver of self-poweredThinh Nguyen1-0/+9
Different configuration/condition may draw different power. Inform the controller driver of the change so it can respond properly (e.g. GET_STATUS request). This fixes an issue with setting MaxPower from configfs. The composite driver doesn't check this value when setting self-powered. Cc: [email protected] Fixes: 88af8bbe4ef7 ("usb: gadget: the start of the configfs interface") Signed-off-by: Thinh Nguyen <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-03-15usb: gadget: amd5536udc: fix spelling mistake "reserverd" -> "reserved"Alexandre Belloni1-1/+1
The variable is named reserved, the comment should say so. Signed-off-by: Alexandre Belloni <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-03-15udc: s3c-hsudc: Silence warning about supplies during deferred probeMarek Szyprowski1-1/+2
Don't confuse user with meaningless warning about the failure in getting supplies in case of deferred probe. Reviewed-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Marek Szyprowski <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-03-15usb: dwc2: Silence warning about supplies during deferred probeMarek Szyprowski1-1/+3
Don't confuse user with meaningless warning about the failure in getting supplies in case of deferred probe. Acked-by: Minas Harutyunyan <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Marek Szyprowski <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-03-15usb: gadget: add raw-gadget interfaceAndrey Konovalov3-0/+1090
USB Raw Gadget is a kernel module that provides a userspace interface for the USB Gadget subsystem. Essentially it allows to emulate USB devices from userspace. Enabled with CONFIG_USB_RAW_GADGET. Raw Gadget is currently a strictly debugging feature and shouldn't be used in production. Raw Gadget is similar to GadgetFS, but provides a more low-level and direct access to the USB Gadget layer for the userspace. The key differences are: 1. Every USB request is passed to the userspace to get a response, while GadgetFS responds to some USB requests internally based on the provided descriptors. However note, that the UDC driver might respond to some requests on its own and never forward them to the Gadget layer. 2. GadgetFS performs some sanity checks on the provided USB descriptors, while Raw Gadget allows you to provide arbitrary data as responses to USB requests. 3. Raw Gadget provides a way to select a UDC device/driver to bind to, while GadgetFS currently binds to the first available UDC. 4. Raw Gadget uses predictable endpoint names (handles) across different UDCs (as long as UDCs have enough endpoints of each required transfer type). 5. Raw Gadget has ioctl-based interface instead of a filesystem-based one. Reviewed-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Andrey Konovalov <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-03-15usb: dwc2: Implement set_selfpowered()John Keeping1-1/+23
dwc2 always reports as self-powered in response to a device status request. Implement the set_selfpowered() operations so that the gadget can report as bus-powered when appropriate. This is modelled on the dwc3 implementation. Acked-by: Minas Harutyunyan <[email protected]> Signed-off-by: John Keeping <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-03-15usb: dwc3: qcom: Replace <linux/clk-provider.h> by <linux/of_clk.h>Geert Uytterhoeven1-1/+1
The DWC3 USB driver is not a clock provider, and just needs to call of_clk_get_parent_count(). Hence it can include <linux/of_clk.h> instead of <linux/clk-provider.h>. Reviewed-by: Stephen Boyd <[email protected]> Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-03-15usb: dwc3: core: don't do suspend for device mode if already suspendedLi Jun1-0/+2
If dwc->dev in device mode already runtime suspended, don't do it again for system suspend. Signed-off-by: Li Jun <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-03-15usb: dwc3: Rework resets initialization to be more flexibleJohn Stultz1-1/+1
The dwc3 core binding specifies one reset. However some variants of the hardware may have more. Previously this was handled by using the dwc3-of-simple glue driver, but that resulted in a proliferation of bindings for for every variant, when the only difference was the clocks and resets lists. So this patch reworks the reading of the resets to fetch all the resets specified in the dts together. This patch was recommended by Rob Herring <[email protected]> as an alternative to creating multiple bindings for each variant of hardware. Cc: Greg Kroah-Hartman <[email protected]> Cc: Rob Herring <[email protected]> Cc: Mark Rutland <[email protected]> CC: ShuFan Lee <[email protected]> Cc: Heikki Krogerus <[email protected]> Cc: Suzuki K Poulose <[email protected]> Cc: Chunfeng Yun <[email protected]> Cc: Yu Chen <[email protected]> Cc: Felipe Balbi <[email protected]> Cc: Hans de Goede <[email protected]> Cc: Andy Shevchenko <[email protected]> Cc: Jun Li <[email protected]> Cc: Valentin Schneider <[email protected]> Cc: Guillaume Gardet <[email protected]> Cc: Jack Pham <[email protected]> Cc: [email protected] Cc: [email protected] Suggested-by: Rob Herring <[email protected]> Signed-off-by: John Stultz <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-03-15usb: dwc3: Rework clock initialization to be more flexibleJohn Stultz1-15/+5
The dwc3 core binding specifies three clocks: ref, bus_early, and suspend which are all controlled in the driver together. However some variants of the hardware my not have all three clks, or some may have more. Usually this was handled by using the dwc3-of-simple glue driver, but that resulted in a proliferation of bindings for for every variant, when the only difference was the clocks and resets lists. So this patch reworks the reading of the clks from the dts to use devm_clk_bulk_get_all() will will fetch all the clocks specified in the dts together. This patch was recommended by Rob Herring <[email protected]> as an alternative to creating multiple bindings for each variant of hardware. Cc: Greg Kroah-Hartman <[email protected]> Cc: Rob Herring <[email protected]> Cc: Mark Rutland <[email protected]> CC: ShuFan Lee <[email protected]> Cc: Heikki Krogerus <[email protected]> Cc: Suzuki K Poulose <[email protected]> Cc: Chunfeng Yun <[email protected]> Cc: Yu Chen <[email protected]> Cc: Felipe Balbi <[email protected]> Cc: Hans de Goede <[email protected]> Cc: Andy Shevchenko <[email protected]> Cc: Jun Li <[email protected]> Cc: Valentin Schneider <[email protected]> Cc: Guillaume Gardet <[email protected]> Cc: Jack Pham <[email protected]> Cc: [email protected] Cc: [email protected] Suggested-by: Rob Herring <[email protected]> Signed-off-by: John Stultz <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-03-15usb: dwc3: Add support for role-switch-default-mode bindingJohn Stultz2-3/+25
Support the new role-switch-default-mode binding for configuring the default role the controller assumes as when the usb role is USB_ROLE_NONE This patch was split out from a larger patch originally by Yu Chen <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Rob Herring <[email protected]> Cc: Mark Rutland <[email protected]> CC: ShuFan Lee <[email protected]> Cc: Heikki Krogerus <[email protected]> Cc: Suzuki K Poulose <[email protected]> Cc: Chunfeng Yun <[email protected]> Cc: Yu Chen <[email protected]> Cc: Felipe Balbi <[email protected]> Cc: Hans de Goede <[email protected]> Cc: Andy Shevchenko <[email protected]> Cc: Jun Li <[email protected]> Cc: Valentin Schneider <[email protected]> Cc: Guillaume Gardet <[email protected]> Cc: Bryan O'Donoghue <[email protected]> Cc: Jack Pham <[email protected]> Cc: [email protected] Cc: [email protected] Tested-by: Bryan O'Donoghue <[email protected]> Signed-off-by: John Stultz <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-03-15usb: dwc3: Registering a role switch in the DRD code.Yu Chen2-1/+79
The Type-C drivers use USB role switch API to inform the system about the negotiated data role, so registering a role switch in the DRD code in order to support platforms with USB Type-C connectors. Cc: Greg Kroah-Hartman <[email protected]> Cc: Rob Herring <[email protected]> Cc: Mark Rutland <[email protected]> CC: ShuFan Lee <[email protected]> Cc: Heikki Krogerus <[email protected]> Cc: Suzuki K Poulose <[email protected]> Cc: Chunfeng Yun <[email protected]> Cc: Yu Chen <[email protected]> Cc: Felipe Balbi <[email protected]> Cc: Hans de Goede <[email protected]> Cc: Andy Shevchenko <[email protected]> Cc: Jun Li <[email protected]> Cc: Valentin Schneider <[email protected]> Cc: Guillaume Gardet <[email protected]> Cc: Jack Pham <[email protected]> Cc: Bryan O'Donoghue <[email protected]> Cc: [email protected] Cc: [email protected] Suggested-by: Heikki Krogerus <[email protected]> Tested-by: Bryan O'Donoghue <[email protected]> Signed-off-by: Yu Chen <[email protected]> Signed-off-by: John Stultz <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-03-15usb: dwc3: core: add support for disabling SS instances in park modeNeil Armstrong2-0/+9
In certain circumstances, the XHCI SuperSpeed instance in park mode can fail to recover, thus on Amlogic G12A/G12B/SM1 SoCs when there is high load on the single XHCI SuperSpeed instance, the controller can crash like: xhci-hcd xhci-hcd.0.auto: xHCI host not responding to stop endpoint command. xhci-hcd xhci-hcd.0.auto: Host halt failed, -110 xhci-hcd xhci-hcd.0.auto: xHCI host controller not responding, assume dead xhci-hcd xhci-hcd.0.auto: xHCI host not responding to stop endpoint command. hub 2-1.1:1.0: hub_ext_port_status failed (err = -22) xhci-hcd xhci-hcd.0.auto: HC died; cleaning up usb 2-1.1-port1: cannot reset (err = -22) Setting the PARKMODE_DISABLE_SS bit in the DWC3_USB3_GUCTL1 mitigates the issue. The bit is described as : "When this bit is set to '1' all SS bus instances in park mode are disabled" Synopsys explains: The GUCTL1.PARKMODE_DISABLE_SS is only available in dwc_usb3 controller running in host mode. This should not be set for other IPs. This can be disabled by default based on IP, but I recommend to have a property to enable this feature for devices that need this. CC: Dongjin Kim <[email protected]> Cc: Jianxin Pan <[email protected]> Cc: Thinh Nguyen <[email protected]> Cc: Jun Li <[email protected]> Reported-by: Tim <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-03-15usb: dwc3: gadget: Wrap around when skip TRBsThinh Nguyen1-1/+1
When skipping TRBs, we need to account for wrapping around the ring buffer and not modifying some invalid TRBs. Without this fix, dwc3 won't be able to check for available TRBs. Cc: stable <[email protected]> Fixes: 7746a8dfb3f9 ("usb: dwc3: gadget: extract dwc3_gadget_ep_skip_trbs()") Signed-off-by: Thinh Nguyen <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-03-15usb: dwc3: gadget: Don't clear flags before transfer endedThinh Nguyen1-3/+1
We track END_TRANSFER command completion. Don't clear transfer started/ended flag prematurely. Otherwise, we'd run into the problem with restarting transfer before END_TRANSFER command finishes. Fixes: 6d8a019614f3 ("usb: dwc3: gadget: check for Missed Isoc from event status") Signed-off-by: Thinh Nguyen <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-03-15usb: dwc3: Remove kernel doc annotation where it's not neededAndy Shevchenko1-1/+1
The main comment in the file mistakenly marked with kernel doc annotation which makes the parser unhappy: .../dwc3/host.c:16: warning: Function parameter or member 'dwc' not described in 'dwc3_host_get_irq' Drop kernel doc annotation from host.c module. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-03-15usb: dwc3: Add ACPI support for xHCI portsAndy Shevchenko1-0/+2
The ACPI companion of the adapter has to be set for xHCI controller code to read and attach the ports described in the ACPI table. Use ACPI_COMPANION_SET macro to set this. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-03-15usb: dwc3: exynos: Add support for Exynos5422 suspend clkAnand Moon1-0/+9
Exynos5422 DWC3 module support two clk USBD300 and SCLK_USBD300 so add missing code to enable/disable code and suspend clk, for this add a new compatible samsung,exynos5420-dwusb3 to help configure dwc3 code and dwc3 suspend clock. Suspend clock controls the PHY power change from P0 to P1/P2/P3 during U0 to U1/U2/U3 transition. Signed-off-by: Anand Moon <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-03-15usb: dwc3: meson-g12a: Don't use ret uninitialized in dwc3_meson_g12a_otg_initNathan Chancellor1-1/+1
Clang warns: ../drivers/usb/dwc3/dwc3-meson-g12a.c:421:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (priv->otg_mode == USB_DR_MODE_OTG) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../drivers/usb/dwc3/dwc3-meson-g12a.c:455:9: note: uninitialized use occurs here return ret; ^~~ ../drivers/usb/dwc3/dwc3-meson-g12a.c:421:2: note: remove the 'if' if its condition is always true if (priv->otg_mode == USB_DR_MODE_OTG) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../drivers/usb/dwc3/dwc3-meson-g12a.c:415:9: note: initialize the variable 'ret' to silence this warning int ret, irq; ^ = 0 1 warning generated. It is not wrong, ret is only used when that if statement is true. Just directly return 0 at the end to avoid this. Fixes: 729149c53f04 ("usb: dwc3: Add Amlogic A1 DWC3 glue") Reported-by: kbuild test robot <[email protected]> Link: https://groups.google.com/d/msg/clang-built-linux/w5iBENco_m4/PPuXreAxBQAJ Link: https://github.com/ClangBuiltLinux/linux/issues/869 Signed-off-by: Nathan Chancellor <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-03-15usb: cdns3: remove redundant assignment to pointer trbColin Ian King1-1/+1
Pointer trb being assigned with a value that is never read, it is assigned a new value later on. The assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-03-15usb: gadget: remove redundant assignment to variable statusColin Ian King1-2/+0
Variable status is being assigned with a value that is never read, it is assigned a new value immediately afterwards. The assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-03-15usb: gadget: xudc: Remove redundant platform_get_irq error messageYueHaibing1-4/+1
platform_get_irq() will call dev_err() itself on failure, so there is no need for the driver to also do this. This is detected by coccinelle. Acked-by: Thierry Reding <[email protected]> Reviewed-by: Nagarjuna Kristam <[email protected]> Signed-off-by: YueHaibing <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-03-15usb: dwc2: add support for STM32MP15 SoCs USB OTG HS and FSAmelie Delaunay4-2/+141
This patch introduces a new parameter to activate external ID pin and valid vbus level detection, required on STM32MP15 SoC to support dual role, either in HS or FS. The STM32MP15 SoC uses the GGPIO register to enable the level detection. The level detector requires to be powered. Also adds the params structures for STM32MP15 OTG HS and STM32MP1 OTG FS. Acked-by: Minas Harutyunyan <[email protected]> Signed-off-by: Amelie Delaunay <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-03-15usb: dwc3: Add Amlogic A1 DWC3 glueHanjie Lin1-56/+116
Adds support for Amlogic A1 USB Control Glue HW. The Amlogic A1 SoC Family embeds 1 USB Controllers: - a DWC3 IP configured as Host for USB2 and USB3 A glue connects the controllers to the USB2 PHY of A1 SoC. Signed-off-by: Yue Wang <[email protected]> Signed-off-by: Hanjie Lin <[email protected]> Reviewed-by: Martin Blumenstingl <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-03-15usb: gadget: add udc driver for max3420Jassi Brar3-0/+1342
The MAX3420 is USB2.0 only, UDC-over-SPI controller. This driver also supports the peripheral mode of MAX3421. Signed-off-by: Jassi Brar <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-03-15usb: dwc3: trace: print enqueue/dequeue pointers tooFelipe Balbi1-2/+7
By printing enqueue/dequeue pointers, we can make sure that our TRB handling is correct. We've had a recent situation where we were not always dequeueing all TRBs in an SG list and this helped figure out what the problem was. Signed-off-by: Felipe Balbi <[email protected]>
2020-03-12xhci-pci: Allow host runtime PM as default for Intel Tiger Lake xHCIMika Westerberg1-1/+3
In the same way as Intel Ice Lake TCSS (Type-C Subsystem) the Tiger Lake TCSS xHCI needs to be runtime suspended whenever possible to allow the TCSS hardware block to enter D3cold and thus save energy. Signed-off-by: Mika Westerberg <[email protected]> Signed-off-by: Mathias Nyman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-03-12xhci: Finetune host initiated USB3 rootport link suspend and resumeMathias Nyman1-11/+25
Depending on the current link state the steps to resume the link to U0 varies. The normal case when a port is suspended (U3) we set the link to U0 and wait for a port event when U3exit completed and port moved to U0. If the port is in U1/U2, then no event is issued, just set link to U0 If port is in Resume or Recovery state then the device has already initiated resume, and this host initiated resume is racing against it. Port event handler for device initiated resume will set link to U0, just wait for the port to reach U0 before returning. Signed-off-by: Mathias Nyman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-03-12xhci: Wait until link state trainsits to U0 after setting USB_SS_PORT_LS_U0Kai-Heng Feng4-13/+34
Like U3 case, xHCI spec doesn't specify the upper bound of U0 transition time. The 20ms is not enough for some devices. Intead of polling PLS or PLC, we can facilitate the port change event to know that the link transits to U0 is completed. While at it, also separate U0 and U3 case to make the code cleaner. [variable rename to u3exit, and skip completion for usb2 ports -Mathias ] Signed-off-by: Kai-Heng Feng <[email protected]> Signed-off-by: Mathias Nyman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-03-12xhci: Ensure link state is U3 after setting USB_SS_PORT_LS_U3Kai-Heng Feng1-1/+10
The xHCI spec doesn't specify the upper bound of U3 transition time. For some devices 20ms is not enough, so we need to make sure the link state is in U3 before further actions. I've tried to use U3 Entry Capability by setting U3 Entry Enable in config register, however the port change event for U3 transition interrupts the system suspend process. For now let's use the less ideal method by polling PLS. [use usleep_range(), and shorten the delay time while polling -Mathias] Signed-off-by: Kai-Heng Feng <[email protected]> Signed-off-by: Mathias Nyman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-03-12usb: host: xhci-tegra: Tegra186/Tegra194 LPMJC Kuo1-0/+7
Tegra186 and Tegra194 xHC supports USB 3.0 LPM. This commit enables XHCI_LPM_SUPPORT quirk for Tegra186 and Tegra194. Signed-off-by: JC Kuo <[email protected]> Acked-by: Thierry Reding <[email protected]> Signed-off-by: Mathias Nyman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-03-12usb: xhci: Enable LPM for VIA LABS VL805Nicolas Saenz Julienne1-0/+3
This PCIe controller chip is used on the Raspberry Pi 4 and multiple adapter cards. There is no publicly available documentation for the chip, yet both the downstream RPi4 kernel and the controller cards support/advertise LPM support. Signed-off-by: Nicolas Saenz Julienne <[email protected]> Signed-off-by: Mathias Nyman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-03-12xhci: Show host status when watchdog triggers and host is assumed dead.Mathias Nyman2-0/+33
Additional debugging to show xHC USBSTS register when stop endpoint command watchdog triggers and host is assumed dead. useful to know the current status before the controller is stopped by the xhci driver and everything is released and freed. Signed-off-by: Mathias Nyman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-03-12xhci: Add a separate debug message for split transaction errors.Mathias Nyman1-0/+4
Don't show the same error message for transaction errors and split transaction errors. It's very confusing while debugging. Transaction errors are often due to electrical interference. Split transaction errors are about xHC not being able to schedule start and complete split transactions needed to address low- and full-speed devices behind high-speed hubs. Signed-off-by: Mathias Nyman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-03-12xhci: bail out early if driver can't accress host in resumeMathias Nyman1-1/+3
Bail out early if the xHC host needs to be reset at resume but driver can't access xHC PCI registers. If xhci driver already fails to reset the controller then there is no point in attempting to free, re-initialize, re-allocate and re-start the host. If failure to access the host is detected later, failing the resume, xhci interrupts will be double freed when remove is called. Signed-off-by: Mathias Nyman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-03-12USB: serial: pl2303: add device-id for HP LD381Scott Chen2-0/+2
Add a device id for HP LD381 Display LD381: 03f0:0f7f Signed-off-by: Scott Chen <[email protected]> Cc: stable <[email protected]> Signed-off-by: Johan Hovold <[email protected]>