Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
13ba0bb
xhci: sideband: avoid use-after-free of stale virt device pointer
matnyman Oct 15, 2026
4e4a456
xhci: sideband: check virt device under xhci lock when stopping endpo…
matnyman Nov 17, 2026
5ac44a0
xhci: sideband: check virt device under xhci lock when adding endpoints
matnyman Nov 24, 2026
cf30c65
xhci: Add initial support for Extended Property commands
matnyman Nov 27, 2026
e530643
xhci: sideband: support registering xHC controlled audio sideband
matnyman Dec 13, 2024
af75629
xhci: sideband: reserve and track sideband endpoint use with resource…
matnyman Dec 19, 2024
15c5552
xhci: sideband: support handing over endpoints to hardware controlled…
matnyman Dec 13, 2024
8b2a7d0
xhci: sideband: Add endpoint property query to sideband API
matnyman Feb 2, 2026
ce9d47c
xhci: sideband: Don't support Intel audio sideband for devices behind…
matnyman Oct 19, 2026
8ac2ff3
xhci: sideband: Add xhci_sideband_start_endpoint()
ujfalusi Nov 19, 2026
375c6d2
ALSA: hda: Add the 384kHz stream format encoding
ujfalusi Sep 2, 2026
bfdc614
ASoC: SOF: Intel: hda-pcm: Add the 384kHz mult/div encoding
ujfalusi Sep 2, 2026
7f8bc00
ASoC: usb: Match the backend context by device on non-DT platforms
ujfalusi Aug 10, 2026
3c5af24
ALSA: usb-audio: Let the offload path claim a PCM substream
ujfalusi Aug 12, 2026
995d35c
ALSA: usb-audio: Keep an offloaded endpoint away from the host
ujfalusi Nov 19, 2026
d32d5c4
ALSA: usb-audio: Add snd_usb_release_platform_ops()
ujfalusi Nov 19, 2026
b99d2be
ALSA: usb: Add USB audio offload library
Nov 4, 2026
3d264dd
ALSA: usb: offload: Claim the xHCI audio sideband resources
ujfalusi Nov 4, 2026
3bac9fb
ALSA: usb: offload: Reserve the isochronous feedback endpoint
ujfalusi Nov 4, 2026
518be60
ALSA: usb: offload: Refine hw params to the device's capabilities
ujfalusi Nov 4, 2026
46cffcc
ALSA: usb: offload: Let a host treat S24_3LE as S24_LE
ujfalusi Sep 2, 2026
db7391a
ALSA: usb: offload: Let the host keep asynchronous playback to itself
ujfalusi Nov 4, 2026
2d5bdfd
ALSA: usb: offload: Keep implicit feedback streams on the host
ujfalusi Nov 19, 2026
b762422
ASoC: soc-usb: Make the snd_soc_usb_update_offload_route() stub inline
ujfalusi Nov 19, 2026
3e3ff99
ASoC: soc-usb: Track the connected devices and the offload routes of …
ujfalusi Nov 4, 2026
b8f3055
ASoC: soc-usb: Add USB offload route controls
ujfalusi Nov 4, 2026
514fe22
ASoC: soc-usb: Notify the route controls when a device connects or di…
ujfalusi Nov 4, 2026
419bec1
ASoC: SOF: Intel: hda: Report the UAOL links to the machine driver
ujfalusi Aug 7, 2026
e6ed441
ASoC: SOF: ipc4-loader: Query the UAOL support from the firmware
ujfalusi Sep 17, 2026
0a1a052
ASoC: SOF: Let the platform finalize the machine params at registration
ujfalusi Nov 5, 2026
1ca170c
ASoC: SOF: Intel: hda: Register with the USB audio offload library
ujfalusi Nov 5, 2026
224af34
ASoC: SOF: Intel: hda-mlink: Add helper to get the UAOL hlink
ujfalusi Aug 11, 2026
4616c76
ASoC: SOF: Add support for the UAOL DAI type
ujfalusi Aug 11, 2026
7e8fd4a
ASoC: SOF: Intel: hda-dai: Add UAOL link DMA support
ujfalusi Nov 4, 2026
49f7596
ASoC: SOF: Intel: Add the ASoC USB offload port
ujfalusi Nov 4, 2026
87c71aa
ASoC: SOF: Intel: hda-uaol: Offload the USB stream on the UAOL DAI
ujfalusi Nov 4, 2026
f309bf4
ASoC: SOF: ipc4-topology: Build the UAOL DAI copier gateway blob
ujfalusi Nov 5, 2026
12d5063
ASoC: SOF: Intel: hda-uaol: Configure the UAOL gateway
ujfalusi Nov 5, 2026
427eea3
ASoC: SOF: Intel: hda-pcm/uaol: Constrain UAOL frontends to the link …
ujfalusi Nov 5, 2026
1322621
ASoC: SOF: Intel: hda-uaol: Constrain UAOL frontends to the USB device
ujfalusi Nov 4, 2026
d8b7645
ASoC: SOF: Intel: hda-uaol: Supply a link DMA for the UAOL feedback
ujfalusi Nov 4, 2026
d1c418f
ALSA: usb: offload: Add usb_offload_quiesce_stream()
ujfalusi Nov 4, 2026
e27e4fd
ALSA: usb: offload: Add usb_offload_restart_stream()
ujfalusi Nov 19, 2026
7d0ebd7
ALSA: usb: offload: Claim the endpoints handed to the DSP
ujfalusi Nov 19, 2026
33e2fbe
ALSA: usb: offload: Run the format quirk of the device
ujfalusi Nov 19, 2026
c462df9
ASoC: SOF: Intel: hda-uaol: Quiesce the USB stream after the DSP stop…
ujfalusi Nov 4, 2026
e88526d
ASoC: SOF: Intel: hda: Start the USB audio offload
ujfalusi Nov 19, 2026
34aea5f
ASoC: Intel: sof_sdw: Add the backend DAI links for the UAOL
ujfalusi Nov 4, 2026
6442427
ASoC: Intel: sof_board_helpers: Add support for UAOL backend DAI links
ujfalusi Nov 4, 2026
8bec591
ASoC: Intel: skl_hda_dsp_generic: Add the backend DAI links for the UAOL
ujfalusi Nov 4, 2026
c06fb9a
ASoC: SOF: ipc4: Add a flag for the host enabled UAOL access
ujfalusi Dec 2, 2026
4c65177
ASoC: SOF: Intel: lnl: Record if the UAOL access is enabled for the DSP
ujfalusi Dec 2, 2026
ebe4fba
ASoC: SOF: ipc4-loader: Enable UAOL access in the firmware before HW_…
ujfalusi Dec 2, 2026
2344929
ASoC: SOF: docs: Describe the UAOL architecture
ujfalusi Nov 4, 2026
4547183
ALSA: usb-audio: Report the bit resolution of S32_LE formats
ujfalusi Dec 1, 2026
75e44be
ALSA: usb-audio: Export the subformats and the msbits of an audio format
ujfalusi Dec 1, 2026
5b97c79
ALSA: usb: offload: Refine the subformat to the USB device
ujfalusi Dec 1, 2026
207cfe3
ASoC: SOF: topology: Do not restrict the subformats of frontend DAIs
ujfalusi Dec 1, 2026
d6a400f
ASoC: SOF: Intel: hda-uaol: Report the bit resolution of the USB device
ujfalusi Dec 1, 2026
2c2e941
Revert "xhci: sideband: Don't support Intel audio sideband for device…
ujfalusi Nov 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Documentation/sound/soc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ The documentation is split into the following sections:-
dpcm
codec-to-codec
usb
sof-uaol
1,232 changes: 1,232 additions & 0 deletions Documentation/sound/soc/sof-uaol.rst

