Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
613919c
xhci: sideband: fix use-after-free of stale virt device pointer
matnyman Oct 15, 2026
3ca2606
xhci: Add initial support for Extended Property commands
matnyman Jun 12, 2024
b34b7d1
xhci: add Get and Set Extended Property synchronous helpers
matnyman Dec 16, 2024
b4af3a3
xhci: sideband: support registering xHC controlled audio sideband
matnyman Dec 13, 2024
025877f
xhci: sideband: reserve and track sideband endpoint use with resource…
matnyman Dec 19, 2024
d619a21
xhci: sideband: support handing over endpoints to hardware controlled…
matnyman Dec 13, 2024
20b389b
xhci: sideband: check max sideband resources xHC hardware supports
matnyman Jan 26, 2026
260546c
xhci: sideband: Add endpoint property query to sideband API
matnyman Feb 2, 2026
f5c9fce
xhci: sideband: Don't support Intel audio sideband for devices behind…
matnyman Oct 19, 2026
6870a2f
xhci: sideband: Add xhci_sideband_start_endpoint()
ujfalusi Nov 19, 2026
7478243
ALSA: hda: Add the 384kHz stream format encoding
ujfalusi Sep 2, 2026
de0b459
ASoC: SOF: Intel: hda-pcm: Add the 384kHz mult/div encoding
ujfalusi Sep 2, 2026
b9cbc60
ASoC: usb: Match the backend context by device on non-DT platforms
ujfalusi Aug 10, 2026
32abf8d
ALSA: usb-audio: Let the offload path claim a PCM substream
ujfalusi Aug 12, 2026
dc35cf3
ALSA: usb-audio: Keep an offloaded endpoint away from the host
ujfalusi Nov 19, 2026
57611d2
ALSA: usb-audio: Add snd_usb_release_platform_ops()
ujfalusi Nov 19, 2026
b01d06a
ALSA: usb: Add USB audio offload library
Nov 4, 2026
fad024c
ALSA: usb: offload: Claim the xHCI audio sideband resources
ujfalusi Nov 4, 2026
9596bda
ALSA: usb: offload: Reserve the isochronous feedback endpoint
ujfalusi Nov 4, 2026
295495e
ALSA: usb: offload: Refine hw params to the device's capabilities
ujfalusi Nov 4, 2026
640f3f0
ALSA: usb: offload: Let a host treat S24_3LE as S24_LE
ujfalusi Sep 2, 2026
2275bd3
ALSA: usb: offload: Let the host keep asynchronous playback to itself
ujfalusi Nov 4, 2026
0a5dbe3
ALSA: usb: offload: Keep the implicit feedback source of host playback
ujfalusi Nov 19, 2026
0e54357
ALSA: usb: offload: Keep capture with implicit feedback on the host
ujfalusi Nov 19, 2026
98e061f
ASoC: soc-usb: Make the snd_soc_usb_update_offload_route() stub inline
ujfalusi Nov 19, 2026
2534210
ASoC: soc-usb: Add USB offload route controls
ujfalusi Nov 4, 2026
5cfecfe
ASoC: SOF: Intel: hda: Report the UAOL links to the machine driver
ujfalusi Aug 7, 2026
17cb083
ASoC: SOF: ipc4-loader: Query the UAOL support from the firmware
ujfalusi Sep 17, 2026
96a86ec
ASoC: SOF: Let the platform finalize the machine params at registration
ujfalusi Nov 5, 2026
62ce978
ASoC: SOF: Intel: hda: Register with the USB audio offload library
ujfalusi Nov 5, 2026
3c039b9
ASoC: SOF: Intel: hda-mlink: Add helper to get the UAOL hlink
ujfalusi Aug 11, 2026
5ab3cb5
ASoC: SOF: Add support for the UAOL DAI type
ujfalusi Aug 11, 2026
a486687
ASoC: SOF: Intel: hda-dai: Add UAOL link DMA support
ujfalusi Nov 4, 2026
8216ef8
ASoC: SOF: Intel: Add the ASoC USB offload port
ujfalusi Nov 4, 2026
0fcf595
ASoC: SOF: Intel: hda-uaol: Offload the USB stream on the UAOL DAI
ujfalusi Nov 4, 2026
e3928af
ASoC: SOF: ipc4-topology: Build the UAOL DAI copier gateway blob
ujfalusi Nov 5, 2026
6af3758
ASoC: SOF: Intel: hda-uaol: Configure the UAOL gateway
ujfalusi Nov 5, 2026
9aa1209
ASoC: SOF: ipc4-topology: Refresh the DAI copier's gateway config at …
ujfalusi Nov 19, 2026
4738034
ASoC: SOF: ipc4-topology: Add sof_ipc4_uaol_get_fifo_size()
ujfalusi Nov 5, 2026
d2f2b9d
ASoC: SOF: Intel: hda-pcm/uaol: Constrain UAOL frontends to the link …
ujfalusi Nov 5, 2026
94500c2
ASoC: SOF: Intel: hda-uaol: Constrain UAOL frontends to the USB device
ujfalusi Nov 4, 2026
c4acb0c
ASoC: SOF: Intel: hda-uaol: Supply a link DMA for the UAOL feedback
ujfalusi Nov 4, 2026
24f470a
ALSA: usb: offload: Add usb_offload_quiesce_stream()
ujfalusi Nov 4, 2026
723fb30
ALSA: usb: offload: Add usb_offload_restart_stream()
ujfalusi Nov 19, 2026
e12d806
ALSA: usb: offload: Claim the endpoints handed to the DSP
ujfalusi Nov 19, 2026
b1c24a5
ALSA: usb: offload: Run the format quirk of the device
ujfalusi Nov 19, 2026
3c3709b
ASoC: SOF: Intel: hda-uaol: Quiesce the USB stream after the DSP stop…
ujfalusi Nov 4, 2026
5604823
ASoC: SOF: Intel: hda-uaol: Back out of a stream whose route changed …
ujfalusi Nov 19, 2026
5eb47ca
ASoC: SOF: Intel: hda-uaol: Keep a suspended stream marked until reac…
ujfalusi Nov 19, 2026
9028090
ASoC: SOF: Intel: hda: Start the USB audio offload
ujfalusi Nov 19, 2026
b99b3f0
ASoC: Intel: sof_sdw: Add the backend DAI links for the UAOL
ujfalusi Nov 4, 2026
247643e
ASoC: Intel: sof_board_helpers: Add support for UAOL backend DAI links
ujfalusi Nov 4, 2026
c231da7
ASoC: Intel: skl_hda_dsp_generic: Add the backend DAI links for the UAOL
ujfalusi Nov 4, 2026
2c51ecd
ASoC: SOF: docs: Describe the UAOL architecture
ujfalusi Nov 4, 2026
60134a0
Revert "xhci: sideband: Don't support Intel audio sideband for device…
ujfalusi Nov 4, 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,246 changes: 1,246 additions & 0 deletions Documentation/sound/soc/sof-uaol.rst

