Linux-api Archive mirror
 help / color / mirror / Atom feed
From: Pavel Hofman <pavel.hofman@ivitera.com>
To: Chris Wulff <Chris.Wulff@biamp.com>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	James Gruber <jimmyjgruber@gmail.com>, Lee Jones <lee@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-api@vger.kernel.org" <linux-api@vger.kernel.org>,
	Takashi Iwai <tiwai@suse.de>
Subject: Re: [PATCH v2] usb: gadget: f_uac2: Expose all string descriptors through configfs.
Date: Sun, 28 Apr 2024 13:49:00 +0200	[thread overview]
Message-ID: <817d5f6c-0f9d-7f88-b5ca-26c3547730fb@ivitera.com> (raw)
In-Reply-To: <CO1PR17MB541942196F9A2F73CF8B5B14E1152@CO1PR17MB5419.namprd17.prod.outlook.com>

On 27. 04. 24 18:27, Chris Wulff wrote:
>> From: Pavel Hofman <pavel.hofman@ivitera.com>
>>>>> +             p_it_name               playback input terminal name
>>>>> +             p_ot_name               playback output terminal name
>>>>> +             p_fu_name               playback function unit name
>>>>> +             p_alt0_name             playback alt mode 0 name
>>>>> +             p_alt1_name             playback alt mode 1 name
>>>>
>>>> Nacked-by: Pavel Hofman <pavel.hofman@ivitera.com>
> ...
>> If the params in the upper level were to stand as defaults for the
>> altsettings (and for the existing altsetting 1 if no specific altset
>> subdir configs were given), maybe the naming xxx_alt1_xxx could become a
>> bit confusing. E.g. p_altx_name or p_alt_non0_name?
> 
> I've been prototyping this a bit to see how it will work. My current configfs
> structure looks something like:
> 
> (all existing properties)
> c_it_name
> c_it_ch_name
> c_fu_name
> c_ot_name
> p_it_name
> p_it_ch_name
> p_fu_name
> p_ot_name
> num_alt_modes (settable to 2..5 in my prototype)
> 
> alt.0
>   c_alt_name
>   p_alt_name
> alt.1 (for alt.1, alt.2, etc.)
>   c_alt_name
>   p_alt_name
>   c_ssize
>   p_ssize
>   (Additional properties here for other things that are settable for each alt mode,
>    but the only one I've implemented in my prototype so far is sample size.)
> 

Hats off to your speed, that's amazing. IMO this is a perfect config
layout, logical, extensible, easy to generate manually as well as with a
script.


> This brings up a few questions:
> 
> Is a property for setting the number of alt modes preferred, or being able to
> make directories like some other things (eg, "mkdir alt.5" would add alt mode 5)?
> The former is what I started with, but I am leaning towards the latter as it is a bit
> more flexible (you could create alt modes of any index, though I'm not entirely
> sure why you'd want to.) It does involve a bit more dynamic memory allocation,
> but nothing crazy.

I am not sure the arbitrary index of alt mode would be useful (is it
even allowed in USB specs?). But I may not have understood your question
properly.

The num_alt_modes property - can the number be perhaps aquired from the
number of created directories? Or would that number of alt modes be
created automatically (all same with default values), and the properties
in alt.X dirs would subsequently only modify their respective values?

> 
> And second, should the alt.x directories go back to the defaults if you remove
> and re-create them? I'm assuming it makes sense to do that, just putting it out
> there since my current prototype doesn't work that way.

IIUC just creating the alt.X directory would create the alt X mode, with
default properties from the top-level configs or with the source-code
defaults.

Thanks a lot,

Pavel.

      reply	other threads:[~2024-04-28 11:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-23 14:09 [PATCH v2] usb: gadget: f_uac2: Expose all string descriptors through configfs Chris Wulff
2024-04-23 15:38 ` Pavel Hofman
2024-04-23 17:22   ` Chris Wulff
2024-04-24  7:55     ` Pavel Hofman
2024-04-24 19:01       ` Chris Wulff
2024-04-27 16:27       ` Chris Wulff
2024-04-28 11:49         ` Pavel Hofman [this message]

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=817d5f6c-0f9d-7f88-b5ca-26c3547730fb@ivitera.com \
    --to=pavel.hofman@ivitera.com \
    --cc=Chris.Wulff@biamp.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jimmyjgruber@gmail.com \
    --cc=lee@kernel.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=tiwai@suse.de \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).