Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'sound-6.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
"A collection of small fixes that have been gathered in the week.

- Fix the missing XRUN handling in USB-audio low latency mode

- Fix regression by the previous USB-audio hadening change

- Clean up old SH sound driver to use the standard helpers

- A few further fixes for MIDI 2.0 UMP handling

- Various HD-audio and USB-audio quirks

- Fix jack handling at PM on ASoC Intel AVS

- Misc small fixes for ASoC SOF and Mediatek"

* tag 'sound-6.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ALSA: hda/realtek: Fix spelling mistake "Firelfy" -> "Firefly"
ASoC: mediatek: mt8188-mt6359: Remove hardcoded dmic codec
ALSA: hda/realtek: fix micmute LEDs don't work on HP Laptops
ALSA: usb-audio: Add extra PID for RME Digiface USB
ALSA: usb-audio: Fix a DMA to stack memory bug
ASoC: SOF: ipc3-topology: fix resource leaks in sof_ipc3_widget_setup_comp_dai()
ALSA: hda/realtek: Add support for Samsung Galaxy Book3 360 (NP730QFG)
ASoC: Intel: avs: da7219: Remove suspend_pre() and resume_post()
ALSA: hda/tas2781: Fix error code tas2781_read_acpi()
ALSA: hda/realtek: Enable mute and micmute LED on HP ProBook 430 G8
ALSA: usb-audio: add mixer mapping for Corsair HS80
ALSA: ump: Shut up truncated string warning
ALSA: sh: Use standard helper for buffer accesses
ALSA: usb-audio: Notify xrun for low-latency mode
ALSA: hda/conexant: fix Z60MR100 startup pop issue
ALSA: ump: Update legacy substream names upon FB info update
ALSA: ump: Indicate the inactive group in legacy substream names
ALSA: ump: Don't open legacy substream for an inactive group
ALSA: seq: ump: Fix seq port updates per FB info notify

