From: Roger Quadros <rogerq@ti.com>
To: Sekhar Nori <nsekhar@ti.com>, Felipe Balbi <balbi@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Bin Liu <b-liu@ti.com>, <linux-usb@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] usb: gadget: f_uac2: calculate wMaxPacketSize before endpoint match
Date: Tue, 8 Aug 2017 17:20:21 +0300 [thread overview]
Message-ID: <d2749cab-be73-6744-fed7-3670417ee914@ti.com> (raw)
In-Reply-To: <09d1259f224a2427a326d3589765dc149e577c75.1495008408.git.nsekhar@ti.com>
On 17/05/17 11:15, Sekhar Nori wrote:
> Calculate wMaxPacketSize before endpoint matching the
> descriptor is found.
>
> This allows audio gadget to be used with controllers
> which have a shortage or unavailability of endpoints
> that can handle max packet size of 1023 (FS) or 1024
> (HS).
>
> With this audio gadget can be used on TI's OMAP-L138 SoC
> which has a MUSB HS controller with endpoints having max
> packet size much less than 1023 or 1024. See mode_2_cfg in
> drivers/usb/musb/musb_core.c
>
> Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Acked-by: Roger Quadros <rogerq@ti.com>
> ---
> drivers/usb/gadget/function/f_uac2.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c
> index f6a0d3a1311b..5a7ba058d947 100644
> --- a/drivers/usb/gadget/function/f_uac2.c
> +++ b/drivers/usb/gadget/function/f_uac2.c
> @@ -1065,6 +1065,12 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn)
> agdev->as_in_intf = ret;
> agdev->as_in_alt = 0;
>
> + /* Calculate wMaxPacketSize according to audio bandwidth */
> + set_ep_max_packet_size(uac2_opts, &fs_epin_desc, 1000, true);
> + set_ep_max_packet_size(uac2_opts, &fs_epout_desc, 1000, false);
> + set_ep_max_packet_size(uac2_opts, &hs_epin_desc, 8000, true);
> + set_ep_max_packet_size(uac2_opts, &hs_epout_desc, 8000, false);
> +
> agdev->out_ep = usb_ep_autoconfig(gadget, &fs_epout_desc);
> if (!agdev->out_ep) {
> dev_err(dev, "%s:%d Error!\n", __func__, __LINE__);
> @@ -1080,12 +1086,6 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn)
> uac2->p_prm.uac2 = uac2;
> uac2->c_prm.uac2 = uac2;
>
> - /* Calculate wMaxPacketSize according to audio bandwidth */
> - set_ep_max_packet_size(uac2_opts, &fs_epin_desc, 1000, true);
> - set_ep_max_packet_size(uac2_opts, &fs_epout_desc, 1000, false);
> - set_ep_max_packet_size(uac2_opts, &hs_epin_desc, 8000, true);
> - set_ep_max_packet_size(uac2_opts, &hs_epout_desc, 8000, false);
> -
> hs_epout_desc.bEndpointAddress = fs_epout_desc.bEndpointAddress;
> hs_epin_desc.bEndpointAddress = fs_epin_desc.bEndpointAddress;
>
>
--
cheers,
-roger
next prev parent reply other threads:[~2017-08-08 14:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-17 8:15 Sekhar Nori
2017-08-08 14:20 ` Roger Quadros [this message]
2017-08-08 14:27 ` Sekhar Nori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d2749cab-be73-6744-fed7-3670417ee914@ti.com \
--to=rogerq@ti.com \
--cc=b-liu@ti.com \
--cc=balbi@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=nsekhar@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®