Large diffs are not rendered by default.

144 changes: 135 additions & 9 deletions Documentation/sound/soc/usb.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,22 +57,33 @@ Structures
- ``connection_status_cb``: callback to notify connection events
- ``update_offload_route_info``: callback to fetch selected USB sound card/PCM
device
- ``is_route_busy``: callback reporting whether the backend has a stream open
on a route, consulted before a route selection is changed
- ``available_devices``: the connected ``snd_soc_usb_device`` entries
- ``routes``, ``num_routes``: the offload routes of each direction, see
`Platform Card Route Kcontrols`_
- ``priv_data``: driver data

The snd_soc_usb structure can be referenced using the ASoC platform card
device, or a USB device (udev->dev). This is created by the ASoC BE DAI
link, and the USB sound entity will be able to pass information to the
ASoC BE DAI link using this structure.
ASoC BE DAI link using this structure. On device tree platforms the USB
device is tied to the port through the ``usb-soc-be`` phandle; without a
device tree node the port is found by the device its component was
registered with, so the caller passes that device.

``struct snd_soc_usb_device``

- ``card_idx``: sound card index associated with USB sound device
- ``chip_idx``: USB sound chip array index
- ``cpcm_idx``: capture pcm device indexes associated with the USB sound device
- ``ppcm_idx``: playback pcm device indexes associated with the USB sound device
- ``cpcm_names``, ``ppcm_names``: optional human readable names of the PCMs,
parallel to the index arrays, shown as the items of the route kcontrols
- ``num_playback``: number of playback streams
- ``num_capture``: number of capture streams
- ``list``: list head for the USB sound device list
- ``list``: list head for the backend's own use
- ``available_node``: list head on ``available_devices``, owned by SoC USB