+291 -221
+3 -3
sound/core/seq/seq_ump_client.c
··· 257 257 continue; 258 258 259 259 old->addr.client = client->seq_client; 260 - old->addr.port = i; 260 + old->addr.port = ump_group_to_seq_port(i); 261 261 err = snd_seq_kernel_client_ctl(client->seq_client, 262 262 SNDRV_SEQ_IOCTL_GET_PORT_INFO, 263 263 old); 264 264 if (err < 0) 265 - return; 265 + continue; 266 266 fill_port_info(new, client, &client->ump->groups[i]); 267 267 if (old->capability == new->capability && 268 268 !strcmp(old->name, new->name)) ··· 271 271 SNDRV_SEQ_IOCTL_SET_PORT_INFO, 272 272 new); 273 273 if (err < 0) 274 - return; 274 + continue; 275 275 /* notify to system port */ 276 276 snd_seq_system_client_ev_port_change(client->seq_client, i); 277 277 }
+20 -6
sound/core/ump.c
··· 37 37 u32 *buffer, int count); 38 38 static void process_legacy_input(struct snd_ump_endpoint *ump, const u32 *src, 39 39 int words); 40 + static void update_legacy_names(struct snd_ump_endpoint *ump); 40 41 #else 41 42 static inline int process_legacy_output(struct snd_ump_endpoint *ump, 42 43 u32 *buffer, int count) ··· 46 45 } 47 46 static inline void process_legacy_input(struct snd_ump_endpoint *ump, 48 47 const u32 *src, int words) 48 + { 49 + } 50 + static inline void update_legacy_names(struct snd_ump_endpoint *ump) 49 51 { 50 52 } 51 53 #endif ··· 865 861 fill_fb_info(ump, &fb->info, buf); 866 862 if (ump->parsed) { 867 863 snd_ump_update_group_attrs(ump); 864 + update_legacy_names(ump); 868 865 seq_notify_fb_change(ump, fb); 869 866 } 870 867 } ··· 898 893 /* notify the FB name update to sequencer, too */ 899 894 if (ret > 0 && ump->parsed) { 900 895 snd_ump_update_group_attrs(ump); 896 + update_legacy_names(ump); 901 897 seq_notify_fb_change(ump, fb); 902 898 } 903 899 return ret; ··· 1093 1087 guard(mutex)(&ump->open_mutex); 1094 1088 if (ump->legacy_substreams[dir][group]) 1095 1089 return -EBUSY; 1090 + if (!ump->groups[group].active) 1091 + return -ENODEV; 1096 1092 if (dir == SNDRV_RAWMIDI_STREAM_OUTPUT) { 1097 1093 if (!ump->legacy_out_opens) { 1098 1094 err = snd_rawmidi_kernel_open(&ump->core, 0, ··· 1262 1254 name = ump->groups[idx].name; 1263 1255 if (!*name) 1264 1256 name = ump->info.name; 1265 - snprintf(s->name, sizeof(s->name), "Group %d (%.16s)", 1266 - idx + 1, name); 1257 + scnprintf(s->name, sizeof(s->name), "Group %d (%.16s)%s", 1258 + idx + 1, name, 1259 + ump->groups[idx].active ? "" : " [Inactive]"); 1267 1260 } 1261 + } 1262 + 1263 + static void update_legacy_names(struct snd_ump_endpoint *ump) 1264 + { 1265 + struct snd_rawmidi *rmidi = ump->legacy_rmidi; 1266 + 1267 + fill_substream_names(ump, rmidi, SNDRV_RAWMIDI_STREAM_INPUT); 1268 + fill_substream_names(ump, rmidi, SNDRV_RAWMIDI_STREAM_OUTPUT); 1268 1269 } 1269 1270 1270 1271 int snd_ump_attach_legacy_rawmidi(struct snd_ump_endpoint *ump, ··· 1312 1295 rmidi->ops = &snd_ump_legacy_ops; 1313 1296 rmidi->private_data = ump; 1314 1297 ump->legacy_rmidi = rmidi; 1315 - if (input) 1316 - fill_substream_names(ump, rmidi, SNDRV_RAWMIDI_STREAM_INPUT); 1317 - if (output) 1318 - fill_substream_names(ump, rmidi, SNDRV_RAWMIDI_STREAM_OUTPUT); 1298 + update_legacy_names(ump); 1319 1299 1320 1300 ump_dbg(ump, "Created a legacy rawmidi #%d (%s)\n", device, id); 1321 1301 return 0;
+28
sound/pci/hda/patch_conexant.c
··· 307 307 CXT_FIXUP_HP_MIC_NO_PRESENCE, 308 308 CXT_PINCFG_SWS_JS201D, 309 309 CXT_PINCFG_TOP_SPEAKER, 310 + CXT_FIXUP_HP_A_U, 310 311 }; 311 312 312 313 /* for hda_fixup_thinkpad_acpi() */ ··· 775 774 } 776 775 } 777 776 777 + static void cxt_setup_gpio_unmute(struct hda_codec *codec, 778 + unsigned int gpio_mute_mask) 779 + { 780 + if (gpio_mute_mask) { 781 + // set gpio data to 0. 782 + snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, 0); 783 + snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_MASK, gpio_mute_mask); 784 + snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DIRECTION, gpio_mute_mask); 785 + snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_STICKY_MASK, 0); 786 + } 787 + } 788 + 778 789 static void cxt_fixup_mute_led_gpio(struct hda_codec *codec, 779 790 const struct hda_fixup *fix, int action) 780 791 { ··· 799 786 { 800 787 if (action == HDA_FIXUP_ACT_PRE_PROBE) 801 788 cxt_setup_mute_led(codec, 0x10, 0x20); 789 + } 790 + 791 + static void cxt_fixup_hp_a_u(struct hda_codec *codec, 792 + const struct hda_fixup *fix, int action) 793 + { 794 + // Init vers in BIOS mute the spk/hp by set gpio high to avoid pop noise, 795 + // so need to unmute once by clearing the gpio data when runs into the system. 796 + if (action == HDA_FIXUP_ACT_INIT) 797 + cxt_setup_gpio_unmute(codec, 0x2); 802 798 } 803 799 804 800 /* ThinkPad X200 & co with cxt5051 */ ··· 1020 998 { } 1021 999 }, 1022 1000 }, 1001 + [CXT_FIXUP_HP_A_U] = { 1002 + .type = HDA_FIXUP_FUNC, 1003 + .v.func = cxt_fixup_hp_a_u, 1004 + }, 1023 1005 }; 1024 1006 1025 1007 static const struct hda_quirk cxt5045_fixups[] = { ··· 1098 1072 SND_PCI_QUIRK(0x103c, 0x8457, "HP Z2 G4 mini", CXT_FIXUP_HP_MIC_NO_PRESENCE), 1099 1073 SND_PCI_QUIRK(0x103c, 0x8458, "HP Z2 G4 mini premium", CXT_FIXUP_HP_MIC_NO_PRESENCE), 1100 1074 SND_PCI_QUIRK(0x1043, 0x138d, "Asus", CXT_FIXUP_HEADPHONE_MIC_PIN), 1075 + SND_PCI_QUIRK(0x14f1, 0x0252, "MBX-Z60MR100", CXT_FIXUP_HP_A_U), 1101 1076 SND_PCI_QUIRK(0x14f1, 0x0265, "SWS JS201D", CXT_PINCFG_SWS_JS201D), 1102 1077 SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT_FIXUP_OLPC_XO), 1103 1078 SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400", CXT_PINCFG_LENOVO_TP410), ··· 1144 1117 { .id = CXT_PINCFG_LENOVO_NOTEBOOK, .name = "lenovo-20149" }, 1145 1118 { .id = CXT_PINCFG_SWS_JS201D, .name = "sws-js201d" }, 1146 1119 { .id = CXT_PINCFG_TOP_SPEAKER, .name = "sirius-top-speaker" }, 1120 + { .id = CXT_FIXUP_HP_A_U, .name = "HP-U-support" }, 1147 1121 {} 1148 1122 }; 1149 1123
+8
sound/pci/hda/patch_realtek.c
··· 10340 10340 SND_PCI_QUIRK(0x103c, 0x87b7, "HP Laptop 14-fq0xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), 10341 10341 SND_PCI_QUIRK(0x103c, 0x87c8, "HP", ALC287_FIXUP_HP_GPIO_LED), 10342 10342 SND_PCI_QUIRK(0x103c, 0x87d3, "HP Laptop 15-gw0xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), 10343 + SND_PCI_QUIRK(0x103c, 0x87df, "HP ProBook 430 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), 10343 10344 SND_PCI_QUIRK(0x103c, 0x87e5, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), 10344 10345 SND_PCI_QUIRK(0x103c, 0x87e7, "HP ProBook 450 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), 10345 10346 SND_PCI_QUIRK(0x103c, 0x87f1, "HP ProBook 630 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), ··· 10522 10521 SND_PCI_QUIRK(0x103c, 0x8cdf, "HP SnowWhite", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), 10523 10522 SND_PCI_QUIRK(0x103c, 0x8ce0, "HP SnowWhite", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), 10524 10523 SND_PCI_QUIRK(0x103c, 0x8cf5, "HP ZBook Studio 16", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED), 10524 + SND_PCI_QUIRK(0x103c, 0x8d01, "HP ZBook Power 14 G12", ALC285_FIXUP_HP_GPIO_LED), 10525 10525 SND_PCI_QUIRK(0x103c, 0x8d84, "HP EliteBook X G1i", ALC285_FIXUP_HP_GPIO_LED), 10526 + SND_PCI_QUIRK(0x103c, 0x8d91, "HP ZBook Firefly 14 G12", ALC285_FIXUP_HP_GPIO_LED), 10527 + SND_PCI_QUIRK(0x103c, 0x8d92, "HP ZBook Firefly 16 G12", ALC285_FIXUP_HP_GPIO_LED), 10528 + SND_PCI_QUIRK(0x103c, 0x8e18, "HP ZBook Firefly 14 G12A", ALC285_FIXUP_HP_GPIO_LED), 10529 + SND_PCI_QUIRK(0x103c, 0x8e19, "HP ZBook Firefly 14 G12A", ALC285_FIXUP_HP_GPIO_LED), 10530 + SND_PCI_QUIRK(0x103c, 0x8e1a, "HP ZBook Firefly 14 G12A", ALC285_FIXUP_HP_GPIO_LED), 10526 10531 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), 10527 10532 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), 10528 10533 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), ··· 10683 10676 SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_AMP), 10684 10677 SND_PCI_QUIRK(0x144d, 0xc832, "Samsung Galaxy Book Flex Alpha (NP730QCJ)", ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), 10685 10678 SND_PCI_QUIRK(0x144d, 0xca03, "Samsung Galaxy Book2 Pro 360 (NP930QED)", ALC298_FIXUP_SAMSUNG_AMP), 10679 + SND_PCI_QUIRK(0x144d, 0xca06, "Samsung Galaxy Book3 360 (NP730QFG)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), 10686 10680 SND_PCI_QUIRK(0x144d, 0xc868, "Samsung Galaxy Book2 Pro (NP930XED)", ALC298_FIXUP_SAMSUNG_AMP), 10687 10681 SND_PCI_QUIRK(0x144d, 0xc870, "Samsung Galaxy Book2 Pro (NP950XED)", ALC298_FIXUP_SAMSUNG_AMP_V2_2_AMPS), 10688 10682 SND_PCI_QUIRK(0x144d, 0xc872, "Samsung Galaxy Book2 Pro (NP950XEE)", ALC298_FIXUP_SAMSUNG_AMP_V2_2_AMPS),
+1
sound/pci/hda/tas2781_hda_i2c.c
··· 143 143 sub = acpi_get_subsystem_id(ACPI_HANDLE(physdev)); 144 144 if (IS_ERR(sub)) { 145 145 dev_err(p->dev, "Failed to get SUBSYS ID.\n"); 146 + ret = PTR_ERR(sub); 146 147 goto err; 147 148 } 148 149 /* Speaker id was needed for ASUS projects. */
+2 -3
sound/sh/sh_dac_audio.c
··· 163 163 /* channel is not used (interleaved data) */ 164 164 struct snd_sh_dac *chip = snd_pcm_substream_chip(substream); 165 165 166 - if (copy_from_iter_toio(chip->data_buffer + pos, src, count)) 166 + if (copy_from_iter(chip->data_buffer + pos, src, count) != count) 167 167 return -EFAULT; 168 168 chip->buffer_end = chip->data_buffer + pos + count; 169 169 ··· 182 182 /* channel is not used (interleaved data) */ 183 183 struct snd_sh_dac *chip = snd_pcm_substream_chip(substream); 184 184 185 - memset_io(chip->data_buffer + pos, 0, count); 185 + memset(chip->data_buffer + pos, 0, count); 186 186 chip->buffer_end = chip->data_buffer + pos + count; 187 187 188 188 if (chip->empty) { ··· 211 211 .pointer = snd_sh_dac_pcm_pointer, 212 212 .copy = snd_sh_dac_pcm_copy, 213 213 .fill_silence = snd_sh_dac_pcm_silence, 214 - .mmap = snd_pcm_lib_mmap_iomem, 215 214 }; 216 215 217 216 static int snd_sh_dac_pcm(struct snd_sh_dac *chip, int device)
-17
sound/soc/intel/avs/boards/da7219.c
··· 209 209 return 0; 210 210 } 211 211 212 - static int avs_card_suspend_pre(struct snd_soc_card *card) 213 - { 214 - struct snd_soc_dai *codec_dai = snd_soc_card_get_codec_dai(card, DA7219_DAI_NAME); 215 - 216 - return snd_soc_component_set_jack(codec_dai->component, NULL, NULL); 217 - } 218 - 219 - static int avs_card_resume_post(struct snd_soc_card *card) 220 - { 221 - struct snd_soc_dai *codec_dai = snd_soc_card_get_codec_dai(card, DA7219_DAI_NAME); 222 - struct snd_soc_jack *jack = snd_soc_card_get_drvdata(card); 223 - 224 - return snd_soc_component_set_jack(codec_dai->component, jack, NULL); 225 - } 226 - 227 212 static int avs_da7219_probe(struct platform_device *pdev) 228 213 { 229 214 struct snd_soc_dai_link *dai_link; ··· 240 255 card->name = "avs_da7219"; 241 256 card->dev = dev; 242 257 card->owner = THIS_MODULE; 243 - card->suspend_pre = avs_card_suspend_pre; 244 - card->resume_post = avs_card_resume_post; 245 258 card->dai_link = dai_link; 246 259 card->num_links = 1; 247 260 card->controls = card_controls;
+1 -3
sound/soc/mediatek/mt8188/mt8188-mt6359.c
··· 188 188 SND_SOC_DAILINK_DEFS(ul_src, 189 189 DAILINK_COMP_ARRAY(COMP_CPU("UL_SRC")), 190 190 DAILINK_COMP_ARRAY(COMP_CODEC("mt6359-sound", 191 - "mt6359-snd-codec-aif1"), 192 - COMP_CODEC("dmic-codec", 193 - "dmic-hifi")), 191 + "mt6359-snd-codec-aif1")), 194 192 DAILINK_COMP_ARRAY(COMP_EMPTY())); 195 193 196 194 SND_SOC_DAILINK_DEFS(AFE_SOF_DL2,
+4 -3
sound/soc/sof/ipc3-topology.c
··· 1588 1588 ret = sof_update_ipc_object(scomp, comp_dai, SOF_DAI_TOKENS, swidget->tuples, 1589 1589 swidget->num_tuples, sizeof(*comp_dai), 1); 1590 1590 if (ret < 0) 1591 - goto free; 1591 + goto free_comp; 1592 1592 1593 1593 /* update comp_tokens */ 1594 1594 ret = sof_update_ipc_object(scomp, &comp_dai->config, SOF_COMP_TOKENS, 1595 1595 swidget->tuples, swidget->num_tuples, 1596 1596 sizeof(comp_dai->config), 1); 1597 1597 if (ret < 0) 1598 - goto free; 1598 + goto free_comp; 1599 1599 1600 1600 /* Subtract the base to match the FW dai index. */ 1601 1601 if (comp_dai->type == SOF_DAI_INTEL_ALH) { ··· 1603 1603 dev_err(sdev->dev, 1604 1604 "Invalid ALH dai index %d, only Pin numbers >= %d can be used\n", 1605 1605 comp_dai->dai_index, INTEL_ALH_DAI_INDEX_BASE); 1606 - return -EINVAL; 1606 + ret = -EINVAL; 1607 + goto free_comp; 1607 1608 } 1608 1609 comp_dai->dai_index -= INTEL_ALH_DAI_INDEX_BASE; 1609 1610 }
+11 -3
sound/usb/endpoint.c
··· 403 403 static void notify_xrun(struct snd_usb_endpoint *ep) 404 404 { 405 405 struct snd_usb_substream *data_subs; 406 + struct snd_pcm_substream *psubs; 406 407 407 408 data_subs = READ_ONCE(ep->data_subs); 408 - if (data_subs && data_subs->pcm_substream) 409 - snd_pcm_stop_xrun(data_subs->pcm_substream); 409 + if (!data_subs) 410 + return; 411 + psubs = data_subs->pcm_substream; 412 + if (psubs && psubs->runtime && 413 + psubs->runtime->state == SNDRV_PCM_STATE_RUNNING) 414 + snd_pcm_stop_xrun(psubs); 410 415 } 411 416 412 417 static struct snd_usb_packet_info * ··· 567 562 push_back_to_ready_list(ep, ctx); 568 563 clear_bit(ctx->index, &ep->active_mask); 569 564 snd_usb_queue_pending_output_urbs(ep, false); 570 - atomic_dec(&ep->submitted_urbs); /* decrement at last */ 565 + /* decrement at last, and check xrun */ 566 + if (atomic_dec_and_test(&ep->submitted_urbs) && 567 + !snd_usb_endpoint_implicit_feedback_sink(ep)) 568 + notify_xrun(ep); 571 569 return; 572 570 } 573 571
+10
sound/usb/mixer_maps.c
··· 621 621 .id = USB_ID(0x1b1c, 0x0a42), 622 622 .map = corsair_virtuoso_map, 623 623 }, 624 + { 625 + /* Corsair HS80 RGB Wireless (wired mode) */ 626 + .id = USB_ID(0x1b1c, 0x0a6a), 627 + .map = corsair_virtuoso_map, 628 + }, 629 + { 630 + /* Corsair HS80 RGB Wireless (wireless mode) */ 631 + .id = USB_ID(0x1b1c, 0x0a6b), 632 + .map = corsair_virtuoso_map, 633 + }, 624 634 { /* Gigabyte TRX40 Aorus Master (rear panel + front mic) */ 625 635 .id = USB_ID(0x0414, 0xa001), 626 636 .map = aorus_master_alc1220vb_map,
+1
sound/usb/mixer_quirks.c
··· 4116 4116 err = snd_bbfpro_controls_create(mixer); 4117 4117 break; 4118 4118 case USB_ID(0x2a39, 0x3f8c): /* RME Digiface USB */ 4119 + case USB_ID(0x2a39, 0x3fa0): /* RME Digiface USB (alternate) */ 4119 4120 err = snd_rme_digiface_controls_create(mixer); 4120 4121 break; 4121 4122 case USB_ID(0x2b73, 0x0017): /* Pioneer DJ DJM-250MK2 */
+173 -168
sound/usb/quirks-table.h
··· 3673 3673 } 3674 3674 } 3675 3675 }, 3676 - { 3677 - /* Only claim interface 0 */ 3678 - .match_flags = USB_DEVICE_ID_MATCH_VENDOR | 3679 - USB_DEVICE_ID_MATCH_PRODUCT | 3680 - USB_DEVICE_ID_MATCH_INT_CLASS | 3681 - USB_DEVICE_ID_MATCH_INT_NUMBER, 3682 - .idVendor = 0x2a39, 3683 - .idProduct = 0x3f8c, 3684 - .bInterfaceClass = USB_CLASS_VENDOR_SPEC, 3685 - .bInterfaceNumber = 0, 3686 - QUIRK_DRIVER_INFO { 3687 - QUIRK_DATA_COMPOSITE { 3676 + #define QUIRK_RME_DIGIFACE(pid) \ 3677 + { \ 3678 + /* Only claim interface 0 */ \ 3679 + .match_flags = USB_DEVICE_ID_MATCH_VENDOR | \ 3680 + USB_DEVICE_ID_MATCH_PRODUCT | \ 3681 + USB_DEVICE_ID_MATCH_INT_CLASS | \ 3682 + USB_DEVICE_ID_MATCH_INT_NUMBER, \ 3683 + .idVendor = 0x2a39, \ 3684 + .idProduct = pid, \ 3685 + .bInterfaceClass = USB_CLASS_VENDOR_SPEC, \ 3686 + .bInterfaceNumber = 0, \ 3687 + QUIRK_DRIVER_INFO { \ 3688 + QUIRK_DATA_COMPOSITE { \ 3688 3689 /* 3689 3690 * Three modes depending on sample rate band, 3690 3691 * with different channel counts for in/out 3691 - */ 3692 - { QUIRK_DATA_STANDARD_MIXER(0) }, 3693 - { 3694 - QUIRK_DATA_AUDIOFORMAT(0) { 3695 - .formats = SNDRV_PCM_FMTBIT_S32_LE, 3696 - .channels = 34, // outputs 3697 - .fmt_bits = 24, 3698 - .iface = 0, 3699 - .altsetting = 1, 3700 - .altset_idx = 1, 3701 - .endpoint = 0x02, 3702 - .ep_idx = 1, 3703 - .ep_attr = USB_ENDPOINT_XFER_ISOC | 3704 - USB_ENDPOINT_SYNC_ASYNC, 3705 - .rates = SNDRV_PCM_RATE_32000 | 3706 - SNDRV_PCM_RATE_44100 | 3707 - SNDRV_PCM_RATE_48000, 3708 - .rate_min = 32000, 3709 - .rate_max = 48000, 3710 - .nr_rates = 3, 3711 - .rate_table = (unsigned int[]) { 3712 - 32000, 44100, 48000, 3713 - }, 3714 - .sync_ep = 0x81, 3715 - .sync_iface = 0, 3716 - .sync_altsetting = 1, 3717 - .sync_ep_idx = 0, 3718 - .implicit_fb = 1, 3719 - }, 3720 - }, 3721 - { 3722 - QUIRK_DATA_AUDIOFORMAT(0) { 3723 - .formats = SNDRV_PCM_FMTBIT_S32_LE, 3724 - .channels = 18, // outputs 3725 - .fmt_bits = 24, 3726 - .iface = 0, 3727 - .altsetting = 1, 3728 - .altset_idx = 1, 3729 - .endpoint = 0x02, 3730 - .ep_idx = 1, 3731 - .ep_attr = USB_ENDPOINT_XFER_ISOC | 3732 - USB_ENDPOINT_SYNC_ASYNC, 3733 - .rates = SNDRV_PCM_RATE_64000 | 3734 - SNDRV_PCM_RATE_88200 | 3735 - SNDRV_PCM_RATE_96000, 3736 - .rate_min = 64000, 3737 - .rate_max = 96000, 3738 - .nr_rates = 3, 3739 - .rate_table = (unsigned int[]) { 3740 - 64000, 88200, 96000, 3741 - }, 3742 - .sync_ep = 0x81, 3743 - .sync_iface = 0, 3744 - .sync_altsetting = 1, 3745 - .sync_ep_idx = 0, 3746 - .implicit_fb = 1, 3747 - }, 3748 - }, 3749 - { 3750 - QUIRK_DATA_AUDIOFORMAT(0) { 3751 - .formats = SNDRV_PCM_FMTBIT_S32_LE, 3752 - .channels = 10, // outputs 3753 - .fmt_bits = 24, 3754 - .iface = 0, 3755 - .altsetting = 1, 3756 - .altset_idx = 1, 3757 - .endpoint = 0x02, 3758 - .ep_idx = 1, 3759 - .ep_attr = USB_ENDPOINT_XFER_ISOC | 3760 - USB_ENDPOINT_SYNC_ASYNC, 3761 - .rates = SNDRV_PCM_RATE_KNOT | 3762 - SNDRV_PCM_RATE_176400 | 3763 - SNDRV_PCM_RATE_192000, 3764 - .rate_min = 128000, 3765 - .rate_max = 192000, 3766 - .nr_rates = 3, 3767 - .rate_table = (unsigned int[]) { 3768 - 128000, 176400, 192000, 3769 - }, 3770 - .sync_ep = 0x81, 3771 - .sync_iface = 0, 3772 - .sync_altsetting = 1, 3773 - .sync_ep_idx = 0, 3774 - .implicit_fb = 1, 3775 - }, 3776 - }, 3777 - { 3778 - QUIRK_DATA_AUDIOFORMAT(0) { 3779 - .formats = SNDRV_PCM_FMTBIT_S32_LE, 3780 - .channels = 32, // inputs 3781 - .fmt_bits = 24, 3782 - .iface = 0, 3783 - .altsetting = 1, 3784 - .altset_idx = 1, 3785 - .endpoint = 0x81, 3786 - .ep_attr = USB_ENDPOINT_XFER_ISOC | 3787 - USB_ENDPOINT_SYNC_ASYNC, 3788 - .rates = SNDRV_PCM_RATE_32000 | 3789 - SNDRV_PCM_RATE_44100 | 3790 - SNDRV_PCM_RATE_48000, 3791 - .rate_min = 32000, 3792 - .rate_max = 48000, 3793 - .nr_rates = 3, 3794 - .rate_table = (unsigned int[]) { 3795 - 32000, 44100, 48000, 3796 - } 3797 - } 3798 - }, 3799 - { 3800 - QUIRK_DATA_AUDIOFORMAT(0) { 3801 - .formats = SNDRV_PCM_FMTBIT_S32_LE, 3802 - .channels = 16, // inputs 3803 - .fmt_bits = 24, 3804 - .iface = 0, 3805 - .altsetting = 1, 3806 - .altset_idx = 1, 3807 - .endpoint = 0x81, 3808 - .ep_attr = USB_ENDPOINT_XFER_ISOC | 3809 - USB_ENDPOINT_SYNC_ASYNC, 3810 - .rates = SNDRV_PCM_RATE_64000 | 3811 - SNDRV_PCM_RATE_88200 | 3812 - SNDRV_PCM_RATE_96000, 3813 - .rate_min = 64000, 3814 - .rate_max = 96000, 3815 - .nr_rates = 3, 3816 - .rate_table = (unsigned int[]) { 3817 - 64000, 88200, 96000, 3818 - } 3819 - } 3820 - }, 3821 - { 3822 - QUIRK_DATA_AUDIOFORMAT(0) { 3823 - .formats = SNDRV_PCM_FMTBIT_S32_LE, 3824 - .channels = 8, // inputs 3825 - .fmt_bits = 24, 3826 - .iface = 0, 3827 - .altsetting = 1, 3828 - .altset_idx = 1, 3829 - .endpoint = 0x81, 3830 - .ep_attr = USB_ENDPOINT_XFER_ISOC | 3831 - USB_ENDPOINT_SYNC_ASYNC, 3832 - .rates = SNDRV_PCM_RATE_KNOT | 3833 - SNDRV_PCM_RATE_176400 | 3834 - SNDRV_PCM_RATE_192000, 3835 - .rate_min = 128000, 3836 - .rate_max = 192000, 3837 - .nr_rates = 3, 3838 - .rate_table = (unsigned int[]) { 3839 - 128000, 176400, 192000, 3840 - } 3841 - } 3842 - }, 3843 - QUIRK_COMPOSITE_END 3844 - } 3845 - } 3846 - }, 3692 + */ \ 3693 + { QUIRK_DATA_STANDARD_MIXER(0) }, \ 3694 + { \ 3695 + QUIRK_DATA_AUDIOFORMAT(0) { \ 3696 + .formats = SNDRV_PCM_FMTBIT_S32_LE, \ 3697 + .channels = 34, /* outputs */ \ 3698 + .fmt_bits = 24, \ 3699 + .iface = 0, \ 3700 + .altsetting = 1, \ 3701 + .altset_idx = 1, \ 3702 + .endpoint = 0x02, \ 3703 + .ep_idx = 1, \ 3704 + .ep_attr = USB_ENDPOINT_XFER_ISOC | \ 3705 + USB_ENDPOINT_SYNC_ASYNC, \ 3706 + .rates = SNDRV_PCM_RATE_32000 | \ 3707 + SNDRV_PCM_RATE_44100 | \ 3708 + SNDRV_PCM_RATE_48000, \ 3709 + .rate_min = 32000, \ 3710 + .rate_max = 48000, \ 3711 + .nr_rates = 3, \ 3712 + .rate_table = (unsigned int[]) { \ 3713 + 32000, 44100, 48000, \ 3714 + }, \ 3715 + .sync_ep = 0x81, \ 3716 + .sync_iface = 0, \ 3717 + .sync_altsetting = 1, \ 3718 + .sync_ep_idx = 0, \ 3719 + .implicit_fb = 1, \ 3720 + }, \ 3721 + }, \ 3722 + { \ 3723 + QUIRK_DATA_AUDIOFORMAT(0) { \ 3724 + .formats = SNDRV_PCM_FMTBIT_S32_LE, \ 3725 + .channels = 18, /* outputs */ \ 3726 + .fmt_bits = 24, \ 3727 + .iface = 0, \ 3728 + .altsetting = 1, \ 3729 + .altset_idx = 1, \ 3730 + .endpoint = 0x02, \ 3731 + .ep_idx = 1, \ 3732 + .ep_attr = USB_ENDPOINT_XFER_ISOC | \ 3733 + USB_ENDPOINT_SYNC_ASYNC, \ 3734 + .rates = SNDRV_PCM_RATE_64000 | \ 3735 + SNDRV_PCM_RATE_88200 | \ 3736 + SNDRV_PCM_RATE_96000, \ 3737 + .rate_min = 64000, \ 3738 + .rate_max = 96000, \ 3739 + .nr_rates = 3, \ 3740 + .rate_table = (unsigned int[]) { \ 3741 + 64000, 88200, 96000, \ 3742 + }, \ 3743 + .sync_ep = 0x81, \ 3744 + .sync_iface = 0, \ 3745 + .sync_altsetting = 1, \ 3746 + .sync_ep_idx = 0, \ 3747 + .implicit_fb = 1, \ 3748 + }, \ 3749 + }, \ 3750 + { \ 3751 + QUIRK_DATA_AUDIOFORMAT(0) { \ 3752 + .formats = SNDRV_PCM_FMTBIT_S32_LE, \ 3753 + .channels = 10, /* outputs */ \ 3754 + .fmt_bits = 24, \ 3755 + .iface = 0, \ 3756 + .altsetting = 1, \ 3757 + .altset_idx = 1, \ 3758 + .endpoint = 0x02, \ 3759 + .ep_idx = 1, \ 3760 + .ep_attr = USB_ENDPOINT_XFER_ISOC | \ 3761 + USB_ENDPOINT_SYNC_ASYNC, \ 3762 + .rates = SNDRV_PCM_RATE_KNOT | \ 3763 + SNDRV_PCM_RATE_176400 | \ 3764 + SNDRV_PCM_RATE_192000, \ 3765 + .rate_min = 128000, \ 3766 + .rate_max = 192000, \ 3767 + .nr_rates = 3, \ 3768 + .rate_table = (unsigned int[]) { \ 3769 + 128000, 176400, 192000, \ 3770 + }, \ 3771 + .sync_ep = 0x81, \ 3772 + .sync_iface = 0, \ 3773 + .sync_altsetting = 1, \ 3774 + .sync_ep_idx = 0, \ 3775 + .implicit_fb = 1, \ 3776 + }, \ 3777 + }, \ 3778 + { \ 3779 + QUIRK_DATA_AUDIOFORMAT(0) { \ 3780 + .formats = SNDRV_PCM_FMTBIT_S32_LE, \ 3781 + .channels = 32, /* inputs */ \ 3782 + .fmt_bits = 24, \ 3783 + .iface = 0, \ 3784 + .altsetting = 1, \ 3785 + .altset_idx = 1, \ 3786 + .endpoint = 0x81, \ 3787 + .ep_attr = USB_ENDPOINT_XFER_ISOC | \ 3788 + USB_ENDPOINT_SYNC_ASYNC, \ 3789 + .rates = SNDRV_PCM_RATE_32000 | \ 3790 + SNDRV_PCM_RATE_44100 | \ 3791 + SNDRV_PCM_RATE_48000, \ 3792 + .rate_min = 32000, \ 3793 + .rate_max = 48000, \ 3794 + .nr_rates = 3, \ 3795 + .rate_table = (unsigned int[]) { \ 3796 + 32000, 44100, 48000, \ 3797 + } \ 3798 + } \ 3799 + }, \ 3800 + { \ 3801 + QUIRK_DATA_AUDIOFORMAT(0) { \ 3802 + .formats = SNDRV_PCM_FMTBIT_S32_LE, \ 3803 + .channels = 16, /* inputs */ \ 3804 + .fmt_bits = 24, \ 3805 + .iface = 0, \ 3806 + .altsetting = 1, \ 3807 + .altset_idx = 1, \ 3808 + .endpoint = 0x81, \ 3809 + .ep_attr = USB_ENDPOINT_XFER_ISOC | \ 3810 + USB_ENDPOINT_SYNC_ASYNC, \ 3811 + .rates = SNDRV_PCM_RATE_64000 | \ 3812 + SNDRV_PCM_RATE_88200 | \ 3813 + SNDRV_PCM_RATE_96000, \ 3814 + .rate_min = 64000, \ 3815 + .rate_max = 96000, \ 3816 + .nr_rates = 3, \ 3817 + .rate_table = (unsigned int[]) { \ 3818 + 64000, 88200, 96000, \ 3819 + } \ 3820 + } \ 3821 + }, \ 3822 + { \ 3823 + QUIRK_DATA_AUDIOFORMAT(0) { \ 3824 + .formats = SNDRV_PCM_FMTBIT_S32_LE, \ 3825 + .channels = 8, /* inputs */ \ 3826 + .fmt_bits = 24, \ 3827 + .iface = 0, \ 3828 + .altsetting = 1, \ 3829 + .altset_idx = 1, \ 3830 + .endpoint = 0x81, \ 3831 + .ep_attr = USB_ENDPOINT_XFER_ISOC | \ 3832 + USB_ENDPOINT_SYNC_ASYNC, \ 3833 + .rates = SNDRV_PCM_RATE_KNOT | \ 3834 + SNDRV_PCM_RATE_176400 | \ 3835 + SNDRV_PCM_RATE_192000, \ 3836 + .rate_min = 128000, \ 3837 + .rate_max = 192000, \ 3838 + .nr_rates = 3, \ 3839 + .rate_table = (unsigned int[]) { \ 3840 + 128000, 176400, 192000, \ 3841 + } \ 3842 + } \ 3843 + }, \ 3844 + QUIRK_COMPOSITE_END \ 3845 + } \ 3846 + } \ 3847 + } 3848 + 3849 + QUIRK_RME_DIGIFACE(0x3f8c), 3850 + QUIRK_RME_DIGIFACE(0x3fa0), 3851 + 3847 3852 #undef USB_DEVICE_VENDOR_SPEC 3848 3853 #undef USB_AUDIO_DEVICE
+29 -15
sound/usb/quirks.c
··· 555 555 static int snd_usb_extigy_boot_quirk(struct usb_device *dev, struct usb_interface *intf) 556 556 { 557 557 struct usb_host_config *config = dev->actconfig; 558 - struct usb_device_descriptor new_device_descriptor; 558 + struct usb_device_descriptor *new_device_descriptor __free(kfree) = NULL; 559 559 int err; 560 560 561 561 if (le16_to_cpu(get_cfg_desc(config)->wTotalLength) == EXTIGY_FIRMWARE_SIZE_OLD || ··· 566 566 0x10, 0x43, 0x0001, 0x000a, NULL, 0); 567 567 if (err < 0) 568 568 dev_dbg(&dev->dev, "error sending boot message: %d\n", err); 569 + 570 + new_device_descriptor = kmalloc(sizeof(*new_device_descriptor), GFP_KERNEL); 571 + if (!new_device_descriptor) 572 + return -ENOMEM; 569 573 err = usb_get_descriptor(dev, USB_DT_DEVICE, 0, 570 - &new_device_descriptor, sizeof(new_device_descriptor)); 574 + new_device_descriptor, sizeof(*new_device_descriptor)); 571 575 if (err < 0) 572 576 dev_dbg(&dev->dev, "error usb_get_descriptor: %d\n", err); 573 - if (new_device_descriptor.bNumConfigurations > dev->descriptor.bNumConfigurations) 577 + if (new_device_descriptor->bNumConfigurations > dev->descriptor.bNumConfigurations) 574 578 dev_dbg(&dev->dev, "error too large bNumConfigurations: %d\n", 575 - new_device_descriptor.bNumConfigurations); 579 + new_device_descriptor->bNumConfigurations); 576 580 else 577 - memcpy(&dev->descriptor, &new_device_descriptor, sizeof(dev->descriptor)); 581 + memcpy(&dev->descriptor, new_device_descriptor, sizeof(dev->descriptor)); 578 582 err = usb_reset_configuration(dev); 579 583 if (err < 0) 580 584 dev_dbg(&dev->dev, "error usb_reset_configuration: %d\n", err); ··· 910 906 static int snd_usb_mbox2_boot_quirk(struct usb_device *dev) 911 907 { 912 908 struct usb_host_config *config = dev->actconfig; 913 - struct usb_device_descriptor new_device_descriptor; 909 + struct usb_device_descriptor *new_device_descriptor __free(kfree) = NULL; 914 910 int err; 915 911 u8 bootresponse[0x12]; 916 912 int fwsize; ··· 945 941 946 942 dev_dbg(&dev->dev, "device initialised!\n"); 947 943 944 + new_device_descriptor = kmalloc(sizeof(*new_device_descriptor), GFP_KERNEL); 945 + if (!new_device_descriptor) 946 + return -ENOMEM; 947 + 948 948 err = usb_get_descriptor(dev, USB_DT_DEVICE, 0, 949 - &new_device_descriptor, sizeof(new_device_descriptor)); 949 + new_device_descriptor, sizeof(*new_device_descriptor)); 950 950 if (err < 0) 951 951 dev_dbg(&dev->dev, "error usb_get_descriptor: %d\n", err); 952 - if (new_device_descriptor.bNumConfigurations > dev->descriptor.bNumConfigurations) 952 + if (new_device_descriptor->bNumConfigurations > dev->descriptor.bNumConfigurations) 953 953 dev_dbg(&dev->dev, "error too large bNumConfigurations: %d\n", 954 - new_device_descriptor.bNumConfigurations); 954 + new_device_descriptor->bNumConfigurations); 955 955 else 956 - memcpy(&dev->descriptor, &new_device_descriptor, sizeof(dev->descriptor)); 956 + memcpy(&dev->descriptor, new_device_descriptor, sizeof(dev->descriptor)); 957 957 958 958 err = usb_reset_configuration(dev); 959 959 if (err < 0) ··· 1267 1259 static int snd_usb_mbox3_boot_quirk(struct usb_device *dev) 1268 1260 { 1269 1261 struct usb_host_config *config = dev->actconfig; 1270 - struct usb_device_descriptor new_device_descriptor; 1262 + struct usb_device_descriptor *new_device_descriptor __free(kfree) = NULL; 1271 1263 int err; 1272 1264 int descriptor_size; 1273 1265 ··· 1280 1272 1281 1273 dev_dbg(&dev->dev, "MBOX3: device initialised!\n"); 1282 1274 1275 + new_device_descriptor = kmalloc(sizeof(*new_device_descriptor), GFP_KERNEL); 1276 + if (!new_device_descriptor) 1277 + return -ENOMEM; 1278 + 1283 1279 err = usb_get_descriptor(dev, USB_DT_DEVICE, 0, 1284 - &new_device_descriptor, sizeof(new_device_descriptor)); 1280 + new_device_descriptor, sizeof(*new_device_descriptor)); 1285 1281 if (err < 0) 1286 1282 dev_dbg(&dev->dev, "MBOX3: error usb_get_descriptor: %d\n", err); 1287 - if (new_device_descriptor.bNumConfigurations > dev->descriptor.bNumConfigurations) 1283 + if (new_device_descriptor->bNumConfigurations > dev->descriptor.bNumConfigurations) 1288 1284 dev_dbg(&dev->dev, "MBOX3: error too large bNumConfigurations: %d\n", 1289 - new_device_descriptor.bNumConfigurations); 1285 + new_device_descriptor->bNumConfigurations); 1290 1286 else 1291 - memcpy(&dev->descriptor, &new_device_descriptor, sizeof(dev->descriptor)); 1287 + memcpy(&dev->descriptor, new_device_descriptor, sizeof(dev->descriptor)); 1292 1288 1293 1289 err = usb_reset_configuration(dev); 1294 1290 if (err < 0) ··· 1665 1653 return snd_usb_motu_microbookii_boot_quirk(dev); 1666 1654 break; 1667 1655 case USB_ID(0x2a39, 0x3f8c): /* RME Digiface USB */ 1656 + case USB_ID(0x2a39, 0x3fa0): /* RME Digiface USB (alternate) */ 1668 1657 return snd_usb_rme_digiface_boot_quirk(dev); 1669 1658 } 1670 1659 ··· 1879 1866 mbox3_set_format_quirk(subs, fmt); /* Digidesign Mbox 3 */ 1880 1867 break; 1881 1868 case USB_ID(0x2a39, 0x3f8c): /* RME Digiface USB */ 1869 + case USB_ID(0x2a39, 0x3fa0): /* RME Digiface USB (alternate) */ 1882 1870 rme_digiface_set_format_quirk(subs); 1883 1871 break; 1884 1872 }