summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2011-08-29 04:54:08 -0400
committerFelipe Balbi <balbi@ti.com>2011-09-09 06:06:06 -0400
commit7c5881d1625d844cdfcc027a970f0d034b982ba5 (patch)
treec57820b64f80d9a9e1acef233a8bcb08998436ee
parentef7f584ce7b40bcfc108477d2711270379ca8596 (diff)
usb: gadget: audio: queue wLength-sized requests
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>
-rw-r--r--drivers/usb/gadget/f_audio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/gadget/f_audio.c b/drivers/usb/gadget/f_audio.c
index ddeaa45cd886..ec7ffcd0d0cd 100644
--- a/drivers/usb/gadget/f_audio.c
+++ b/drivers/usb/gadget/f_audio.c
@@ -460,7 +460,7 @@ static int audio_set_endpoint_req(struct usb_function *f,
460 460
461 switch (ctrl->bRequest) { 461 switch (ctrl->bRequest) {
462 case UAC_SET_CUR: 462 case UAC_SET_CUR:
463 value = 0; 463 value = len;
464 break; 464 break;
465 465
466 case UAC_SET_MIN: 466 case UAC_SET_MIN:
@@ -499,7 +499,7 @@ static int audio_get_endpoint_req(struct usb_function *f,
499 case UAC_GET_MIN: 499 case UAC_GET_MIN:
500 case UAC_GET_MAX: 500 case UAC_GET_MAX:
501 case UAC_GET_RES: 501 case UAC_GET_RES:
502 value = 3; 502 value = len;
503 break; 503 break;
504 case UAC_GET_MEM: 504 case UAC_GET_MEM:
505 break; 505 break;