The struct snd_soc_usb_device is created by the USB sound offload driver.
This will carry basic parameters/limitations that will be used to
Expand Down Expand Up @@ -106,9 +117,15 @@ Returns 0 on success, and -EOPNOTSUPP on failure.
**snd_soc_usb_connect()** notifies the ASoC USB DPCM BE DAI link of a USB
audio device detection. This can be utilized in the BE DAI
driver to keep track of available USB audio devices. This is intended
to be called by the USB offload driver residing in USB SND.
to be called by the USB offload driver residing in USB SND. The device is
added to ``available_devices`` and the route controls are notified. A route
nothing was picked for follows its default pair, see the selection rules
below.

Returns 0 on success, negative error code on failure.
Returns 0 on success, -ENODEV when no port is registered for ``usbdev`` (the
device is then not listed and must not be reported as disconnected later),
-EEXIST when ``sdev`` is connected already, negative error code on other
failures.

.. code-block:: rst

Expand All @@ -120,7 +137,8 @@ Returns 0 on success, negative error code on failure.

**snd_soc_usb_disconnect()** notifies the ASoC USB DPCM BE DAI link of a USB
audio device removal. This is intended to be called by the USB offload
driver that resides in USB SND.
driver that resides in USB SND. Every route that was picked for the device
goes back to its default pair.

.. code-block:: rst

Expand Down Expand Up @@ -184,10 +202,64 @@ Returns 0 on success, negative otherwise.
- ``data``: private data

**snd_soc_usb_allocate_port()** allocates a SoC USB device and populates standard
parameters that is used for further operations.
parameters that is used for further operations. The port starts out with one
offload route per direction.

Returns a pointer to struct soc_usb on success, negative on error.

.. code-block:: rst

int snd_soc_usb_set_num_routes(struct snd_soc_usb *usb, int direction,
unsigned int num_routes);
..

- ``usb``: SoC USB device, not yet added with snd_soc_usb_add_port()
- ``direction``: SNDRV_PCM_STREAM_PLAYBACK or SNDRV_PCM_STREAM_CAPTURE
- ``num_routes``: streams the backend can offload at a time in ``direction``

**snd_soc_usb_set_num_routes()** gives a backend which runs several offloaded
streams of a direction at a time a route, and with
snd_soc_usb_setup_offload_route_ctl() a kcontrol, per stream, so that each can
be pointed at a (device, PCM) pair of its own. To be called before the route
kcontrols are created and the port is added.

Returns 0 on success, negative on error.

.. code-block:: rst

int snd_soc_usb_setup_offload_route_ctl(struct snd_soc_component *component,
struct snd_soc_usb *usb);
..

