Thread (65 messages) 65 messages, 2 authors, 2024-09-04

Re: [PATCH v26 22/33] ASoC: qcom: qdsp6: Add headphone jack for offload connection status

From: Wesley Cheng <hidden>
Date: 2024-09-03 21:42:14
Also in: alsa-devel, linux-arm-msm, linux-devicetree, linux-doc, linux-sound, linux-usb, lkml

Hi Pierre,

On 8/30/2024 2:27 AM, Pierre-Louis Bossart wrote:
quoted
 		/* Selects the latest USB headset plugged in for offloading */
+		if (data->hs_jack && list_empty(&data->devices))
+			snd_jack_report(data->hs_jack->jack, SND_JACK_USB);
+
with the list_empty check, this looks like only the first connected
headset will be handled, not the last?
Sorry, the comment is misplaced.  It should be meant to explain:

/* Selects the latest USB headset plugged in for offloading */
list_add_tail(&sdev->list, &data->devices);

The above IF check is to say that we'll only notify the USB jack if there is an available USB audio device (capable of offloading) connected.  I guess it might make sense to notify the snd jack on every USB audio device connection.  Currently, it will notify on the first device identified (present) and the last device removed (not present).

Thanks

Wesley Cheng
quoted
 		list_add_tail(&sdev->list, &data->devices);
 	} else {
 		list_del(&sdev->list);
+
+		if (data->hs_jack && list_empty(&data->devices))
+			snd_jack_report(data->hs_jack->jack, 0);
 	}
 	mutex_unlock(&data->mutex);
 
 	return 0;
 }
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help