mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kaf@nwlink.com
To: Francesco Lavra <flavra@baylibre.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, 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, 30 Oct 2026 09:31:03 -0700	[thread overview]
Message-ID: <e2d166b9580acddd69b8a8cab73f4f60@nwlink.com> (raw)
In-Reply-To: <0bb53b3f00e9a1a834e32979bd1e08ecc4517411.camel@baylibre.com>

On 2026-10-23 03:39, Francesco Lavra wrote:
> 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 */

Agreed, and thanks for taking a look. The resolved channel counts 
replace the channel masks.
I'll remove them in v3.

  reply	other threads:[~2026-10-30 16:31 UTC|newest]

Thread overview: 7+ 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
2026-10-30 16:31     ` kaf [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=e2d166b9580acddd69b8a8cab73f4f60@nwlink.com \
    --to=kaf@nwlink.com \
    --cc=corbet@lwn.net \
    --cc=flavra@baylibre.com \
    --cc=gregkh@linuxfoundation.org \
    --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®