Skip to content

Commit 04811c3

Browse files
committed
Merge tag 'sound-6.15-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
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
2 parents fee3e84 + 7b9938a commit 04811c3

File tree

10 files changed

+66
-27
lines changed

10 files changed

+66
-27
lines changed

drivers/usb/gadget/function/f_midi2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ static void reply_ump_stream_ep_info(struct f_midi2_ep *ep)
475475
/* reply a UMP EP device info */
476476
static void reply_ump_stream_ep_device(struct f_midi2_ep *ep)
477477
{
478-
struct snd_ump_stream_msg_devince_info rep = {
478+
struct snd_ump_stream_msg_device_info rep = {
479479
.type = UMP_MSG_TYPE_STREAM,
480480
.status = UMP_STREAM_MSG_STATUS_DEVICE_INFO,
481481
.manufacture_id = ep->info.manufacturer,

include/linux/soundwire/sdw_intel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ struct sdw_intel_res {
365365
* on e.g. which machine driver to select (I2S mode, HDaudio or
366366
* SoundWire).
367367
*/
368-
int sdw_intel_acpi_scan(acpi_handle *parent_handle,
368+
int sdw_intel_acpi_scan(acpi_handle parent_handle,
369369
struct sdw_intel_acpi_info *info);
370370

371371
void sdw_intel_process_wakeen_event(struct sdw_intel_ctx *ctx);

include/sound/ump_msg.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ struct snd_ump_stream_msg_ep_info {
604604
} __packed;
605605

606606
/* UMP Stream Message: Device Info Notification (128bit) */
607-
struct snd_ump_stream_msg_devince_info {
607+
struct snd_ump_stream_msg_device_info {
608608
#ifdef __BIG_ENDIAN_BITFIELD
609609
/* 0 */
610610
u32 type:4;
@@ -754,7 +754,7 @@ struct snd_ump_stream_msg_fb_name {
754754
union snd_ump_stream_msg {
755755
struct snd_ump_stream_msg_ep_discovery ep_discovery;
756756
struct snd_ump_stream_msg_ep_info ep_info;
757-
struct snd_ump_stream_msg_devince_info device_info;
757+
struct snd_ump_stream_msg_device_info device_info;
758758
struct snd_ump_stream_msg_stream_cfg stream_cfg;
759759
struct snd_ump_stream_msg_fb_discovery fb_discovery;
760760
struct snd_ump_stream_msg_fb_info fb_info;

sound/core/seq/seq_clientmgr.c

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -732,15 +732,21 @@ static int snd_seq_deliver_single_event(struct snd_seq_client *client,
732732
*/
733733
static int __deliver_to_subscribers(struct snd_seq_client *client,
734734
struct snd_seq_event *event,
735-
struct snd_seq_client_port *src_port,
736-
int atomic, int hop)
735+
int port, int atomic, int hop)
737736
{
737+
struct snd_seq_client_port *src_port;
738738
struct snd_seq_subscribers *subs;
739739
int err, result = 0, num_ev = 0;
740740
union __snd_seq_event event_saved;
741741
size_t saved_size;
742742
struct snd_seq_port_subs_info *grp;
743743

744+
if (port < 0)
745+
return 0;
746+
src_port = snd_seq_port_use_ptr(client, port);
747+
if (!src_port)
748+
return 0;
749+
744750
/* save original event record */
745751
saved_size = snd_seq_event_packet_size(event);
746752
memcpy(&event_saved, event, saved_size);
@@ -775,6 +781,7 @@ static int __deliver_to_subscribers(struct snd_seq_client *client,
775781
read_unlock(&grp->list_lock);
776782
else
777783
up_read(&grp->list_mutex);
784+
snd_seq_port_unlock(src_port);
778785
memcpy(event, &event_saved, saved_size);
779786
return (result < 0) ? result : num_ev;
780787
}
@@ -783,25 +790,32 @@ static int deliver_to_subscribers(struct snd_seq_client *client,
783790
struct snd_seq_event *event,
784791
int atomic, int hop)
785792
{
786-
struct snd_seq_client_port *src_port;
787-
int ret = 0, ret2;
788-
789-
src_port = snd_seq_port_use_ptr(client, event->source.port);
790-
if (src_port) {
791-
ret = __deliver_to_subscribers(client, event, src_port, atomic, hop);
792-
snd_seq_port_unlock(src_port);
793-
}
794-
795-
if (client->ump_endpoint_port < 0 ||
796-
event->source.port == client->ump_endpoint_port)
797-
return ret;
793+
int ret;
794+
#if IS_ENABLED(CONFIG_SND_SEQ_UMP)
795+
int ret2;
796+
#endif
798797

799-
src_port = snd_seq_port_use_ptr(client, client->ump_endpoint_port);
800-
if (!src_port)
798+
ret = __deliver_to_subscribers(client, event,
799+
event->source.port, atomic, hop);
800+
#if IS_ENABLED(CONFIG_SND_SEQ_UMP)
801+
if (!snd_seq_client_is_ump(client) || client->ump_endpoint_port < 0)
801802
return ret;
802-
ret2 = __deliver_to_subscribers(client, event, src_port, atomic, hop);
803-
snd_seq_port_unlock(src_port);
804-
return ret2 < 0 ? ret2 : ret;
803+
/* If it's an event from EP port (and with a UMP group),
804+
* deliver to subscribers of the corresponding UMP group port, too.
805+
* Or, if it's from non-EP port, deliver to subscribers of EP port, too.
806+
*/
807+
if (event->source.port == client->ump_endpoint_port)
808+
ret2 = __deliver_to_subscribers(client, event,
809+
snd_seq_ump_group_port(event),
810+
atomic, hop);
811+
else
812+
ret2 = __deliver_to_subscribers(client, event,
813+
client->ump_endpoint_port,
814+
atomic, hop);
815+
if (ret2 < 0)
816+
return ret2;
817+
#endif
818+
return ret;
805819
}
806820

807821
/* deliver an event to the destination port(s).

sound/core/seq/seq_ump_convert.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,3 +1285,21 @@ int snd_seq_deliver_to_ump(struct snd_seq_client *source,
12851285
else
12861286
return cvt_to_ump_midi1(dest, dest_port, event, atomic, hop);
12871287
}
1288+
1289+
/* return the UMP group-port number of the event;
1290+
* return -1 if groupless or non-UMP event
1291+
*/
1292+
int snd_seq_ump_group_port(const struct snd_seq_event *event)
1293+
{
1294+
const struct snd_seq_ump_event *ump_ev =
1295+
(const struct snd_seq_ump_event *)event;
1296+
unsigned char type;
1297+
1298+
if (!snd_seq_ev_is_ump(event))
1299+
return -1;
1300+
type = ump_message_type(ump_ev->ump[0]);
1301+
if (ump_is_groupless_msg(type))
1302+
return -1;
1303+
/* group-port number starts from 1 */
1304+
return ump_message_group(ump_ev->ump[0]) + 1;
1305+
}

sound/core/seq/seq_ump_convert.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ int snd_seq_deliver_to_ump(struct snd_seq_client *source,
1818
struct snd_seq_client_port *dest_port,
1919
struct snd_seq_event *event,
2020
int atomic, int hop);
21+
int snd_seq_ump_group_port(const struct snd_seq_event *event);
2122

2223
#endif /* __SEQ_UMP_CONVERT_H */

sound/hda/intel-sdw-acpi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ static acpi_status sdw_intel_acpi_cb(acpi_handle handle, u32 level,
177177
* sdw_intel_startup() is required for creation of devices and bus
178178
* startup
179179
*/
180-
int sdw_intel_acpi_scan(acpi_handle *parent_handle,
180+
int sdw_intel_acpi_scan(acpi_handle parent_handle,
181181
struct sdw_intel_acpi_info *info)
182182
{
183183
acpi_status status;

sound/pci/es1968.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1561,7 +1561,7 @@ static int snd_es1968_capture_open(struct snd_pcm_substream *substream)
15611561
struct snd_pcm_runtime *runtime = substream->runtime;
15621562
struct es1968 *chip = snd_pcm_substream_chip(substream);
15631563
struct esschan *es;
1564-
int apu1, apu2;
1564+
int err, apu1, apu2;
15651565

15661566
apu1 = snd_es1968_alloc_apu_pair(chip, ESM_APU_PCM_CAPTURE);
15671567
if (apu1 < 0)
@@ -1605,7 +1605,9 @@ static int snd_es1968_capture_open(struct snd_pcm_substream *substream)
16051605
runtime->hw = snd_es1968_capture;
16061606
runtime->hw.buffer_bytes_max = runtime->hw.period_bytes_max =
16071607
calc_available_memory_size(chip) - 1024; /* keep MIXBUF size */
1608-
snd_pcm_hw_constraint_pow2(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES);
1608+
err = snd_pcm_hw_constraint_pow2(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES);
1609+
if (err < 0)
1610+
return err;
16091611

16101612
spin_lock_irq(&chip->substream_lock);
16111613
list_add(&es->list, &chip->substream_list);

sound/sh/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if SND_SUPERH
1414

1515
config SND_AICA
1616
tristate "Dreamcast Yamaha AICA sound"
17-
depends on SH_DREAMCAST
17+
depends on SH_DREAMCAST && SH_DMA_API
1818
select SND_PCM
1919
select G2_DMA
2020
help

sound/usb/quirks.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2242,6 +2242,8 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = {
22422242
QUIRK_FLAG_CTL_MSG_DELAY_1M),
22432243
DEVICE_FLG(0x0c45, 0x6340, /* Sonix HD USB Camera */
22442244
QUIRK_FLAG_GET_SAMPLE_RATE),
2245+
DEVICE_FLG(0x0c45, 0x636b, /* Microdia JP001 USB Camera */
2246+
QUIRK_FLAG_GET_SAMPLE_RATE),
22452247
DEVICE_FLG(0x0d8c, 0x0014, /* USB Audio Device */
22462248
QUIRK_FLAG_CTL_MSG_DELAY_1M),
22472249
DEVICE_FLG(0x0ecb, 0x205c, /* JBL Quantum610 Wireless */
@@ -2250,6 +2252,8 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = {
22502252
QUIRK_FLAG_FIXED_RATE),
22512253
DEVICE_FLG(0x0fd9, 0x0008, /* Hauppauge HVR-950Q */
22522254
QUIRK_FLAG_SHARE_MEDIA_DEVICE | QUIRK_FLAG_ALIGN_TRANSFER),
2255+
DEVICE_FLG(0x1101, 0x0003, /* Audioengine D1 */
2256+
QUIRK_FLAG_GET_SAMPLE_RATE),
22532257
DEVICE_FLG(0x1224, 0x2a25, /* Jieli Technology USB PHY 2.0 */
22542258
QUIRK_FLAG_GET_SAMPLE_RATE | QUIRK_FLAG_MIC_RES_16),
22552259
DEVICE_FLG(0x1395, 0x740a, /* Sennheiser DECT */

0 commit comments

Comments
 (0)