- ``component``: DPCM BE DAI link component
- ``usb``: SoC USB device to attach the controls to

**snd_soc_usb_setup_offload_route_ctl()** creates one writable enumerated
kcontrol per route of each direction on the platform sound card, see
`Platform Card Route Kcontrols`_.

Returns 0 on success, negative on error.

.. code-block:: rst

int snd_soc_usb_get_selected_device(struct snd_soc_usb *usb, int direction,
unsigned int route,
struct snd_soc_usb_device **sdev,
int *pcm_index);
..

- ``usb``: SoC USB device
- ``direction``: SNDRV_PCM_STREAM_PLAYBACK or SNDRV_PCM_STREAM_CAPTURE
- ``route``: the route of ``direction``
- ``sdev``: set to the routed device, NULL if nothing is selected
- ``pcm_index``: set to the routed USB SND PCM device index

**snd_soc_usb_get_selected_device()** returns the (device, PCM) pair a route
currently points at, for the backend to consult when it starts a stream
instead of picking a device itself.

Returns 0 on success (also when nothing is selected), negative on error.

.. code-block:: rst

void snd_soc_usb_free_port(struct snd_soc_usb *usb);
Expand Down Expand Up @@ -339,9 +411,17 @@ USB Offload Related Kcontrols
Details
-------
A set of kcontrols can be utilized by applications to help select the proper sound
devices to enable USB audio offloading. SoC USB exposes the get_offload_dev()
callback that designs can use to ensure that the proper indices are returned to the
application.
devices to enable USB audio offloading. Two models are available: read-only
controls on the USB sound card reporting where a USB PCM is offloaded to
(`USB Sound Card Route Kcontrols`_), and writable controls on the platform
sound card selecting which USB device an offloaded stream goes to
(`Platform Card Route Kcontrols`_). A backend uses the one that fits how
its DSP is driven; the two can coexist.

USB Sound Card Route Kcontrols
------------------------------
SoC USB exposes the get_offload_dev() callback that designs can use to ensure
that the proper indices are returned to the application.

Implementation
--------------
Expand Down Expand Up @@ -456,6 +536,52 @@ execute the registered function calls to the DPCM BE DAI link.
ret = snd_soc_usb_add_port(usb);
..

Platform Card Route Kcontrols
-----------------------------
A backend whose offloaded PCMs exist on the platform card whether or not a
USB device is connected, and which can offload any connected device, lets
the user choose the device instead: it has a *route* per stream it can
offload at a time in a direction (see snd_soc_usb_set_num_routes()), and
snd_soc_usb_setup_offload_route_ctl() creates a writable enumerated kcontrol
per route on the platform card:

``USB Offload <n> Playback Route``

``USB Offload <n> Capture Route``

``<n>`` is the route and is always present, also with a single route per
direction, so the names do not depend on how many streams a backend runs.
A backend pairs its PCMs with the controls by naming them the same way,
``USB Offload <n>``.

The items of a control are every (device, PCM) pair of the direction over
all connected devices, in connection order and then PCM order, named by the
backend through ``ppcm_names``/``cpcm_names``; a name should start with the
USB card and PCM numbers, ``<card>,<pcm>``, so that a sound server can match
the device it targets. The item list is rebuilt on every query, so it
always reflects what is connected; with nothing connected the single item is
``None``.

Selection rules:

- A route nothing was picked for follows its default: route N gets the Nth
available pair of its direction, wrapping around when there are fewer
pairs than routes, so that the routes spread over what is connected.
The default is worked out on every query, it is not stored, so it moves
as devices connect and disconnect.
- A write picks a pair for the route. Picking the pair the route already
points at pins it there.
- On disconnect, routes picked for the device go back to their default.
- A write is refused with ``-EBUSY`` while the backend reports the route
busy through ``is_route_busy()``, i.e. while a stream is open on it.
Writing the current selection is a no-op. A selection by itself claims
no USB or DSP resource; the backend reads it with
snd_soc_usb_get_selected_device() when a stream starts.

Control ``INFO`` and ``VALUE`` change notifications are sent whenever a
connect, a disconnect or a write changes the item list or the selection.
For a backend using this model see :doc:`sof-uaol`.

