From: Francesco Lavra <flavra@baylibre.com>
To: Kyle Farrell <kaf@nwlink.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org
Cc: Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>,
linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org
Subject: Re: [PATCH v2 1/2 RESEND] usb: gadget: u_audio: pass channel counts explicitly
Date: Fri, 23 Oct 2026 12:39:51 +0200 [thread overview]
Message-ID: <0bb53b3f00e9a1a834e32979bd1e08ecc4517411.camel@baylibre.com> (raw)
In-Reply-To: <20261016162534.384844-2-kaf@nwlink.com>
On Fri, 2026-10-16 at 09:25 -0700, Kyle Farrell wrote:
> u_audio currently derives the channel count from the channel mask in
> struct uac_params in several places. Instead, pass the resolved count
> explicitly, so the shared audio implementation does not depend on how
> an individual USB audio function represents its channel configuration.
>
> Initialize the new channel count fields from the existing channel masks.
> This preserves generated descriptors and makes no change to user-visible
> behavior.
>
> Assisted-by: LLM
> Signed-off-by: Kyle Farrell <kaf@nwlink.com>
> ---
...
> diff --git a/drivers/usb/gadget/function/u_audio.h
> b/drivers/usb/gadget/function/u_audio.h
> index 9512b8fccfaa..46e1d6b5ca4e 100644
> --- a/drivers/usb/gadget/function/u_audio.h
> +++ b/drivers/usb/gadget/function/u_audio.h
> @@ -41,12 +41,14 @@ struct uac_fu_params {
> struct uac_params {
> /* playback */
> int p_chmask; /* channel mask */
With these changes, the channel masks are no longer used in u_audio.c, so
we can remove them.
> + unsigned int p_channels; /* resolved number of channels */
> int p_srate; /* rate in Hz */
> int p_ssize; /* sample size */
> struct uac_fu_params p_fu; /* Feature Unit parameters */
>
> /* capture */
> int c_chmask; /* channel mask */
> + unsigned int c_channels; /* resolved number of channels */
> int c_srate; /* rate in Hz */
> int c_ssize; /* sample size */
> struct uac_fu_params c_fu; /* Feature Unit parameters */
next prev parent reply other threads:[~2026-10-23 10:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-16 16:25 [PATCH v2 0/2 RESEND] usb: gadget: uac2: support explicit channel counts Kyle Farrell
2026-10-16 16:25 ` [PATCH v2 1/2 RESEND] usb: gadget: u_audio: pass channel counts explicitly Kyle Farrell
2026-10-23 10:39 ` Francesco Lavra [this message]
2026-10-16 16:25 ` [PATCH v2 2/2 RESEND] usb: gadget: f_uac2: allow explicit channel count independent of channel mask Kyle Farrell
2026-10-17 8:05 ` [PATCH v2 0/2 RESEND] usb: gadget: uac2: support explicit channel counts Greg Kroah-Hartman
2026-10-17 15:56 ` kaf
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=0bb53b3f00e9a1a834e32979bd1e08ecc4517411.camel@baylibre.com \
--to=flavra@baylibre.com \
--cc=corbet@lwn.net \
--cc=gregkh@linuxfoundation.org \
--cc=kaf@nwlink.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=skhan@linuxfoundation.org \
/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®