Large diffs are not rendered by default.

141 changes: 132 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,14 @@ 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 every route of either direction that has
no selection yet is pointed at its first PCM no other route has.

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 +136,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 pointed at the device is
cleared and given a new default selection, if another device is available.

.. code-block:: rst

Expand Down Expand Up @@ -184,10 +201,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 +410,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 +535,50 @@ 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:

- On connect, a route with no selection gets the first pair no other route
of the direction has, so that the routes spread over what is connected.
A route pointing at a pair another route also has is moved to a pair of
the new device no route has yet, unless a stream is running on it.
- On disconnect, routes pointing at the device are cleared and selected
again by the same rule from what remains.
- 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
4 changes: 4 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,8 @@ 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);

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
55 changes: 55 additions & 0 deletions drivers/usb/host/xhci-ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -1926,6 +1926,12 @@ static void handle_cmd_completion(struct xhci_hcd *xhci,
break;
case TRB_GET_BW:
break;
case TRB_GET_EXT_PROP:
xhci_dbg(xhci, "Get Extended Property status 0x%08x\n", status);
break;
case TRB_SET_EXT_PROP:
xhci_dbg(xhci, "Set Extended Property status 0x%08x\n", status);
break;
default:
/* Skip over unknown commands on the event ring */
xhci_info(xhci, "INFO unknown command type %d\n", cmd_type);
Expand Down Expand Up @@ -4494,3 +4500,52 @@ 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 property, u32 subtype,
u32 slot_id, u32 ep_index)
{
u32 type = TRB_TYPE(TRB_GET_EXT_PROP);
u32 ctx_lo = 0;
u32 ctx_hi = 0;

if (property != PROP_ECI_ALL) {
type |= SLOT_ID_FOR_TRB(slot_id) |
FIELD_PREP(TRB_PROP_EP_ID, ep_index + 1) |
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, property), type, false);
}

int xhci_queue_set_ext_property(struct xhci_hcd *xhci, struct xhci_command *cmd,
u32 param, u32 property, u32 subtype,
u32 slot_id, u32 ep_index)
{
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, property);

if (property != PROP_ECI_ALL) {
type |= SLOT_ID_FOR_TRB(slot_id) |
FIELD_PREP(TRB_PROP_EP_ID, ep_index + 1) |
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