diff options
author | Vardan Mikayelyan <mvardan@synopsys.com> | 2016-11-15 06:17:03 +0300 |
---|---|---|
committer | Felipe Balbi <felipe.balbi@linux.intel.com> | 2016-11-18 14:54:50 +0300 |
commit | 38e9002b85672352f8693c82192c8029586dd86d (patch) | |
tree | 115f261b377c5a6aaadeac62167df603d1cb7f0f /drivers/usb/dwc2/params.c | |
parent | 552d940f0bea0c010615b45ed7c64e7b3b103e6a (diff) | |
download | linux-38e9002b85672352f8693c82192c8029586dd86d.tar.xz |
usb: dwc2: gadget: Add new core parameter for low speed
Added new core param for low speed, which can be used only when SNPSID
is equal to DWC2_CORE_FS_IOT. When LS mode is enabled, we are
restricting ep types and providing to upper layer only INTR and CTRL
endpoints.
Signed-off-by: Vardan Mikayelyan <mvardan@synopsys.com>
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/dwc2/params.c')
-rw-r--r-- | drivers/usb/dwc2/params.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c index 2fd461de63a8..1bf3b0936d87 100644 --- a/drivers/usb/dwc2/params.c +++ b/drivers/usb/dwc2/params.c @@ -742,14 +742,18 @@ static void dwc2_set_param_speed(struct dwc2_hsotg *hsotg, int val) { int valid = 1; - if (DWC2_OUT_OF_BOUNDS(val, 0, 1)) { + if (DWC2_OUT_OF_BOUNDS(val, 0, 2)) { if (val >= 0) { dev_err(hsotg->dev, "Wrong value for speed parameter\n"); - dev_err(hsotg->dev, "max_speed parameter must be 0 or 1\n"); + dev_err(hsotg->dev, "max_speed parameter must be 0, 1, or 2\n"); } valid = 0; } + if (dwc2_is_hs_iot(hsotg) && + val == DWC2_SPEED_PARAM_LOW) + valid = 0; + if (val == DWC2_SPEED_PARAM_HIGH && dwc2_get_param_phy_type(hsotg) == DWC2_PHY_TYPE_PARAM_FS) valid = 0; |