Commit 04811c3e authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull sound fixes from Takashi Iwai:
 "A handful small fixes. The only significant change is the fix for MIDI
  2.0 UMP handling in ALSA sequencer, but as MIDI 2.0 stuff is still new
  and rarely used, the impact should be pretty limited.

  Other than that, quirks for USB-audio and a few cosmetic fixes and
  changes in drivers that should be safe to apply"

* tag 'sound-6.15-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: usb-audio: Add sample rate quirk for Microdia JP001 USB Camera
  ALSA: es1968: Add error handling for snd_pcm_hw_constraint_pow2()
  ALSA: sh: SND_AICA should depend on SH_DMA_API
  ALSA: usb-audio: Add sample rate quirk for Audioengine D1
  ALSA: ump: Fix a typo of snd_ump_stream_msg_device_info
  ALSA/hda: intel-sdw-acpi: Correct sdw_intel_acpi_scan() function parameter
  ALSA: seq: Fix delivery of UMP events to group ports
parents fee3e843 7b9938a1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -475,7 +475,7 @@ static void reply_ump_stream_ep_info(struct f_midi2_ep *ep)
/* reply a UMP EP device info */
static void reply_ump_stream_ep_device(struct f_midi2_ep *ep)
{
	struct snd_ump_stream_msg_devince_info rep = {
	struct snd_ump_stream_msg_device_info rep = {
		.type = UMP_MSG_TYPE_STREAM,
		.status = UMP_STREAM_MSG_STATUS_DEVICE_INFO,
		.manufacture_id = ep->info.manufacturer,
+1 −1
Original line number Diff line number Diff line
@@ -365,7 +365,7 @@ struct sdw_intel_res {
 * on e.g. which machine driver to select (I2S mode, HDaudio or
 * SoundWire).
 */
int sdw_intel_acpi_scan(acpi_handle *parent_handle,
int sdw_intel_acpi_scan(acpi_handle parent_handle,
			struct sdw_intel_acpi_info *info);

void sdw_intel_process_wakeen_event(struct sdw_intel_ctx *ctx);
+2 −2
Original line number Diff line number Diff line
@@ -604,7 +604,7 @@ struct snd_ump_stream_msg_ep_info {
} __packed;

/* UMP Stream Message: Device Info Notification (128bit) */
struct snd_ump_stream_msg_devince_info {
struct snd_ump_stream_msg_device_info {
#ifdef __BIG_ENDIAN_BITFIELD
	/* 0 */
	u32 type:4;
@@ -754,7 +754,7 @@ struct snd_ump_stream_msg_fb_name {
union snd_ump_stream_msg {
	struct snd_ump_stream_msg_ep_discovery ep_discovery;
	struct snd_ump_stream_msg_ep_info ep_info;
	struct snd_ump_stream_msg_devince_info device_info;
	struct snd_ump_stream_msg_device_info device_info;
	struct snd_ump_stream_msg_stream_cfg stream_cfg;
	struct snd_ump_stream_msg_fb_discovery fb_discovery;
	struct snd_ump_stream_msg_fb_info fb_info;
+33 −19
Original line number Diff line number Diff line
@@ -732,15 +732,21 @@ static int snd_seq_deliver_single_event(struct snd_seq_client *client,
 */
static int __deliver_to_subscribers(struct snd_seq_client *client,
				    struct snd_seq_event *event,
				    struct snd_seq_client_port *src_port,
				    int atomic, int hop)
				    int port, int atomic, int hop)
{
	struct snd_seq_client_port *src_port;
	struct snd_seq_subscribers *subs;
	int err, result = 0, num_ev = 0;
	union __snd_seq_event event_saved;
	size_t saved_size;
	struct snd_seq_port_subs_info *grp;

	if (port < 0)
		return 0;
	src_port = snd_seq_port_use_ptr(client, port);
	if (!src_port)
		return 0;

	/* save original event record */
	saved_size = snd_seq_event_packet_size(event);
	memcpy(&event_saved, event, saved_size);
@@ -775,6 +781,7 @@ static int __deliver_to_subscribers(struct snd_seq_client *client,
		read_unlock(&grp->list_lock);
	else
		up_read(&grp->list_mutex);
	snd_seq_port_unlock(src_port);
	memcpy(event, &event_saved, saved_size);
	return (result < 0) ? result : num_ev;
}
@@ -783,25 +790,32 @@ static int deliver_to_subscribers(struct snd_seq_client *client,
				  struct snd_seq_event *event,
				  int atomic, int hop)
{
	struct snd_seq_client_port *src_port;
	int ret = 0, ret2;

	src_port = snd_seq_port_use_ptr(client, event->source.port);
	if (src_port) {
		ret = __deliver_to_subscribers(client, event, src_port, atomic, hop);
		snd_seq_port_unlock(src_port);
	}
	int ret;
#if IS_ENABLED(CONFIG_SND_SEQ_UMP)
	int ret2;
#endif

	if (client->ump_endpoint_port < 0 ||
	    event->source.port == client->ump_endpoint_port)
	ret = __deliver_to_subscribers(client, event,
				       event->source.port, atomic, hop);
#if IS_ENABLED(CONFIG_SND_SEQ_UMP)
	if (!snd_seq_client_is_ump(client) || client->ump_endpoint_port < 0)
		return ret;

	src_port = snd_seq_port_use_ptr(client, client->ump_endpoint_port);
	if (!src_port)
	/* If it's an event from EP port (and with a UMP group),
	 * deliver to subscribers of the corresponding UMP group port, too.
	 * Or, if it's from non-EP port, deliver to subscribers of EP port, too.
	 */
	if (event->source.port == client->ump_endpoint_port)
		ret2 = __deliver_to_subscribers(client, event,
						snd_seq_ump_group_port(event),
						atomic, hop);
	else
		ret2 = __deliver_to_subscribers(client, event,
						client->ump_endpoint_port,
						atomic, hop);
	if (ret2 < 0)
		return ret2;
#endif
	return ret;
	ret2 = __deliver_to_subscribers(client, event, src_port, atomic, hop);
	snd_seq_port_unlock(src_port);
	return ret2 < 0 ? ret2 : ret;
}

/* deliver an event to the destination port(s).
+18 −0
Original line number Diff line number Diff line
@@ -1285,3 +1285,21 @@ int snd_seq_deliver_to_ump(struct snd_seq_client *source,
	else
		return cvt_to_ump_midi1(dest, dest_port, event, atomic, hop);
}

/* return the UMP group-port number of the event;
 * return -1 if groupless or non-UMP event
 */
int snd_seq_ump_group_port(const struct snd_seq_event *event)
{
	const struct snd_seq_ump_event *ump_ev =
		(const struct snd_seq_ump_event *)event;
	unsigned char type;

	if (!snd_seq_ev_is_ump(event))
		return -1;
	type = ump_message_type(ump_ev->ump[0]);
	if (ump_is_groupless_msg(type))
		return -1;
	/* group-port number starts from 1 */
	return ump_message_group(ump_ev->ump[0]) + 1;
}
Loading