summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2011-08-29 11:54:08 +0300
committerJason Liu <r64343@freescale.com>2012-01-09 21:11:24 +0800
commit7f9e8ae00ae9db2cd3551aa23275bd5f4b2ad869 (patch)
treef8f711c1fe5fe980ab503b0777627e351b493470 /drivers/usb
parentb66ac61c83bf8947c0f470fba395b072a5ee9a75 (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>
Diffstat (limited to 'drivers/usb')
-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 fd5507f3cee6..979f92caef84 100644
--- a/drivers/usb/gadget/f_audio.c
+++ b/drivers/usb/gadget/f_audio.c
@@ -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;