Skip to content

Commit 326bbc3

Browse files
Wesley Chenggregkh
authored andcommitted
ALSA: usb-audio: qcom: Introduce QC USB SND offloading support
Several Qualcomm SoCs have a dedicated audio DSP, which has the ability to support USB sound devices. This vendor driver will implement the required handshaking with the DSP, in order to pass along required resources that will be utilized by the DSP's USB SW. The communication channel used for this handshaking will be using the QMI protocol. Required resources include: - Allocated secondary event ring address - EP transfer ring address - Interrupter number The above information will allow for the audio DSP to execute USB transfers over the USB bus. It will also be able to support devices that have an implicit feedback and sync endpoint as well. Offloading these data transfers will allow the main/applications processor to enter lower CPU power modes, and sustain a longer duration in those modes. Audio offloading is initiated with the following sequence: 1. Userspace configures to route audio playback to USB backend and starts playback on the platform soundcard. 2. The Q6DSP AFE will communicate to the audio DSP to start the USB AFE port. 3. This results in a QMI packet with a STREAM enable command. 4. The QC audio offload driver will fetch the required resources, and pass this information as part of the QMI response to the STREAM enable command. 5. Once the QMI response is received the audio DSP will start queuing data on the USB bus. As part of step#2, the audio DSP is aware of the USB SND card and pcm device index that is being selected, and is communicated as part of the QMI request received by QC audio offload. These indices will be used to handle the stream enable QMI request. Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com> Acked-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20250409194804.3773260-29-quic_wcheng@quicinc.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent bd1979b commit 326bbc3

File tree

4 files changed

+2004
-1
lines changed

4 files changed

+2004
-1
lines changed

sound/usb/Kconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,20 @@ config SND_BCD2000
176176
To compile this driver as a module, choose M here: the module
177177
will be called snd-bcd2000.
178178

179+
config SND_USB_AUDIO_QMI
180+
tristate "Qualcomm Audio Offload driver"
181+
depends on QCOM_QMI_HELPERS && SND_USB_AUDIO && USB_XHCI_SIDEBAND && SND_SOC_USB
182+
help
183+
Say Y here to enable the Qualcomm USB audio offloading feature.
184+
185+
This module sets up the required QMI stream enable/disable
186+
responses to requests generated by the audio DSP. It passes the
187+
USB transfer resource references, so that the audio DSP can issue
188+
USB transfers to the host controller.
189+
190+
To compile this driver as a module, choose M here: the module
191+
will be called snd-usb-audio-qmi.
192+
179193
source "sound/usb/line6/Kconfig"
180194

181195
endif # SND_USB

sound/usb/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ obj-$(CONFIG_SND_USB_UA101) += snd-usbmidi-lib.o
3535
obj-$(CONFIG_SND_USB_USX2Y) += snd-usbmidi-lib.o
3636
obj-$(CONFIG_SND_USB_US122L) += snd-usbmidi-lib.o
3737

38-
obj-$(CONFIG_SND) += misc/ usx2y/ caiaq/ 6fire/ hiface/ bcd2000/
38+
obj-$(CONFIG_SND) += misc/ usx2y/ caiaq/ 6fire/ hiface/ bcd2000/ qcom/
3939
obj-$(CONFIG_SND_USB_LINE6) += line6/

sound/usb/qcom/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
snd-usb-audio-qmi-y := usb_audio_qmi_v01.o qc_audio_offload.o
2+
obj-$(CONFIG_SND_USB_AUDIO_QMI) += snd-usb-audio-qmi.o

0 commit comments

Comments
 (0)