linux/drivers/usb/dwc2
John Keeping 92ef98a4ca usb: dwc2: gadget: initialize max_speed from params
DWC2 may be paired with a full-speed PHY which is not capable of
high-speed operation.  Report this correctly to the gadget core by
setting max_speed from the core parameters.

Prior to commit 5324bad66f ("usb: dwc2: gadget: implement
udc_set_speed()") this didn't cause the hardware to be configured
incorrectly, although the speed may have been reported incorrectly.  But
after that commit params.speed is updated based on a value passed in by
the gadget core which may set it to a faster speed than is supported by
the hardware.  Initialising the max_speed parameter ensures the speed
passed to dwc2_gadget_set_speed() will be one supported by the hardware.

Fixes: 5324bad66f ("usb: dwc2: gadget: implement udc_set_speed()")
Acked-by: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>
Signed-off-by: John Keeping <john@metanate.com>
Link: https://lore.kernel.org/r/20220106115731.1473909-1-john@metanate.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-06 15:28:12 +01:00
..
core_intr.c usb: dwc2: Skip clock gating on Samsung SoCs 2021-07-21 09:50:27 +02:00
core.c usb: dwc2: Fix spelling mistake "was't" -> "wasn't" 2021-08-27 10:29:54 +02:00
core.h usb: dwc2: Simplify a bitmap declaration 2021-12-30 13:16:13 +01:00
debug.h USB: dwc2: Use the correct style for SPDX License Identifier 2020-05-05 10:58:50 +03:00
debugfs.c usb: dwc2: add otg_rev and otg_caps information for gadget driver 2021-10-25 09:20:26 +02:00
drd.c usb: dwc2: drd: restore role and overrides upon resume 2021-12-17 16:52:51 +01:00
gadget.c usb: dwc2: gadget: initialize max_speed from params 2022-01-06 15:28:12 +01:00
hcd_ddma.c usb: dwc2: Modify dwc2_readl/writel functions prototype 2018-07-30 10:39:16 +03:00
hcd_intr.c usb: dwc2: Make "trimming xfer length" a debug message 2021-01-26 18:42:15 +01:00
hcd_queue.c usb: dwc2: hcd_queue: Fix use of floating point literal 2021-11-17 15:03:34 +01:00
hcd.c usb: dwc2: do not gate off the hardware if it does not support clock gating 2022-01-06 15:27:53 +01:00
hcd.h USB: dwc2: Use the correct style for SPDX License Identifier 2020-05-05 10:58:50 +03:00
hw.h usb: dwc2: Update enter and exit partial power down functions 2021-04-09 15:16:38 +02:00
Kconfig usb: dwc2: override PHY input signals with usb role switch support 2020-10-02 13:29:13 +03:00
Makefile usb: dwc2: override PHY input signals with usb role switch support 2020-10-02 13:29:13 +03:00
params.c usb: dwc2: stm32mp15: set otg_rev 2021-10-25 09:20:26 +02:00
pci.c usb: dwc2: pci: Fix possible copy/paste issue 2021-05-27 09:45:27 +02:00
platform.c Linux 5.16-rc6 2021-12-20 09:58:10 +01:00