Skip to content

Commit

Permalink
usb: gadget: audio: queue wLength-sized requests
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Felipe Balbi committed Sep 9, 2011
1 parent ef7f584 commit 7c5881d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/usb/gadget/f_audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,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:
Expand Down Expand Up @@ -499,7 +499,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;
Expand Down

0 comments on commit 7c5881d

Please sign in to comment.