usb: dwc3: ep0: use gadget->isoch_delay for isoch_delay value
authorFelipe Balbi <felipe.balbi@linux.intel.com>
Tue, 14 Nov 2017 10:29:33 +0000 (12:29 +0200)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Mon, 11 Dec 2017 10:36:49 +0000 (12:36 +0200)
Instead of keeping our own isoch_delay, let's make use of the newly
introduced isoch_delay member in struct usb_gadget. The benefit here
is that we would be using a generic "API" which other UDCs can use,
resulting in a common setup for gadget drivers who may be interested
in Isoch Delay value.

Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/dwc3/core.h
drivers/usb/dwc3/ep0.c

index 4a4a4c98508c47bd84586beca05931bec5fb0e59..be60d797f3ee74b5f9fbfb85287a2cda9c4d65d3 100644 (file)
@@ -796,7 +796,6 @@ struct dwc3_scratchpad_array {
  * @usb2_generic_phy: pointer to USB2 PHY
  * @usb3_generic_phy: pointer to USB3 PHY
  * @ulpi: pointer to ulpi interface
- * @isoch_delay: wValue from Set Isochronous Delay request;
  * @u2sel: parameter from Set SEL request.
  * @u2pel: parameter from Set SEL request.
  * @u1sel: parameter from Set SEL request.
@@ -955,7 +954,6 @@ struct dwc3 {
        enum dwc3_ep0_state     ep0state;
        enum dwc3_link_state    link_state;
 
-       u16                     isoch_delay;
        u16                     u2sel;
        u16                     u2pel;
        u8                      u1sel;
index fd3e7ad2eb0e85b68e1600755b93a35da7b7d7da..9c2e4a17918e4c98fbd6d383a91d02388168e2b3 100644 (file)
@@ -736,11 +736,7 @@ static int dwc3_ep0_set_isoch_delay(struct dwc3 *dwc, struct usb_ctrlrequest *ct
        if (wIndex || wLength)
                return -EINVAL;
 
-       /*
-        * REVISIT It's unclear from Databook what to do with this
-        * value. For now, just cache it.
-        */
-       dwc->isoch_delay = wValue;
+       dwc->gadget.isoch_delay = wValue;
 
        return 0;
 }