Existing USB Sound Kcontrol
---------------------------
With the introduction of USB offload support, the above USB offload kcontrol
Expand Down
6 changes: 6 additions & 0 deletions drivers/usb/host/xhci-mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1933,6 +1933,8 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)

cancel_delayed_work_sync(&xhci->cmd_timer);

xa_destroy(&xhci->sideband_idr.id_xa);

for (i = 0; xhci->interrupters && i < xhci->max_interrupters; i++) {
if (xhci->interrupters[i]) {
xhci_remove_interrupter(xhci, xhci->interrupters[i]);
Expand Down Expand Up @@ -2416,6 +2418,10 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)

xhci_dbg_trace(xhci, trace_xhci_dbg_init, "Starting %s", __func__);

xa_init_flags(&xhci->sideband_idr.id_xa, XA_FLAGS_ALLOC);
/* resource id 0 means no resource, valid ids start from 1 */
xhci->sideband_idr.id_lim.min = 1;

xhci_dbg_trace(xhci, trace_xhci_dbg_init, "Allocating internal virtual device array");
xhci->devs = kcalloc_node(xhci->max_slots + 1, sizeof(*xhci->devs), flags,
dev_to_node(dev));
Expand Down
50 changes: 50 additions & 0 deletions drivers/usb/host/xhci-ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -1925,6 +1925,8 @@ static void handle_cmd_completion(struct xhci_hcd *xhci,
xhci_handle_cmd_nec_get_fw(xhci, event);
break;
case TRB_GET_BW:
case TRB_GET_EXT_PROP:
case TRB_SET_EXT_PROP:
break;
default:
/* Skip over unknown commands on the event ring */
Expand Down Expand Up @@ -4494,3 +4496,51 @@ int xhci_queue_reset_ep(struct xhci_hcd *xhci, struct xhci_command *cmd,
return queue_command(xhci, cmd, 0, 0, 0,
trb_slot_id | trb_ep_index | type, false);
}

int xhci_queue_get_ext_property(struct xhci_hcd *xhci, struct xhci_command *cmd,
u32 slot_id, u32 ep_id, u32 eci, u32 subtype)
{
u32 type = TRB_TYPE(TRB_GET_EXT_PROP);
u32 ctx_lo = 0;
u32 ctx_hi = 0;

if (eci != PROP_ECI_ALL) {
type |= SLOT_ID_FOR_TRB(slot_id) |
FIELD_PREP(TRB_PROP_EP_ID, ep_id) |
FIELD_PREP(TRB_PROP_SUBTYPE, subtype);

if (cmd->in_ctx) {
ctx_lo = lower_32_bits(cmd->in_ctx->dma);
ctx_hi = upper_32_bits(cmd->in_ctx->dma);
}
}

return queue_command(xhci, cmd, ctx_lo, ctx_hi,
FIELD_PREP(TRB_PROP_ECI, eci), type, false);
}

int xhci_queue_set_ext_property(struct xhci_hcd *xhci, struct xhci_command *cmd,
u32 slot_id, u32 ep_id, u32 eci, u32 subtype,
u32 param)
{
u32 type = TRB_TYPE(TRB_SET_EXT_PROP);
u32 cap_param;
u32 ctx_lo = 0;
u32 ctx_hi = 0;

cap_param = FIELD_PREP(TRB_PROP_ECPARAM, param) |
FIELD_PREP(TRB_PROP_ECI, eci);

if (eci != PROP_ECI_ALL) {
type |= SLOT_ID_FOR_TRB(slot_id) |
FIELD_PREP(TRB_PROP_EP_ID, ep_id) |
FIELD_PREP(TRB_PROP_SUBTYPE, subtype);

if (cmd->in_ctx) {
ctx_lo = lower_32_bits(cmd->in_ctx->dma);
ctx_hi = upper_32_bits(cmd->in_ctx->dma);
}
}

return queue_command(xhci, cmd, ctx_lo, ctx_hi, cap_param, type, false);
}
Loading
Loading