Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5b068f31 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "sound: usb: Add snapshot of usb audio qmi service"

parents 394dd7b9 4b3d4356
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
QTI USB Audio QMI Device

USB Audio QMI device is used to attach to remote processor IOMMU and
map USB Audio driver specific memory to iova to share with remote
processor.

Required Properties:

- compatible : "qcom,usb-audio-qmi-dev"

- iommus : A list of phandle and IOMMU specifier pairs that describe the
  IOMMU master interfaces of the device.

- qcom,usb-audio-stream-id : Stream id is prepended to iova before passing
  iova to remote processor. This allows remote processor to access iova.

- qcom,usb-audio-intr-num : Interrupter number for external sub system
  destination.

Example:
	usb_audio_qmi_dev {
		compatible = "qcom,usb-audio-qmi-dev";
		iommus = <&lpass_q6_smmu 12>;
		qcom,usb-audio-stream-id = <12>;
		qcom,usb-audio-intr-num = <1>;
	};
+8 −0
Original line number Diff line number Diff line
@@ -162,5 +162,13 @@ config SND_BCD2000

source "sound/usb/line6/Kconfig"

config SND_USB_AUDIO_QMI
	tristate "USB Audio QMI Service driver"
	depends on MSM_QMI_INTERFACE
	help
	  Starts USB Audio QMI server to communicate with remote entity
	  to perform operations like enable or disable particular audio
	  stream on a connected USB device.

endif	# SND_USB
+1 −0
Original line number Diff line number Diff line
@@ -29,3 +29,4 @@ obj-$(CONFIG_SND_USB_US122L) += snd-usbmidi-lib.o

obj-$(CONFIG_SND) += misc/ usx2y/ caiaq/ 6fire/ hiface/ bcd2000/
obj-$(CONFIG_SND_USB_LINE6)	+= line6/
obj-$(CONFIG_SND_USB_AUDIO_QMI) += usb_audio_qmi_v01.o usb_audio_qmi_svc.o
+4 −2
Original line number Diff line number Diff line
@@ -417,6 +417,7 @@ static int snd_usb_audio_free(struct snd_usb_audio *chip)
	list_for_each_entry_safe(ep, n, &chip->ep_list, list)
		snd_usb_endpoint_free(ep);

	mutex_destroy(&chip->dev_lock);
	mutex_destroy(&chip->mutex);
	if (!atomic_read(&chip->shutdown))
		dev_set_drvdata(&chip->dev->dev, NULL);
@@ -476,6 +477,7 @@ static int snd_usb_audio_create(struct usb_interface *intf,
	}

	mutex_init(&chip->mutex);
	mutex_init(&chip->dev_lock);
	init_waitqueue_head(&chip->shutdown_wait);
	chip->index = idx;
	chip->dev = dev;
@@ -761,6 +763,8 @@ static void usb_audio_disconnect(struct usb_interface *intf)
		return;

	card = chip->card;
	if (chip->disconnect_cb)
		chip->disconnect_cb(chip);

	mutex_lock(&register_mutex);
	if (atomic_inc_return(&chip->shutdown) == 1) {
@@ -796,8 +800,6 @@ static void usb_audio_disconnect(struct usb_interface *intf)
	if (chip->num_interfaces <= 0) {
		usb_chip[chip->index] = NULL;
		mutex_unlock(&register_mutex);
		if (chip->disconnect_cb)
			chip->disconnect_cb(chip);
		snd_card_free_when_closed(card);
	} else {
		mutex_unlock(&register_mutex);
+5 −0
Original line number Diff line number Diff line
@@ -70,9 +70,14 @@ static void snd_usb_audio_stream_free(struct snd_usb_stream *stream)
static void snd_usb_audio_pcm_free(struct snd_pcm *pcm)
{
	struct snd_usb_stream *stream = pcm->private_data;
	struct snd_usb_audio *chip;

	if (stream) {
		mutex_lock(&stream->chip->dev_lock);
		chip = stream->chip;
		stream->pcm = NULL;
		snd_usb_audio_stream_free(stream);
		mutex_unlock(&chip->dev_lock);
	}
}

Loading