]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
usb: gadget: audio: queue wLength-sized requests
authorFelipe Balbi <balbi@ti.com>
Mon, 29 Aug 2011 08:54:08 +0000 (11:54 +0300)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:33:39 +0000 (08:33 +0200)
On Audio class, the wLength field of the Setup
packet, contains the data payload size of the
following Data phase. Instead of harcoding values,
use wLength.

This also fixes a bug where Gadget driver had to
receive 3 bytes, but it was queueing a ZLP.

Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/f_audio.c

index fd5507f3cee672d425f41310839ccb8ab32fd4fb..979f92caef844b1102ceab6e468bbe9814bdfab4 100644 (file)
@@ -461,7 +461,7 @@ static int audio_set_endpoint_req(struct usb_function *f,
 
        switch (ctrl->bRequest) {
        case UAC_SET_CUR:
-               value = 0;
+               value = len;
                break;
 
        case UAC_SET_MIN:
@@ -500,7 +500,7 @@ static int audio_get_endpoint_req(struct usb_function *f,
        case UAC_GET_MIN:
        case UAC_GET_MAX:
        case UAC_GET_RES:
-               value = 3;
+               value = len;
                break;
        case UAC_GET_MEM:
                break;