Re: [PATCH v4 1/1] usb: gadget: f_uac2: finalize wMaxPacketSize according to bandwidth

2015-07-28 Thread Daniel Mack
On 07/28/2015 03:38 AM, Peter Chen wrote: +static void set_ep_max_packet_size (struct f_uac2_opts *uac2_opts, + struct usb_endpoint_descriptor *ep_desc, unsigned int factor) +{ + int chmask; + int srate; + int ssize; + u16 max_packet_size; + + if (ep_desc ==

Re: [PATCH v4 1/1] usb: gadget: f_uac2: finalize wMaxPacketSize according to bandwidth

2015-07-28 Thread Peter Chen
On Tue, Jul 28, 2015 at 10:13:48AM +0200, Daniel Mack wrote: On 07/28/2015 03:38 AM, Peter Chen wrote: diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c index 5318615..6a8e0d2 100644 --- a/drivers/usb/gadget/function/f_uac2.c +++

Re: [PATCH v4 1/1] usb: gadget: f_uac2: finalize wMaxPacketSize according to bandwidth

2015-07-28 Thread Daniel Mack
On 07/28/2015 11:30 AM, Daniel Mack wrote: On 07/28/2015 03:38 AM, Peter Chen wrote: +static void set_ep_max_packet_size (struct f_uac2_opts *uac2_opts, +struct usb_endpoint_descriptor *ep_desc, unsigned int factor) +{ +int chmask; +int srate; +int ssize; +u16

Re: [PATCH v4 1/1] usb: gadget: f_uac2: finalize wMaxPacketSize according to bandwidth

2015-07-28 Thread Daniel Mack
On 07/28/2015 03:38 AM, Peter Chen wrote: diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c index 5318615..6a8e0d2 100644 --- a/drivers/usb/gadget/function/f_uac2.c +++ b/drivers/usb/gadget/function/f_uac2.c @@ -975,6 +975,31 @@ free_ep(struct

[PATCH v4 1/1] usb: gadget: f_uac2: finalize wMaxPacketSize according to bandwidth

2015-07-27 Thread Peter Chen
According to USB Audio Device 2.0 Spec, Ch4.10.1.1: wMaxPacketSize is defined as follows: Maximum packet size this endpoint is capable of sending or receiving when this configuration is selected. This is determined by the audio bandwidth constraints of the endpoint. In current code, the