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

Merge branch 'for-linus' into for-next

Merge for 5.18-rc1

Signed-off-by: Takashi Iwai <tiwai@suse.de>

+493 -264
+3
drivers/firewire/core-card.c
··· 679 679 void fw_core_remove_card(struct fw_card *card) 680 680 { 681 681 struct fw_card_driver dummy_driver = dummy_driver_template; 682 + unsigned long flags; 682 683 683 684 card->driver->update_phy_reg(card, 4, 684 685 PHY_LINK_ACTIVE | PHY_CONTENDER, 0); ··· 694 693 dummy_driver.stop_iso = card->driver->stop_iso; 695 694 card->driver = &dummy_driver; 696 695 696 + spin_lock_irqsave(&card->lock, flags); 697 697 fw_destroy_nodes(card); 698 + spin_unlock_irqrestore(&card->lock, flags); 698 699 699 700 /* Wait for all users, especially device workqueue jobs, to finish. */ 700 701 fw_card_put(card);
+3 -1
drivers/firewire/core-cdev.c
··· 1502 1502 { 1503 1503 struct outbound_phy_packet_event *e = 1504 1504 container_of(packet, struct outbound_phy_packet_event, p); 1505 + struct client *e_client; 1505 1506 1506 1507 switch (status) { 1507 1508 /* expected: */ ··· 1519 1518 } 1520 1519 e->phy_packet.data[0] = packet->timestamp; 1521 1520 1521 + e_client = e->client; 1522 1522 queue_event(e->client, &e->event, &e->phy_packet, 1523 1523 sizeof(e->phy_packet) + e->phy_packet.length, NULL, 0); 1524 - client_put(e->client); 1524 + client_put(e_client); 1525 1525 } 1526 1526 1527 1527 static int ioctl_send_phy_packet(struct client *client, union ioctl_arg *arg)
+3 -6
drivers/firewire/core-topology.c
··· 375 375 card->bm_retries = 0; 376 376 } 377 377 378 + /* Must be called with card->lock held */ 378 379 void fw_destroy_nodes(struct fw_card *card) 379 380 { 380 - unsigned long flags; 381 - 382 - spin_lock_irqsave(&card->lock, flags); 383 381 card->color++; 384 382 if (card->local_node != NULL) 385 383 for_each_fw_node(card, card->local_node, report_lost_node); 386 384 card->local_node = NULL; 387 - spin_unlock_irqrestore(&card->lock, flags); 388 385 } 389 386 390 387 static void move_tree(struct fw_node *node0, struct fw_node *node1, int port) ··· 507 510 struct fw_node *local_node; 508 511 unsigned long flags; 509 512 513 + spin_lock_irqsave(&card->lock, flags); 514 + 510 515 /* 511 516 * If the selfID buffer is not the immediate successor of the 512 517 * previously processed one, we cannot reliably compare the ··· 519 520 fw_destroy_nodes(card); 520 521 card->bm_retries = 0; 521 522 } 522 - 523 - spin_lock_irqsave(&card->lock, flags); 524 523 525 524 card->broadcast_channel_allocated = card->broadcast_channel_auto_allocated; 526 525 card->node_id = node_id;
+16 -14
drivers/firewire/core-transaction.c
··· 73 73 static int close_transaction(struct fw_transaction *transaction, 74 74 struct fw_card *card, int rcode) 75 75 { 76 - struct fw_transaction *t; 76 + struct fw_transaction *t = NULL, *iter; 77 77 unsigned long flags; 78 78 79 79 spin_lock_irqsave(&card->lock, flags); 80 - list_for_each_entry(t, &card->transaction_list, link) { 81 - if (t == transaction) { 82 - if (!try_cancel_split_timeout(t)) { 80 + list_for_each_entry(iter, &card->transaction_list, link) { 81 + if (iter == transaction) { 82 + if (!try_cancel_split_timeout(iter)) { 83 83 spin_unlock_irqrestore(&card->lock, flags); 84 84 goto timed_out; 85 85 } 86 - list_del_init(&t->link); 87 - card->tlabel_mask &= ~(1ULL << t->tlabel); 86 + list_del_init(&iter->link); 87 + card->tlabel_mask &= ~(1ULL << iter->tlabel); 88 + t = iter; 88 89 break; 89 90 } 90 91 } 91 92 spin_unlock_irqrestore(&card->lock, flags); 92 93 93 - if (&t->link != &card->transaction_list) { 94 + if (t) { 94 95 t->callback(card, rcode, NULL, 0, t->callback_data); 95 96 return 0; 96 97 } ··· 954 953 955 954 void fw_core_handle_response(struct fw_card *card, struct fw_packet *p) 956 955 { 957 - struct fw_transaction *t; 956 + struct fw_transaction *t = NULL, *iter; 958 957 unsigned long flags; 959 958 u32 *data; 960 959 size_t data_length; ··· 966 965 rcode = HEADER_GET_RCODE(p->header[1]); 967 966 968 967 spin_lock_irqsave(&card->lock, flags); 969 - list_for_each_entry(t, &card->transaction_list, link) { 970 - if (t->node_id == source && t->tlabel == tlabel) { 971 - if (!try_cancel_split_timeout(t)) { 968 + list_for_each_entry(iter, &card->transaction_list, link) { 969 + if (iter->node_id == source && iter->tlabel == tlabel) { 970 + if (!try_cancel_split_timeout(iter)) { 972 971 spin_unlock_irqrestore(&card->lock, flags); 973 972 goto timed_out; 974 973 } 975 - list_del_init(&t->link); 976 - card->tlabel_mask &= ~(1ULL << t->tlabel); 974 + list_del_init(&iter->link); 975 + card->tlabel_mask &= ~(1ULL << iter->tlabel); 976 + t = iter; 977 977 break; 978 978 } 979 979 } 980 980 spin_unlock_irqrestore(&card->lock, flags); 981 981 982 - if (&t->link == &card->transaction_list) { 982 + if (!t) { 983 983 timed_out: 984 984 fw_notice(card, "unsolicited response (source %x, tlabel %x)\n", 985 985 source, tlabel);
+7 -6
drivers/firewire/sbp2.c
··· 408 408 void *payload, size_t length, void *callback_data) 409 409 { 410 410 struct sbp2_logical_unit *lu = callback_data; 411 - struct sbp2_orb *orb; 411 + struct sbp2_orb *orb = NULL, *iter; 412 412 struct sbp2_status status; 413 413 unsigned long flags; 414 414 ··· 433 433 434 434 /* Lookup the orb corresponding to this status write. */ 435 435 spin_lock_irqsave(&lu->tgt->lock, flags); 436 - list_for_each_entry(orb, &lu->orb_list, link) { 436 + list_for_each_entry(iter, &lu->orb_list, link) { 437 437 if (STATUS_GET_ORB_HIGH(status) == 0 && 438 - STATUS_GET_ORB_LOW(status) == orb->request_bus) { 439 - orb->rcode = RCODE_COMPLETE; 440 - list_del(&orb->link); 438 + STATUS_GET_ORB_LOW(status) == iter->request_bus) { 439 + iter->rcode = RCODE_COMPLETE; 440 + list_del(&iter->link); 441 + orb = iter; 441 442 break; 442 443 } 443 444 } 444 445 spin_unlock_irqrestore(&lu->tgt->lock, flags); 445 446 446 - if (&orb->link != &lu->orb_list) { 447 + if (orb) { 447 448 orb->callback(orb, &status); 448 449 kref_put(&orb->kref, free_orb); /* orb callback reference */ 449 450 } else {
+1 -2
drivers/firmware/cirrus/cs_dsp.c
··· 955 955 ctl->alg_region = *alg_region; 956 956 if (subname && dsp->fw_ver >= 2) { 957 957 ctl->subname_len = subname_len; 958 - ctl->subname = kmemdup(subname, 959 - strlen(subname) + 1, GFP_KERNEL); 958 + ctl->subname = kasprintf(GFP_KERNEL, "%.*s", subname_len, subname); 960 959 if (!ctl->subname) { 961 960 ret = -ENOMEM; 962 961 goto err_ctl;
+4
include/sound/soc-component.h
··· 179 179 struct snd_pcm_hw_params *params); 180 180 bool use_dai_pcm_id; /* use DAI link PCM ID as PCM device number */ 181 181 int be_pcm_base; /* base device ID for all BE PCMs */ 182 + 183 + #ifdef CONFIG_DEBUG_FS 184 + const char *debugfs_prefix; 185 + #endif 182 186 }; 183 187 184 188 struct snd_soc_component {
+1
sound/firewire/fireworks/fireworks_hwdep.c
··· 34 34 type = SNDRV_FIREWIRE_EVENT_EFW_RESPONSE; 35 35 if (copy_to_user(buf, &type, sizeof(type))) 36 36 return -EFAULT; 37 + count += sizeof(type); 37 38 remained -= sizeof(type); 38 39 buf += sizeof(type); 39 40
+3 -4
sound/hda/hdac_i915.c
··· 127 127 display_dev = pci_get_class(class, display_dev); 128 128 129 129 if (display_dev && display_dev->vendor == PCI_VENDOR_ID_INTEL && 130 - connectivity_check(display_dev, hdac_pci)) 130 + connectivity_check(display_dev, hdac_pci)) { 131 + pci_dev_put(display_dev); 131 132 match = true; 132 - 133 - pci_dev_put(display_dev); 134 - 133 + } 135 134 } while (!match && display_dev); 136 135 137 136 return match;
+9
sound/hda/intel-dsp-config.c
··· 424 424 .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE, 425 425 .device = 0x54c8, 426 426 }, 427 + /* RaptorLake-P */ 428 + { 429 + .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE, 430 + .device = 0x51ca, 431 + }, 432 + { 433 + .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE, 434 + .device = 0x51cb, 435 + }, 427 436 #endif 428 437 429 438 };
+2 -1
sound/isa/wavefront/wavefront_synth.c
··· 1094 1094 1095 1095 if (dataptr < data_end) { 1096 1096 1097 - __get_user (sample_short, dataptr); 1097 + if (get_user(sample_short, dataptr)) 1098 + return -EFAULT; 1098 1099 dataptr += skip; 1099 1100 1100 1101 if (data_is_unsigned) { /* GUS ? */
+1 -1
sound/oss/dmasound/dmasound_core.c
··· 1428 1428 unregister_sound_dsp(sq_unit); 1429 1429 } 1430 1430 1431 - static int dmasound_setup(char *str) 1431 + static int __maybe_unused dmasound_setup(char *str) 1432 1432 { 1433 1433 int ints[6], size; 1434 1434
+5 -2
sound/pci/hda/patch_hdmi.c
··· 1395 1395 1396 1396 last_try: 1397 1397 /* the last try; check the empty slots in pins */ 1398 - for (i = 0; i < spec->num_nids; i++) { 1398 + for (i = 0; i < spec->pcm_used; i++) { 1399 1399 if (!test_bit(i, &spec->pcm_bitmap)) 1400 1400 return i; 1401 1401 } ··· 2325 2325 * dev_num is the device entry number in a pin 2326 2326 */ 2327 2327 2328 - if (codec->mst_no_extra_pcms) 2328 + if (spec->dyn_pcm_no_legacy && codec->mst_no_extra_pcms) 2329 + pcm_num = spec->num_cvts; 2330 + else if (codec->mst_no_extra_pcms) 2329 2331 pcm_num = spec->num_nids; 2330 2332 else 2331 2333 pcm_num = spec->num_nids + spec->dev_num - 1; ··· 4553 4551 HDA_CODEC_ENTRY(0x8086281a, "Jasperlake HDMI", patch_i915_icl_hdmi), 4554 4552 HDA_CODEC_ENTRY(0x8086281b, "Elkhartlake HDMI", patch_i915_icl_hdmi), 4555 4553 HDA_CODEC_ENTRY(0x8086281c, "Alderlake-P HDMI", patch_i915_adlp_hdmi), 4554 + HDA_CODEC_ENTRY(0x8086281f, "Raptorlake-P HDMI", patch_i915_adlp_hdmi), 4556 4555 HDA_CODEC_ENTRY(0x80862880, "CedarTrail HDMI", patch_generic_hdmi), 4557 4556 HDA_CODEC_ENTRY(0x80862882, "Valleyview2 HDMI", patch_i915_byt_hdmi), 4558 4557 HDA_CODEC_ENTRY(0x80862883, "Braswell HDMI", patch_i915_byt_hdmi),
+85 -13
sound/pci/hda/patch_realtek.c
··· 937 937 return 0; 938 938 } 939 939 940 + #define alc_free snd_hda_gen_free 941 + 942 + #ifdef CONFIG_PM 940 943 static inline void alc_shutup(struct hda_codec *codec) 941 944 { 942 945 struct alc_spec *spec = codec->spec; ··· 953 950 alc_shutup_pins(codec); 954 951 } 955 952 956 - #define alc_free snd_hda_gen_free 957 - 958 - #ifdef CONFIG_PM 959 953 static void alc_power_eapd(struct hda_codec *codec) 960 954 { 961 955 alc_auto_setup_eapd(codec, false); ··· 966 966 spec->power_hook(codec); 967 967 return 0; 968 968 } 969 - #endif 970 969 971 - #ifdef CONFIG_PM 972 970 static int alc_resume(struct hda_codec *codec) 973 971 { 974 972 struct alc_spec *spec = codec->spec; ··· 6726 6728 } 6727 6729 } 6728 6730 6731 + static void alc_fixup_dell4_mic_no_presence_quiet(struct hda_codec *codec, 6732 + const struct hda_fixup *fix, 6733 + int action) 6734 + { 6735 + struct alc_spec *spec = codec->spec; 6736 + struct hda_input_mux *imux = &spec->gen.input_mux; 6737 + int i; 6738 + 6739 + alc269_fixup_limit_int_mic_boost(codec, fix, action); 6740 + 6741 + switch (action) { 6742 + case HDA_FIXUP_ACT_PRE_PROBE: 6743 + /** 6744 + * Set the vref of pin 0x19 (Headset Mic) and pin 0x1b (Headphone Mic) 6745 + * to Hi-Z to avoid pop noises at startup and when plugging and 6746 + * unplugging headphones. 6747 + */ 6748 + snd_hda_codec_set_pin_target(codec, 0x19, PIN_VREFHIZ); 6749 + snd_hda_codec_set_pin_target(codec, 0x1b, PIN_VREFHIZ); 6750 + break; 6751 + case HDA_FIXUP_ACT_PROBE: 6752 + /** 6753 + * Make the internal mic (0x12) the default input source to 6754 + * prevent pop noises on cold boot. 6755 + */ 6756 + for (i = 0; i < imux->num_items; i++) { 6757 + if (spec->gen.imux_pins[i] == 0x12) { 6758 + spec->gen.cur_mux[0] = i; 6759 + break; 6760 + } 6761 + } 6762 + break; 6763 + } 6764 + } 6765 + 6729 6766 enum { 6730 6767 ALC269_FIXUP_GPIO2, 6731 6768 ALC269_FIXUP_SONY_VAIO, ··· 6802 6769 ALC269_FIXUP_DELL2_MIC_NO_PRESENCE, 6803 6770 ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, 6804 6771 ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, 6772 + ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET, 6805 6773 ALC269_FIXUP_HEADSET_MODE, 6806 6774 ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, 6807 6775 ALC269_FIXUP_ASPIRE_HEADSET_MIC, ··· 6988 6954 ALC285_FIXUP_LEGION_Y9000X_AUTOMUTE, 6989 6955 ALC287_FIXUP_LEGION_16ACHG6, 6990 6956 ALC287_FIXUP_CS35L41_I2C_2, 6957 + ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED, 6991 6958 ALC245_FIXUP_CS35L41_SPI_2, 6992 6959 ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED, 6993 6960 ALC245_FIXUP_CS35L41_SPI_4, 6994 6961 ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED, 6995 6962 ALC285_FIXUP_HP_SPEAKERS_MICMUTE_LED, 6963 + ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE, 6996 6964 }; 6997 6965 6998 6966 static const struct hda_fixup alc269_fixups[] = { ··· 8752 8716 [ALC287_FIXUP_CS35L41_I2C_2] = { 8753 8717 .type = HDA_FIXUP_FUNC, 8754 8718 .v.func = cs35l41_fixup_i2c_two, 8719 + .chained = true, 8720 + .chain_id = ALC269_FIXUP_THINKPAD_ACPI, 8721 + }, 8722 + [ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED] = { 8723 + .type = HDA_FIXUP_FUNC, 8724 + .v.func = cs35l41_fixup_i2c_two, 8725 + .chained = true, 8726 + .chain_id = ALC285_FIXUP_HP_MUTE_LED, 8755 8727 }, 8756 8728 [ALC245_FIXUP_CS35L41_SPI_2] = { 8757 8729 .type = HDA_FIXUP_FUNC, ··· 8790 8746 }, 8791 8747 .chained = true, 8792 8748 .chain_id = ALC285_FIXUP_HP_MUTE_LED, 8749 + }, 8750 + [ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET] = { 8751 + .type = HDA_FIXUP_FUNC, 8752 + .v.func = alc_fixup_dell4_mic_no_presence_quiet, 8753 + .chained = true, 8754 + .chain_id = ALC269_FIXUP_DELL4_MIC_NO_PRESENCE, 8755 + }, 8756 + [ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE] = { 8757 + .type = HDA_FIXUP_PINS, 8758 + .v.pins = (const struct hda_pintbl[]) { 8759 + { 0x19, 0x02a1112c }, /* use as headset mic, without its own jack detect */ 8760 + { } 8761 + }, 8762 + .chained = true, 8763 + .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC 8793 8764 }, 8794 8765 }; 8795 8766 ··· 8896 8837 SND_PCI_QUIRK(0x1028, 0x09bf, "Dell Precision", ALC233_FIXUP_ASUS_MIC_NO_PRESENCE), 8897 8838 SND_PCI_QUIRK(0x1028, 0x0a2e, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC), 8898 8839 SND_PCI_QUIRK(0x1028, 0x0a30, "Dell", ALC236_FIXUP_DELL_AIO_HEADSET_MIC), 8840 + SND_PCI_QUIRK(0x1028, 0x0a38, "Dell Latitude 7520", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE_QUIET), 8899 8841 SND_PCI_QUIRK(0x1028, 0x0a58, "Dell", ALC255_FIXUP_DELL_HEADSET_MIC), 8900 8842 SND_PCI_QUIRK(0x1028, 0x0a61, "Dell XPS 15 9510", ALC289_FIXUP_DUAL_SPK), 8901 8843 SND_PCI_QUIRK(0x1028, 0x0a62, "Dell Precision 5560", ALC289_FIXUP_DUAL_SPK), ··· 9024 8964 SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED), 9025 8965 SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST), 9026 8966 SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED), 9027 - SND_PCI_QUIRK(0x103c, 0x896e, "HP EliteBook x360 830 G9", ALC245_FIXUP_CS35L41_SPI_2), 9028 - SND_PCI_QUIRK(0x103c, 0x8971, "HP EliteBook 830 G9", ALC245_FIXUP_CS35L41_SPI_2), 9029 - SND_PCI_QUIRK(0x103c, 0x8972, "HP EliteBook 840 G9", ALC245_FIXUP_CS35L41_SPI_2), 9030 - SND_PCI_QUIRK(0x103c, 0x8973, "HP EliteBook 860 G9", ALC245_FIXUP_CS35L41_SPI_2), 9031 - SND_PCI_QUIRK(0x103c, 0x8974, "HP EliteBook 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2), 9032 - SND_PCI_QUIRK(0x103c, 0x8975, "HP EliteBook x360 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2), 8967 + SND_PCI_QUIRK(0x103c, 0x896e, "HP EliteBook x360 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 8968 + SND_PCI_QUIRK(0x103c, 0x8971, "HP EliteBook 830 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 8969 + SND_PCI_QUIRK(0x103c, 0x8972, "HP EliteBook 840 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 8970 + SND_PCI_QUIRK(0x103c, 0x8973, "HP EliteBook 860 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 8971 + SND_PCI_QUIRK(0x103c, 0x8974, "HP EliteBook 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 8972 + SND_PCI_QUIRK(0x103c, 0x8975, "HP EliteBook x360 840 Aero G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 9033 8973 SND_PCI_QUIRK(0x103c, 0x8981, "HP Elite Dragonfly G3", ALC245_FIXUP_CS35L41_SPI_4), 9034 8974 SND_PCI_QUIRK(0x103c, 0x898e, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2), 9035 8975 SND_PCI_QUIRK(0x103c, 0x898f, "HP EliteBook 835 G9", ALC287_FIXUP_CS35L41_I2C_2), 9036 - SND_PCI_QUIRK(0x103c, 0x8991, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2), 8976 + SND_PCI_QUIRK(0x103c, 0x8991, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), 9037 8977 SND_PCI_QUIRK(0x103c, 0x8992, "HP EliteBook 845 G9", ALC287_FIXUP_CS35L41_I2C_2), 9038 - SND_PCI_QUIRK(0x103c, 0x8994, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2), 8978 + SND_PCI_QUIRK(0x103c, 0x8994, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), 9039 8979 SND_PCI_QUIRK(0x103c, 0x8995, "HP EliteBook 855 G9", ALC287_FIXUP_CS35L41_I2C_2), 9040 8980 SND_PCI_QUIRK(0x103c, 0x89a4, "HP ProBook 440 G9", ALC236_FIXUP_HP_GPIO_LED), 9041 8981 SND_PCI_QUIRK(0x103c, 0x89a6, "HP ProBook 450 G9", ALC236_FIXUP_HP_GPIO_LED), 8982 + SND_PCI_QUIRK(0x103c, 0x89aa, "HP EliteBook 630 G9", ALC236_FIXUP_HP_GPIO_LED), 9042 8983 SND_PCI_QUIRK(0x103c, 0x89ac, "HP EliteBook 640 G9", ALC236_FIXUP_HP_GPIO_LED), 9043 8984 SND_PCI_QUIRK(0x103c, 0x89ae, "HP EliteBook 650 G9", ALC236_FIXUP_HP_GPIO_LED), 9044 8985 SND_PCI_QUIRK(0x103c, 0x89c3, "Zbook Studio G9", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED), ··· 9172 9111 SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[57][0-9]RZ[Q]", ALC269_FIXUP_DMIC), 9173 9112 SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 9174 9113 SND_PCI_QUIRK(0x1558, 0x866d, "Clevo NP5[05]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 9114 + SND_PCI_QUIRK(0x1558, 0x867c, "Clevo NP7[01]PNP", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 9175 9115 SND_PCI_QUIRK(0x1558, 0x867d, "Clevo NP7[01]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 9176 9116 SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 9177 9117 SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME), ··· 9247 9185 SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS), 9248 9186 SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940", ALC298_FIXUP_LENOVO_SPK_VOLUME), 9249 9187 SND_PCI_QUIRK(0x17aa, 0x3819, "Lenovo 13s Gen2 ITL", ALC287_FIXUP_13S_GEN2_SPEAKERS), 9188 + SND_PCI_QUIRK(0x17aa, 0x3820, "Yoga Duet 7 13ITL6", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), 9250 9189 SND_PCI_QUIRK(0x17aa, 0x3824, "Legion Y9000X 2020", ALC285_FIXUP_LEGION_Y9000X_SPEAKERS), 9251 9190 SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF), 9252 9191 SND_PCI_QUIRK(0x17aa, 0x3834, "Lenovo IdeaPad Slim 9i 14ITL5", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), ··· 9290 9227 SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802), 9291 9228 SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X), 9292 9229 SND_PCI_QUIRK(0x1d05, 0x1132, "TongFang PHxTxX1", ALC256_FIXUP_SET_COEF_DEFAULTS), 9230 + SND_PCI_QUIRK(0x1d05, 0x1096, "TongFang GMxMRxx", ALC269_FIXUP_NO_SHUTUP), 9231 + SND_PCI_QUIRK(0x1d05, 0x1100, "TongFang GKxNRxx", ALC269_FIXUP_NO_SHUTUP), 9232 + SND_PCI_QUIRK(0x1d05, 0x1111, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP), 9233 + SND_PCI_QUIRK(0x1d05, 0x1119, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP), 9234 + SND_PCI_QUIRK(0x1d05, 0x1129, "TongFang GMxZGxx", ALC269_FIXUP_NO_SHUTUP), 9235 + SND_PCI_QUIRK(0x1d05, 0x1147, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP), 9236 + SND_PCI_QUIRK(0x1d05, 0x115c, "TongFang GMxTGxx", ALC269_FIXUP_NO_SHUTUP), 9237 + SND_PCI_QUIRK(0x1d05, 0x121b, "TongFang GMxAGxx", ALC269_FIXUP_NO_SHUTUP), 9293 9238 SND_PCI_QUIRK(0x1d72, 0x1602, "RedmiBook", ALC255_FIXUP_XIAOMI_HEADSET_MIC), 9294 9239 SND_PCI_QUIRK(0x1d72, 0x1701, "XiaomiNotebook Pro", ALC298_FIXUP_DELL1_MIC_NO_PRESENCE), 9295 9240 SND_PCI_QUIRK(0x1d72, 0x1901, "RedmiBook 14", ALC256_FIXUP_ASUS_HEADSET_MIC), ··· 9305 9234 SND_PCI_QUIRK(0x8086, 0x2074, "Intel NUC 8", ALC233_FIXUP_INTEL_NUC8_DMIC), 9306 9235 SND_PCI_QUIRK(0x8086, 0x2080, "Intel NUC 8 Rugged", ALC256_FIXUP_INTEL_NUC8_RUGGED), 9307 9236 SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10), 9237 + SND_PCI_QUIRK(0xf111, 0x0001, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE), 9308 9238 9309 9239 #if 0 9310 9240 /* Below is a quirk table taken from the old code.
+2 -1
sound/pci/lola/lola_pcm.c
··· 561 561 void lola_pcm_update(struct lola *chip, struct lola_pcm *pcm, unsigned int bits) 562 562 { 563 563 int i; 564 + u8 num_streams = min_t(u8, pcm->num_streams, ARRAY_SIZE(pcm->streams)); 564 565 565 - for (i = 0; bits && i < pcm->num_streams; i++) { 566 + for (i = 0; bits && i < num_streams; i++) { 566 567 if (bits & (1 << i)) { 567 568 struct lola_stream *str = &pcm->streams[i]; 568 569 if (str->substream && str->running)
+1
sound/soc/atmel/mchp-pdmc.c
··· 966 966 967 967 static struct snd_dmaengine_pcm_config mchp_pdmc_config = { 968 968 .process = mchp_pdmc_process, 969 + .prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config, 969 970 }; 970 971 971 972 static int mchp_pdmc_probe(struct platform_device *pdev)
-61
sound/soc/atmel/sam9g20_wm8731.c
··· 46 46 */ 47 47 #undef ENABLE_MIC_INPUT 48 48 49 - static struct clk *mclk; 50 - 51 - static int at91sam9g20ek_set_bias_level(struct snd_soc_card *card, 52 - struct snd_soc_dapm_context *dapm, 53 - enum snd_soc_bias_level level) 54 - { 55 - static int mclk_on; 56 - int ret = 0; 57 - 58 - switch (level) { 59 - case SND_SOC_BIAS_ON: 60 - case SND_SOC_BIAS_PREPARE: 61 - if (!mclk_on) 62 - ret = clk_enable(mclk); 63 - if (ret == 0) 64 - mclk_on = 1; 65 - break; 66 - 67 - case SND_SOC_BIAS_OFF: 68 - case SND_SOC_BIAS_STANDBY: 69 - if (mclk_on) 70 - clk_disable(mclk); 71 - mclk_on = 0; 72 - break; 73 - } 74 - 75 - return ret; 76 - } 77 - 78 49 static const struct snd_soc_dapm_widget at91sam9g20ek_dapm_widgets[] = { 79 50 SND_SOC_DAPM_MIC("Int Mic", NULL), 80 51 SND_SOC_DAPM_SPK("Ext Spk", NULL), ··· 106 135 .owner = THIS_MODULE, 107 136 .dai_link = &at91sam9g20ek_dai, 108 137 .num_links = 1, 109 - .set_bias_level = at91sam9g20ek_set_bias_level, 110 138 111 139 .dapm_widgets = at91sam9g20ek_dapm_widgets, 112 140 .num_dapm_widgets = ARRAY_SIZE(at91sam9g20ek_dapm_widgets), ··· 118 148 { 119 149 struct device_node *np = pdev->dev.of_node; 120 150 struct device_node *codec_np, *cpu_np; 121 - struct clk *pllb; 122 151 struct snd_soc_card *card = &snd_soc_at91sam9g20ek; 123 152 int ret; 124 153 ··· 130 161 dev_err(&pdev->dev, "ssc channel is not valid\n"); 131 162 return -EINVAL; 132 163 } 133 - 134 - /* 135 - * Codec MCLK is supplied by PCK0 - set it up. 136 - */ 137 - mclk = clk_get(NULL, "pck0"); 138 - if (IS_ERR(mclk)) { 139 - dev_err(&pdev->dev, "Failed to get MCLK\n"); 140 - ret = PTR_ERR(mclk); 141 - goto err; 142 - } 143 - 144 - pllb = clk_get(NULL, "pllb"); 145 - if (IS_ERR(pllb)) { 146 - dev_err(&pdev->dev, "Failed to get PLLB\n"); 147 - ret = PTR_ERR(pllb); 148 - goto err_mclk; 149 - } 150 - ret = clk_set_parent(mclk, pllb); 151 - clk_put(pllb); 152 - if (ret != 0) { 153 - dev_err(&pdev->dev, "Failed to set MCLK parent\n"); 154 - goto err_mclk; 155 - } 156 - 157 - clk_set_rate(mclk, MCLK_RATE); 158 164 159 165 card->dev = &pdev->dev; 160 166 ··· 174 230 175 231 return ret; 176 232 177 - err_mclk: 178 - clk_put(mclk); 179 - mclk = NULL; 180 233 err: 181 234 atmel_ssc_put_audio(0); 182 235 return ret; ··· 183 242 { 184 243 struct snd_soc_card *card = platform_get_drvdata(pdev); 185 244 186 - clk_disable(mclk); 187 - mclk = NULL; 188 245 snd_soc_unregister_card(card); 189 246 atmel_ssc_put_audio(0); 190 247
+6 -4
sound/soc/codecs/cs35l41-lib.c
··· 842 842 word_offset = otp_map_match->word_offset; 843 843 844 844 for (i = 0; i < otp_map_match->num_elements; i++) { 845 - dev_dbg(dev, "bitoffset= %d, word_offset=%d, bit_sum mod 32=%d\n", 846 - bit_offset, word_offset, bit_sum % 32); 845 + dev_dbg(dev, "bitoffset= %d, word_offset=%d, bit_sum mod 32=%d otp_map[i].size = %d\n", 846 + bit_offset, word_offset, bit_sum % 32, otp_map[i].size); 847 847 if (bit_offset + otp_map[i].size - 1 >= 32) { 848 848 otp_val = (otp_mem[word_offset] & 849 849 GENMASK(31, bit_offset)) >> bit_offset; ··· 851 851 GENMASK(bit_offset + otp_map[i].size - 33, 0)) << 852 852 (32 - bit_offset); 853 853 bit_offset += otp_map[i].size - 32; 854 - } else { 854 + } else if (bit_offset + otp_map[i].size - 1 >= 0) { 855 855 otp_val = (otp_mem[word_offset] & 856 856 GENMASK(bit_offset + otp_map[i].size - 1, bit_offset) 857 857 ) >> bit_offset; 858 858 bit_offset += otp_map[i].size; 859 - } 859 + } else /* both bit_offset and otp_map[i].size are 0 */ 860 + otp_val = 0; 861 + 860 862 bit_sum += otp_map[i].size; 861 863 862 864 if (bit_offset == 32) {
+10 -4
sound/soc/codecs/da7219.c
··· 446 446 struct soc_mixer_control *mixer_ctrl = 447 447 (struct soc_mixer_control *) kcontrol->private_value; 448 448 unsigned int reg = mixer_ctrl->reg; 449 - __le16 val; 449 + __le16 val_new, val_old; 450 450 int ret; 451 451 452 452 /* ··· 454 454 * Therefore we need to convert to little endian here to align with 455 455 * HW registers. 456 456 */ 457 - val = cpu_to_le16(ucontrol->value.integer.value[0]); 457 + val_new = cpu_to_le16(ucontrol->value.integer.value[0]); 458 458 459 459 mutex_lock(&da7219->ctrl_lock); 460 - ret = regmap_raw_write(da7219->regmap, reg, &val, sizeof(val)); 460 + ret = regmap_raw_read(da7219->regmap, reg, &val_old, sizeof(val_old)); 461 + if (ret == 0 && (val_old != val_new)) 462 + ret = regmap_raw_write(da7219->regmap, reg, 463 + &val_new, sizeof(val_new)); 461 464 mutex_unlock(&da7219->ctrl_lock); 462 465 463 - return ret; 466 + if (ret < 0) 467 + return ret; 468 + 469 + return val_old != val_new; 464 470 } 465 471 466 472
+10 -4
sound/soc/codecs/lpass-rx-macro.c
··· 3566 3566 return PTR_ERR(rx->pds); 3567 3567 3568 3568 base = devm_platform_ioremap_resource(pdev, 0); 3569 - if (IS_ERR(base)) 3570 - return PTR_ERR(base); 3569 + if (IS_ERR(base)) { 3570 + ret = PTR_ERR(base); 3571 + goto err; 3572 + } 3571 3573 3572 3574 rx->regmap = devm_regmap_init_mmio(dev, base, &rx_regmap_config); 3573 - if (IS_ERR(rx->regmap)) 3574 - return PTR_ERR(rx->regmap); 3575 + if (IS_ERR(rx->regmap)) { 3576 + ret = PTR_ERR(rx->regmap); 3577 + goto err; 3578 + } 3575 3579 3576 3580 dev_set_drvdata(dev, rx); 3577 3581 ··· 3636 3632 err_dcodec: 3637 3633 clk_disable_unprepare(rx->macro); 3638 3634 err: 3635 + lpass_macro_pds_exit(rx->pds); 3636 + 3639 3637 return ret; 3640 3638 } 3641 3639
+10 -4
sound/soc/codecs/lpass-tx-macro.c
··· 1828 1828 return PTR_ERR(tx->pds); 1829 1829 1830 1830 base = devm_platform_ioremap_resource(pdev, 0); 1831 - if (IS_ERR(base)) 1832 - return PTR_ERR(base); 1831 + if (IS_ERR(base)) { 1832 + ret = PTR_ERR(base); 1833 + goto err; 1834 + } 1833 1835 1834 1836 /* Update defaults for lpass sc7280 */ 1835 1837 if (of_device_is_compatible(np, "qcom,sc7280-lpass-tx-macro")) { ··· 1848 1846 } 1849 1847 1850 1848 tx->regmap = devm_regmap_init_mmio(dev, base, &tx_regmap_config); 1851 - if (IS_ERR(tx->regmap)) 1852 - return PTR_ERR(tx->regmap); 1849 + if (IS_ERR(tx->regmap)) { 1850 + ret = PTR_ERR(tx->regmap); 1851 + goto err; 1852 + } 1853 1853 1854 1854 dev_set_drvdata(dev, tx); 1855 1855 ··· 1911 1907 err_dcodec: 1912 1908 clk_disable_unprepare(tx->macro); 1913 1909 err: 1910 + lpass_macro_pds_exit(tx->pds); 1911 + 1914 1912 return ret; 1915 1913 } 1916 1914
+6 -2
sound/soc/codecs/lpass-va-macro.c
··· 1434 1434 va->dmic_clk_div = VA_MACRO_CLK_DIV_2; 1435 1435 } else { 1436 1436 ret = va_macro_validate_dmic_sample_rate(sample_rate, va); 1437 - if (!ret) 1438 - return -EINVAL; 1437 + if (!ret) { 1438 + ret = -EINVAL; 1439 + goto err; 1440 + } 1439 1441 } 1440 1442 1441 1443 base = devm_platform_ioremap_resource(pdev, 0); ··· 1494 1492 err_dcodec: 1495 1493 clk_disable_unprepare(va->macro); 1496 1494 err: 1495 + lpass_macro_pds_exit(va->pds); 1496 + 1497 1497 return ret; 1498 1498 } 1499 1499
+4 -1
sound/soc/codecs/max98090.c
··· 413 413 414 414 val = (val >> mc->shift) & mask; 415 415 416 + if (sel < 0 || sel > mc->max) 417 + return -EINVAL; 418 + 416 419 *select = sel; 417 420 418 421 /* Setting a volume is only valid if it is already On */ ··· 430 427 mask << mc->shift, 431 428 sel << mc->shift); 432 429 433 - return 0; 430 + return *select != val; 434 431 } 435 432 436 433 static const char *max98090_perf_pwr_text[] =
+8 -1
sound/soc/codecs/msm8916-wcd-digital.c
··· 1206 1206 1207 1207 dev_set_drvdata(dev, priv); 1208 1208 1209 - return devm_snd_soc_register_component(dev, &msm8916_wcd_digital, 1209 + ret = devm_snd_soc_register_component(dev, &msm8916_wcd_digital, 1210 1210 msm8916_wcd_digital_dai, 1211 1211 ARRAY_SIZE(msm8916_wcd_digital_dai)); 1212 + if (ret) 1213 + goto err_mclk; 1214 + 1215 + return 0; 1216 + 1217 + err_mclk: 1218 + clk_disable_unprepare(priv->mclk); 1212 1219 err_clk: 1213 1220 clk_disable_unprepare(priv->ahbclk); 1214 1221 return ret;
+1 -1
sound/soc/codecs/rk817_codec.c
··· 489 489 490 490 rk817_codec_parse_dt_property(&pdev->dev, rk817_codec_data); 491 491 492 - rk817_codec_data->mclk = clk_get(pdev->dev.parent, "mclk"); 492 + rk817_codec_data->mclk = devm_clk_get(pdev->dev.parent, "mclk"); 493 493 if (IS_ERR(rk817_codec_data->mclk)) { 494 494 dev_dbg(&pdev->dev, "Unable to get mclk\n"); 495 495 ret = -ENXIO;
+13 -7
sound/soc/codecs/rt5682.c
··· 1100 1100 return; 1101 1101 } 1102 1102 1103 + if (rt5682->is_sdw) { 1104 + if (pm_runtime_status_suspended(rt5682->slave->dev.parent)) { 1105 + dev_dbg(&rt5682->slave->dev, 1106 + "%s: parent device is pm_runtime_status_suspended, skipping jack detection\n", 1107 + __func__); 1108 + return; 1109 + } 1110 + } 1111 + 1103 1112 dapm = snd_soc_component_get_dapm(rt5682->component); 1104 1113 1105 1114 snd_soc_dapm_mutex_lock(dapm); ··· 2831 2822 2832 2823 for_each_component_dais(component, dai) 2833 2824 if (dai->id == RT5682_AIF1) 2834 - break; 2835 - if (!dai) { 2836 - dev_err(rt5682->i2c_dev, "dai %d not found in component\n", 2837 - RT5682_AIF1); 2838 - return -ENODEV; 2839 - } 2825 + return rt5682_set_bclk1_ratio(dai, factor); 2840 2826 2841 - return rt5682_set_bclk1_ratio(dai, factor); 2827 + dev_err(rt5682->i2c_dev, "dai %d not found in component\n", 2828 + RT5682_AIF1); 2829 + return -ENODEV; 2842 2830 } 2843 2831 2844 2832 static const struct clk_ops rt5682_dai_clk_ops[RT5682_DAI_NUM_CLKS] = {
+4 -7
sound/soc/codecs/rt5682s.c
··· 2687 2687 2688 2688 for_each_component_dais(component, dai) 2689 2689 if (dai->id == RT5682S_AIF1) 2690 - break; 2691 - if (!dai) { 2692 - dev_err(component->dev, "dai %d not found in component\n", 2693 - RT5682S_AIF1); 2694 - return -ENODEV; 2695 - } 2690 + return rt5682s_set_bclk1_ratio(dai, factor); 2696 2691 2697 - return rt5682s_set_bclk1_ratio(dai, factor); 2692 + dev_err(component->dev, "dai %d not found in component\n", 2693 + RT5682S_AIF1); 2694 + return -ENODEV; 2698 2695 } 2699 2696 2700 2697 static const struct clk_ops rt5682s_dai_clk_ops[RT5682S_DAI_NUM_CLKS] = {
+7
sound/soc/codecs/rt711.c
··· 245 245 if (!rt711->component->card->instantiated) 246 246 return; 247 247 248 + if (pm_runtime_status_suspended(rt711->slave->dev.parent)) { 249 + dev_dbg(&rt711->slave->dev, 250 + "%s: parent device is pm_runtime_status_suspended, skipping jack detection\n", 251 + __func__); 252 + return; 253 + } 254 + 248 255 reg = RT711_VERB_GET_PIN_SENSE | RT711_HP_OUT; 249 256 ret = regmap_read(rt711->regmap, reg, &jack_status); 250 257 if (ret < 0)
-1
sound/soc/codecs/rt9120.c
··· 341 341 { 342 342 switch (reg) { 343 343 case 0x00: 344 - case 0x09: 345 344 case 0x20 ... 0x27: 346 345 return 2; 347 346 case 0x30 ... 0x3D:
+1 -25
sound/soc/codecs/wcd934x.c
··· 1274 1274 if (sido_src == wcd->sido_input_src) 1275 1275 return 0; 1276 1276 1277 - if (sido_src == SIDO_SOURCE_INTERNAL) { 1278 - regmap_update_bits(wcd->regmap, WCD934X_ANA_BUCK_CTL, 1279 - WCD934X_ANA_BUCK_HI_ACCU_EN_MASK, 0); 1280 - usleep_range(100, 110); 1281 - regmap_update_bits(wcd->regmap, WCD934X_ANA_BUCK_CTL, 1282 - WCD934X_ANA_BUCK_HI_ACCU_PRE_ENX_MASK, 0x0); 1283 - usleep_range(100, 110); 1284 - regmap_update_bits(wcd->regmap, WCD934X_ANA_RCO, 1285 - WCD934X_ANA_RCO_BG_EN_MASK, 0); 1286 - usleep_range(100, 110); 1287 - regmap_update_bits(wcd->regmap, WCD934X_ANA_BUCK_CTL, 1288 - WCD934X_ANA_BUCK_PRE_EN1_MASK, 1289 - WCD934X_ANA_BUCK_PRE_EN1_ENABLE); 1290 - usleep_range(100, 110); 1291 - regmap_update_bits(wcd->regmap, WCD934X_ANA_BUCK_CTL, 1292 - WCD934X_ANA_BUCK_PRE_EN2_MASK, 1293 - WCD934X_ANA_BUCK_PRE_EN2_ENABLE); 1294 - usleep_range(100, 110); 1295 - regmap_update_bits(wcd->regmap, WCD934X_ANA_BUCK_CTL, 1296 - WCD934X_ANA_BUCK_HI_ACCU_EN_MASK, 1297 - WCD934X_ANA_BUCK_HI_ACCU_ENABLE); 1298 - usleep_range(100, 110); 1299 - } else if (sido_src == SIDO_SOURCE_RCO_BG) { 1277 + if (sido_src == SIDO_SOURCE_RCO_BG) { 1300 1278 regmap_update_bits(wcd->regmap, WCD934X_ANA_RCO, 1301 1279 WCD934X_ANA_RCO_BG_EN_MASK, 1302 1280 WCD934X_ANA_RCO_BG_ENABLE); ··· 1360 1382 regmap_update_bits(wcd->regmap, WCD934X_CLK_SYS_MCLK_PRG, 1361 1383 WCD934X_EXT_CLK_BUF_EN_MASK | 1362 1384 WCD934X_MCLK_EN_MASK, 0x0); 1363 - wcd934x_set_sido_input_src(wcd, SIDO_SOURCE_INTERNAL); 1364 - 1365 1385 regmap_update_bits(wcd->regmap, WCD934X_ANA_BIAS, 1366 1386 WCD934X_ANA_BIAS_EN_MASK, 0); 1367 1387 regmap_update_bits(wcd->regmap, WCD934X_ANA_BIAS,
+11 -8
sound/soc/codecs/wm8731.c
··· 602 602 ret = wm8731_reset(wm8731->regmap); 603 603 if (ret < 0) { 604 604 dev_err(dev, "Failed to issue reset: %d\n", ret); 605 - goto err_regulator_enable; 605 + goto err; 606 606 } 607 607 608 608 /* Clear POWEROFF, keep everything else disabled */ ··· 619 619 620 620 regcache_mark_dirty(wm8731->regmap); 621 621 622 - err_regulator_enable: 623 - /* Regulators will be enabled by bias management */ 624 - regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies), wm8731->supplies); 625 - 622 + err: 626 623 return ret; 627 624 } 628 625 ··· 757 760 ret = PTR_ERR(wm8731->regmap); 758 761 dev_err(&i2c->dev, "Failed to allocate register map: %d\n", 759 762 ret); 760 - return ret; 763 + goto err_regulator_enable; 761 764 } 762 765 763 766 ret = wm8731_hw_init(&i2c->dev, wm8731); 764 767 if (ret != 0) 765 - return ret; 768 + goto err_regulator_enable; 766 769 767 770 ret = devm_snd_soc_register_component(&i2c->dev, 768 771 &soc_component_dev_wm8731, &wm8731_dai, 1); 769 772 if (ret != 0) { 770 773 dev_err(&i2c->dev, "Failed to register CODEC: %d\n", ret); 771 - return ret; 774 + goto err_regulator_enable; 772 775 } 773 776 774 777 return 0; 778 + 779 + err_regulator_enable: 780 + /* Regulators will be enabled by bias management */ 781 + regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies), wm8731->supplies); 782 + 783 + return ret; 775 784 } 776 785 777 786 static const struct i2c_device_id wm8731_i2c_id[] = {
+4 -4
sound/soc/codecs/wm8958-dsp2.c
··· 530 530 531 531 wm8958_dsp_apply(component, mbc, wm8994->mbc_ena[mbc]); 532 532 533 - return 0; 533 + return 1; 534 534 } 535 535 536 536 #define WM8958_MBC_SWITCH(xname, xval) {\ ··· 656 656 657 657 wm8958_dsp_apply(component, vss, wm8994->vss_ena[vss]); 658 658 659 - return 0; 659 + return 1; 660 660 } 661 661 662 662 ··· 730 730 731 731 wm8958_dsp_apply(component, hpf % 3, ucontrol->value.integer.value[0]); 732 732 733 - return 0; 733 + return 1; 734 734 } 735 735 736 736 #define WM8958_HPF_SWITCH(xname, xval) {\ ··· 824 824 825 825 wm8958_dsp_apply(component, eq, ucontrol->value.integer.value[0]); 826 826 827 - return 0; 827 + return 1; 828 828 } 829 829 830 830 #define WM8958_ENH_EQ_SWITCH(xname, xval) {\
+5 -5
sound/soc/codecs/wm_adsp.c
··· 97 97 __be32 wdma[8]; 98 98 __be32 build_job_name[3]; 99 99 __be32 build_job_number; 100 - }; 100 + } __packed; 101 101 102 102 struct wm_halo_system_config_xm_hdr { 103 103 __be32 halo_heartbeat; 104 104 __be32 build_job_name[3]; 105 105 __be32 build_job_number; 106 - }; 106 + } __packed; 107 107 108 108 struct wm_adsp_alg_xm_struct { 109 109 __be32 magic; ··· 114 114 __be32 high_water_mark; 115 115 __be32 low_water_mark; 116 116 __be64 smoothed_power; 117 - }; 117 + } __packed; 118 118 119 119 struct wm_adsp_host_buf_coeff_v1 { 120 120 __be32 host_buf_ptr; /* Host buffer pointer */ 121 121 __be32 versions; /* Version numbers */ 122 122 __be32 name[4]; /* The buffer name */ 123 - }; 123 + } __packed; 124 124 125 125 struct wm_adsp_buffer { 126 126 __be32 buf1_base; /* Base addr of first buffer area */ ··· 141 141 __be32 min_free; /* min free space since stream start */ 142 142 __be32 blocks_written[2]; /* total blocks written (64 bit) */ 143 143 __be32 words_written[2]; /* total words written (64 bit) */ 144 - }; 144 + } __packed; 145 145 146 146 struct wm_adsp_compr; 147 147
+1 -1
sound/soc/fsl/fsl_sai.c
··· 372 372 continue; 373 373 if (ratio == 1 && !support_1_1_ratio) 374 374 continue; 375 - else if (ratio & 1) 375 + if ((ratio & 1) && ratio > 1) 376 376 continue; 377 377 378 378 diff = abs((long)clk_rate - ratio * freq);
+5 -3
sound/soc/generic/simple-card-utils.c
··· 322 322 323 323 if (props->mclk_fs && !dai->clk_fixed && !snd_soc_dai_active(cpu_dai)) 324 324 snd_soc_dai_set_sysclk(cpu_dai, 325 - 0, 0, SND_SOC_CLOCK_IN); 325 + 0, 0, SND_SOC_CLOCK_OUT); 326 326 327 327 asoc_simple_clk_disable(dai); 328 328 } ··· 364 364 struct snd_pcm_hw_params *params) 365 365 { 366 366 int sample_bits = params_width(params); 367 - int slot_width = simple_dai->slot_width; 368 - int slot_count = simple_dai->slots; 367 + int slot_width, slot_count; 369 368 int i, ret; 370 369 371 370 if (!simple_dai || !simple_dai->tdm_width_map) 372 371 return 0; 372 + 373 + slot_width = simple_dai->slot_width; 374 + slot_count = simple_dai->slots; 373 375 374 376 if (slot_width == 0) 375 377 slot_width = sample_bits;
+90 -29
sound/soc/intel/boards/sof_es8336.c
··· 27 27 #define SOF_ES8336_SSP_CODEC(quirk) ((quirk) & GENMASK(3, 0)) 28 28 #define SOF_ES8336_SSP_CODEC_MASK (GENMASK(3, 0)) 29 29 30 - #define SOF_ES8336_TGL_GPIO_QUIRK BIT(4) 30 + #define SOF_ES8336_SPEAKERS_EN_GPIO1_QUIRK BIT(4) 31 31 #define SOF_ES8336_ENABLE_DMIC BIT(5) 32 32 #define SOF_ES8336_JD_INVERTED BIT(6) 33 + #define SOF_ES8336_HEADPHONE_GPIO BIT(7) 34 + #define SOC_ES8336_HEADSET_MIC1 BIT(8) 33 35 34 36 static unsigned long quirk; 35 37 ··· 41 39 42 40 struct sof_es8336_private { 43 41 struct device *codec_dev; 44 - struct gpio_desc *gpio_pa; 42 + struct gpio_desc *gpio_speakers, *gpio_headphone; 45 43 struct snd_soc_jack jack; 46 44 struct list_head hdmi_pcm_list; 47 45 bool speaker_en; ··· 53 51 int device; 54 52 }; 55 53 56 - static const struct acpi_gpio_params pa_enable_gpio = { 0, 0, true }; 57 - static const struct acpi_gpio_mapping acpi_es8336_gpios[] = { 58 - { "pa-enable-gpios", &pa_enable_gpio, 1 }, 54 + static const struct acpi_gpio_params enable_gpio0 = { 0, 0, true }; 55 + static const struct acpi_gpio_params enable_gpio1 = { 1, 0, true }; 56 + 57 + static const struct acpi_gpio_mapping acpi_speakers_enable_gpio0[] = { 58 + { "speakers-enable-gpios", &enable_gpio0, 1 }, 59 59 { } 60 60 }; 61 61 62 - static const struct acpi_gpio_params quirk_pa_enable_gpio = { 1, 0, true }; 63 - static const struct acpi_gpio_mapping quirk_acpi_es8336_gpios[] = { 64 - { "pa-enable-gpios", &quirk_pa_enable_gpio, 1 }, 62 + static const struct acpi_gpio_mapping acpi_speakers_enable_gpio1[] = { 63 + { "speakers-enable-gpios", &enable_gpio1, 1 }, 64 + }; 65 + 66 + static const struct acpi_gpio_mapping acpi_enable_both_gpios[] = { 67 + { "speakers-enable-gpios", &enable_gpio0, 1 }, 68 + { "headphone-enable-gpios", &enable_gpio1, 1 }, 65 69 { } 66 70 }; 67 71 68 - static const struct acpi_gpio_mapping *gpio_mapping = acpi_es8336_gpios; 72 + static const struct acpi_gpio_mapping acpi_enable_both_gpios_rev_order[] = { 73 + { "speakers-enable-gpios", &enable_gpio1, 1 }, 74 + { "headphone-enable-gpios", &enable_gpio0, 1 }, 75 + { } 76 + }; 77 + 78 + static const struct acpi_gpio_mapping *gpio_mapping = acpi_speakers_enable_gpio0; 69 79 70 80 static void log_quirks(struct device *dev) 71 81 { ··· 85 71 dev_info(dev, "quirk SSP%ld\n", SOF_ES8336_SSP_CODEC(quirk)); 86 72 if (quirk & SOF_ES8336_ENABLE_DMIC) 87 73 dev_info(dev, "quirk DMIC enabled\n"); 88 - if (quirk & SOF_ES8336_TGL_GPIO_QUIRK) 89 - dev_info(dev, "quirk TGL GPIO enabled\n"); 74 + if (quirk & SOF_ES8336_SPEAKERS_EN_GPIO1_QUIRK) 75 + dev_info(dev, "Speakers GPIO1 quirk enabled\n"); 76 + if (quirk & SOF_ES8336_HEADPHONE_GPIO) 77 + dev_info(dev, "quirk headphone GPIO enabled\n"); 90 78 if (quirk & SOF_ES8336_JD_INVERTED) 91 79 dev_info(dev, "quirk JD inverted enabled\n"); 80 + if (quirk & SOC_ES8336_HEADSET_MIC1) 81 + dev_info(dev, "quirk headset at mic1 port enabled\n"); 92 82 } 93 83 94 84 static int sof_es8316_speaker_power_event(struct snd_soc_dapm_widget *w, ··· 101 83 struct snd_soc_card *card = w->dapm->card; 102 84 struct sof_es8336_private *priv = snd_soc_card_get_drvdata(card); 103 85 104 - if (SND_SOC_DAPM_EVENT_ON(event)) 105 - priv->speaker_en = false; 106 - else 107 - priv->speaker_en = true; 86 + if (priv->speaker_en == !SND_SOC_DAPM_EVENT_ON(event)) 87 + return 0; 108 88 109 - gpiod_set_value_cansleep(priv->gpio_pa, priv->speaker_en); 89 + priv->speaker_en = !SND_SOC_DAPM_EVENT_ON(event); 90 + 91 + if (SND_SOC_DAPM_EVENT_ON(event)) 92 + msleep(70); 93 + 94 + gpiod_set_value_cansleep(priv->gpio_speakers, priv->speaker_en); 95 + 96 + if (!(quirk & SOF_ES8336_HEADPHONE_GPIO)) 97 + return 0; 98 + 99 + if (SND_SOC_DAPM_EVENT_ON(event)) 100 + msleep(70); 101 + 102 + gpiod_set_value_cansleep(priv->gpio_headphone, priv->speaker_en); 110 103 111 104 return 0; 112 105 } ··· 143 114 144 115 /* 145 116 * There is no separate speaker output instead the speakers are muxed to 146 - * the HP outputs. The mux is controlled by the "Speaker Power" supply. 117 + * the HP outputs. The mux is controlled Speaker and/or headphone switch. 147 118 */ 148 119 {"Speaker", NULL, "HPOL"}, 149 120 {"Speaker", NULL, "HPOR"}, 150 121 {"Speaker", NULL, "Speaker Power"}, 151 122 }; 152 123 153 - static const struct snd_soc_dapm_route sof_es8316_intmic_in1_map[] = { 124 + static const struct snd_soc_dapm_route sof_es8316_headset_mic2_map[] = { 154 125 {"MIC1", NULL, "Internal Mic"}, 155 126 {"MIC2", NULL, "Headset Mic"}, 127 + }; 128 + 129 + static const struct snd_soc_dapm_route sof_es8316_headset_mic1_map[] = { 130 + {"MIC2", NULL, "Internal Mic"}, 131 + {"MIC1", NULL, "Headset Mic"}, 156 132 }; 157 133 158 134 static const struct snd_soc_dapm_route dmic_map[] = { ··· 233 199 234 200 card->dapm.idle_bias_off = true; 235 201 236 - custom_map = sof_es8316_intmic_in1_map; 237 - num_routes = ARRAY_SIZE(sof_es8316_intmic_in1_map); 202 + if (quirk & SOC_ES8336_HEADSET_MIC1) { 203 + custom_map = sof_es8316_headset_mic1_map; 204 + num_routes = ARRAY_SIZE(sof_es8316_headset_mic1_map); 205 + } else { 206 + custom_map = sof_es8316_headset_mic2_map; 207 + num_routes = ARRAY_SIZE(sof_es8316_headset_mic2_map); 208 + } 238 209 239 210 ret = snd_soc_dapm_add_routes(&card->dapm, custom_map, num_routes); 240 211 if (ret) ··· 272 233 { 273 234 quirk = (unsigned long)id->driver_data; 274 235 275 - if (quirk & SOF_ES8336_TGL_GPIO_QUIRK) 276 - gpio_mapping = quirk_acpi_es8336_gpios; 236 + if (quirk & SOF_ES8336_HEADPHONE_GPIO) { 237 + if (quirk & SOF_ES8336_SPEAKERS_EN_GPIO1_QUIRK) 238 + gpio_mapping = acpi_enable_both_gpios; 239 + else 240 + gpio_mapping = acpi_enable_both_gpios_rev_order; 241 + } else if (quirk & SOF_ES8336_SPEAKERS_EN_GPIO1_QUIRK) { 242 + gpio_mapping = acpi_speakers_enable_gpio1; 243 + } 277 244 278 245 return 1; 279 246 } ··· 302 257 DMI_MATCH(DMI_SYS_VENDOR, "IP3 tech"), 303 258 DMI_MATCH(DMI_BOARD_NAME, "WN1"), 304 259 }, 305 - .driver_data = (void *)(SOF_ES8336_TGL_GPIO_QUIRK) 260 + .driver_data = (void *)(SOF_ES8336_SPEAKERS_EN_GPIO1_QUIRK) 261 + }, 262 + { 263 + .callback = sof_es8336_quirk_cb, 264 + .matches = { 265 + DMI_MATCH(DMI_SYS_VENDOR, "HUAWEI"), 266 + DMI_MATCH(DMI_BOARD_NAME, "BOHB-WAX9-PCB-B2"), 267 + }, 268 + .driver_data = (void *)(SOF_ES8336_HEADPHONE_GPIO | 269 + SOC_ES8336_HEADSET_MIC1) 306 270 }, 307 271 {} 308 272 }; ··· 639 585 if (ret) 640 586 dev_warn(codec_dev, "unable to add GPIO mapping table\n"); 641 587 642 - priv->gpio_pa = gpiod_get_optional(codec_dev, "pa-enable", GPIOD_OUT_LOW); 643 - if (IS_ERR(priv->gpio_pa)) { 644 - ret = dev_err_probe(dev, PTR_ERR(priv->gpio_pa), 645 - "could not get pa-enable GPIO\n"); 588 + priv->gpio_speakers = gpiod_get_optional(codec_dev, "speakers-enable", GPIOD_OUT_LOW); 589 + if (IS_ERR(priv->gpio_speakers)) { 590 + ret = dev_err_probe(dev, PTR_ERR(priv->gpio_speakers), 591 + "could not get speakers-enable GPIO\n"); 592 + goto err_put_codec; 593 + } 594 + 595 + priv->gpio_headphone = gpiod_get_optional(codec_dev, "headphone-enable", GPIOD_OUT_LOW); 596 + if (IS_ERR(priv->gpio_headphone)) { 597 + ret = dev_err_probe(dev, PTR_ERR(priv->gpio_headphone), 598 + "could not get headphone-enable GPIO\n"); 646 599 goto err_put_codec; 647 600 } 648 601 ··· 665 604 666 605 ret = devm_snd_soc_register_card(dev, card); 667 606 if (ret) { 668 - gpiod_put(priv->gpio_pa); 607 + gpiod_put(priv->gpio_speakers); 669 608 dev_err(dev, "snd_soc_register_card failed: %d\n", ret); 670 609 goto err_put_codec; 671 610 } ··· 683 622 struct snd_soc_card *card = platform_get_drvdata(pdev); 684 623 struct sof_es8336_private *priv = snd_soc_card_get_drvdata(card); 685 624 686 - gpiod_put(priv->gpio_pa); 625 + gpiod_put(priv->gpio_speakers); 687 626 device_remove_software_node(priv->codec_dev); 688 627 put_device(priv->codec_dev); 689 628
+13
sound/soc/intel/boards/sof_rt5682.c
··· 212 212 SOF_SSP_BT_OFFLOAD_PRESENT), 213 213 214 214 }, 215 + { 216 + .callback = sof_rt5682_quirk_cb, 217 + .matches = { 218 + DMI_MATCH(DMI_PRODUCT_FAMILY, "Google_Brya"), 219 + DMI_MATCH(DMI_OEM_STRING, "AUDIO-MAX98360_ALC5682I_I2S_AMP_SSP2"), 220 + }, 221 + .driver_data = (void *)(SOF_RT5682_MCLK_EN | 222 + SOF_RT5682_SSP_CODEC(0) | 223 + SOF_SPEAKER_AMP_PRESENT | 224 + SOF_MAX98360A_SPEAKER_AMP_PRESENT | 225 + SOF_RT5682_SSP_AMP(2) | 226 + SOF_RT5682_NUM_HDMIDEV(4)), 227 + }, 215 228 {} 216 229 }; 217 230
+2 -2
sound/soc/intel/common/soc-acpi-intel-tgl-match.c
··· 132 132 { 133 133 .adr = 0x000123019F837300ull, 134 134 .num_endpoints = 1, 135 - .endpoints = &spk_l_endpoint, 135 + .endpoints = &spk_r_endpoint, 136 136 .name_prefix = "Right" 137 137 }, 138 138 { 139 139 .adr = 0x000127019F837300ull, 140 140 .num_endpoints = 1, 141 - .endpoints = &spk_r_endpoint, 141 + .endpoints = &spk_l_endpoint, 142 142 .name_prefix = "Left" 143 143 } 144 144 };
+4 -1
sound/soc/meson/aiu-acodec-ctrl.c
··· 58 58 59 59 snd_soc_dapm_mux_update_power(dapm, kcontrol, mux, e, NULL); 60 60 61 - return 0; 61 + return 1; 62 62 } 63 63 64 64 static SOC_ENUM_SINGLE_DECL(aiu_acodec_ctrl_mux_enum, AIU_ACODEC_CTRL, ··· 193 193 .of_xlate_dai_name = aiu_acodec_of_xlate_dai_name, 194 194 .endianness = 1, 195 195 .non_legacy_dai_naming = 1, 196 + #ifdef CONFIG_DEBUG_FS 197 + .debugfs_prefix = "acodec", 198 + #endif 196 199 }; 197 200 198 201 int aiu_acodec_ctrl_register_component(struct device *dev)
+4 -1
sound/soc/meson/aiu-codec-ctrl.c
··· 57 57 58 58 snd_soc_dapm_mux_update_power(dapm, kcontrol, mux, e, NULL); 59 59 60 - return 0; 60 + return 1; 61 61 } 62 62 63 63 static SOC_ENUM_SINGLE_DECL(aiu_hdmi_ctrl_mux_enum, AIU_HDMI_CLK_DATA_CTRL, ··· 140 140 .of_xlate_dai_name = aiu_hdmi_of_xlate_dai_name, 141 141 .endianness = 1, 142 142 .non_legacy_dai_naming = 1, 143 + #ifdef CONFIG_DEBUG_FS 144 + .debugfs_prefix = "hdmi", 145 + #endif 143 146 }; 144 147 145 148 int aiu_hdmi_ctrl_register_component(struct device *dev)
+3
sound/soc/meson/aiu.c
··· 103 103 .pointer = aiu_fifo_pointer, 104 104 .probe = aiu_cpu_component_probe, 105 105 .remove = aiu_cpu_component_remove, 106 + #ifdef CONFIG_DEBUG_FS 107 + .debugfs_prefix = "cpu", 108 + #endif 106 109 }; 107 110 108 111 static struct snd_soc_dai_driver aiu_cpu_dai_drv[] = {
-1
sound/soc/meson/axg-card.c
··· 320 320 321 321 dai_link->cpus = cpu; 322 322 dai_link->num_cpus = 1; 323 - dai_link->nonatomic = true; 324 323 325 324 ret = meson_card_parse_dai(card, np, &dai_link->cpus->of_node, 326 325 &dai_link->cpus->dai_name);
+5 -21
sound/soc/meson/axg-tdm-interface.c
··· 351 351 return 0; 352 352 } 353 353 354 - static int axg_tdm_iface_trigger(struct snd_pcm_substream *substream, 355 - int cmd, 354 + static int axg_tdm_iface_prepare(struct snd_pcm_substream *substream, 356 355 struct snd_soc_dai *dai) 357 356 { 358 - struct axg_tdm_stream *ts = 359 - snd_soc_dai_get_dma_data(dai, substream); 357 + struct axg_tdm_stream *ts = snd_soc_dai_get_dma_data(dai, substream); 360 358 361 - switch (cmd) { 362 - case SNDRV_PCM_TRIGGER_START: 363 - case SNDRV_PCM_TRIGGER_RESUME: 364 - case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 365 - axg_tdm_stream_start(ts); 366 - break; 367 - case SNDRV_PCM_TRIGGER_SUSPEND: 368 - case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 369 - case SNDRV_PCM_TRIGGER_STOP: 370 - axg_tdm_stream_stop(ts); 371 - break; 372 - default: 373 - return -EINVAL; 374 - } 375 - 376 - return 0; 359 + /* Force all attached formatters to update */ 360 + return axg_tdm_stream_reset(ts); 377 361 } 378 362 379 363 static int axg_tdm_iface_remove_dai(struct snd_soc_dai *dai) ··· 397 413 .set_fmt = axg_tdm_iface_set_fmt, 398 414 .startup = axg_tdm_iface_startup, 399 415 .hw_params = axg_tdm_iface_hw_params, 416 + .prepare = axg_tdm_iface_prepare, 400 417 .hw_free = axg_tdm_iface_hw_free, 401 - .trigger = axg_tdm_iface_trigger, 402 418 }; 403 419 404 420 /* TDM Backend DAIs */
+1 -1
sound/soc/meson/g12a-tohdmitx.c
··· 67 67 68 68 snd_soc_dapm_mux_update_power(dapm, kcontrol, mux, e, NULL); 69 69 70 - return 0; 70 + return 1; 71 71 } 72 72 73 73 static SOC_ENUM_SINGLE_DECL(g12a_tohdmitx_i2s_mux_enum, TOHDMITX_CTRL0,
+5
sound/soc/soc-core.c
··· 2587 2587 component->dev = dev; 2588 2588 component->driver = driver; 2589 2589 2590 + #ifdef CONFIG_DEBUG_FS 2591 + if (!component->debugfs_prefix) 2592 + component->debugfs_prefix = driver->debugfs_prefix; 2593 + #endif 2594 + 2590 2595 return 0; 2591 2596 } 2592 2597 EXPORT_SYMBOL_GPL(snd_soc_component_initialize);
+2 -4
sound/soc/soc-dapm.c
··· 1687 1687 switch (w->id) { 1688 1688 case snd_soc_dapm_pre: 1689 1689 if (!w->event) 1690 - list_for_each_entry_safe_continue(w, n, list, 1691 - power_list); 1690 + continue; 1692 1691 1693 1692 if (event == SND_SOC_DAPM_STREAM_START) 1694 1693 ret = w->event(w, ··· 1699 1700 1700 1701 case snd_soc_dapm_post: 1701 1702 if (!w->event) 1702 - list_for_each_entry_safe_continue(w, n, list, 1703 - power_list); 1703 + continue; 1704 1704 1705 1705 if (event == SND_SOC_DAPM_STREAM_START) 1706 1706 ret = w->event(w,
+3 -3
sound/soc/soc-generic-dmaengine-pcm.c
··· 86 86 87 87 memset(&slave_config, 0, sizeof(slave_config)); 88 88 89 - if (pcm->config && pcm->config->prepare_slave_config) 90 - prepare_slave_config = pcm->config->prepare_slave_config; 91 - else 89 + if (!pcm->config) 92 90 prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config; 91 + else 92 + prepare_slave_config = pcm->config->prepare_slave_config; 93 93 94 94 if (prepare_slave_config) { 95 95 int ret = prepare_slave_config(substream, params, &slave_config);
+18 -2
sound/soc/soc-ops.c
··· 461 461 ret = err; 462 462 } 463 463 } 464 - return err; 464 + return ret; 465 465 } 466 466 EXPORT_SYMBOL_GPL(snd_soc_put_volsw_sx); 467 467 ··· 519 519 unsigned int mask = (1 << fls(max)) - 1; 520 520 unsigned int invert = mc->invert; 521 521 unsigned int val, val_mask; 522 - int err, ret; 522 + int err, ret, tmp; 523 + 524 + tmp = ucontrol->value.integer.value[0]; 525 + if (tmp < 0) 526 + return -EINVAL; 527 + if (mc->platform_max && tmp > mc->platform_max) 528 + return -EINVAL; 529 + if (tmp > mc->max - mc->min + 1) 530 + return -EINVAL; 523 531 524 532 if (invert) 525 533 val = (max - ucontrol->value.integer.value[0]) & mask; ··· 542 534 ret = err; 543 535 544 536 if (snd_soc_volsw_is_stereo(mc)) { 537 + tmp = ucontrol->value.integer.value[1]; 538 + if (tmp < 0) 539 + return -EINVAL; 540 + if (mc->platform_max && tmp > mc->platform_max) 541 + return -EINVAL; 542 + if (tmp > mc->max - mc->min + 1) 543 + return -EINVAL; 544 + 545 545 if (invert) 546 546 val = (max - ucontrol->value.integer.value[1]) & mask; 547 547 else
+1 -1
sound/soc/soc-pcm.c
··· 1214 1214 be_substream->pcm->nonatomic = 1; 1215 1215 } 1216 1216 1217 - dpcm = kzalloc(sizeof(struct snd_soc_dpcm), GFP_ATOMIC); 1217 + dpcm = kzalloc(sizeof(struct snd_soc_dpcm), GFP_KERNEL); 1218 1218 if (!dpcm) 1219 1219 return -ENOMEM; 1220 1220
+2 -2
sound/soc/soc-topology.c
··· 1436 1436 template.num_kcontrols = le32_to_cpu(w->num_kcontrols); 1437 1437 kc = devm_kcalloc(tplg->dev, le32_to_cpu(w->num_kcontrols), sizeof(*kc), GFP_KERNEL); 1438 1438 if (!kc) 1439 - goto err; 1439 + goto hdr_err; 1440 1440 1441 1441 kcontrol_type = devm_kcalloc(tplg->dev, le32_to_cpu(w->num_kcontrols), sizeof(unsigned int), 1442 1442 GFP_KERNEL); 1443 1443 if (!kcontrol_type) 1444 - goto err; 1444 + goto hdr_err; 1445 1445 1446 1446 for (i = 0; i < le32_to_cpu(w->num_kcontrols); i++) { 1447 1447 control_hdr = (struct snd_soc_tplg_ctl_hdr *)tplg->pos;
+13 -1
sound/soc/sof/sof-pci-dev.c
··· 83 83 }, 84 84 .driver_data = "sof-adl-max98357a-rt5682-2way.tplg", 85 85 }, 86 - 86 + { 87 + .callback = sof_tplg_cb, 88 + .matches = { 89 + DMI_MATCH(DMI_PRODUCT_FAMILY, "Google_Brya"), 90 + DMI_MATCH(DMI_OEM_STRING, "AUDIO-MAX98360_ALC5682I_I2S_AMP_SSP2"), 91 + }, 92 + .driver_data = "sof-adl-max98357a-rt5682.tplg", 93 + }, 87 94 {} 88 95 }; 89 96 ··· 152 145 int ret; 153 146 154 147 dev_dbg(&pci->dev, "PCI DSP detected"); 148 + 149 + if (!desc) { 150 + dev_err(dev, "error: no matching PCI descriptor\n"); 151 + return -ENODEV; 152 + } 155 153 156 154 if (!desc->ops) { 157 155 dev_err(dev, "error: no matching PCI descriptor ops\n");
+49 -1
sound/soc/sof/topology.c
··· 904 904 return -ENOMEM; 905 905 906 906 scontrol->name = kstrdup(hdr->name, GFP_KERNEL); 907 - if (!scontrol->name) 907 + if (!scontrol->name) { 908 + kfree(scontrol); 908 909 return -ENOMEM; 910 + } 909 911 910 912 scontrol->scomp = scomp; 911 913 scontrol->access = kc->access; ··· 943 941 default: 944 942 dev_warn(scomp->dev, "control type not supported %d:%d:%d\n", 945 943 hdr->ops.get, hdr->ops.put, hdr->ops.info); 944 + kfree(scontrol->name); 946 945 kfree(scontrol); 947 946 return 0; 948 947 } 949 948 950 949 if (ret < 0) { 950 + kfree(scontrol->name); 951 951 kfree(scontrol); 952 952 return ret; 953 953 } ··· 1070 1066 } 1071 1067 1072 1068 return 0; 1069 + } 1070 + 1071 + static void sof_disconnect_dai_widget(struct snd_soc_component *scomp, 1072 + struct snd_soc_dapm_widget *w) 1073 + { 1074 + struct snd_soc_card *card = scomp->card; 1075 + struct snd_soc_pcm_runtime *rtd; 1076 + struct snd_soc_dai *cpu_dai; 1077 + int i; 1078 + 1079 + if (!w->sname) 1080 + return; 1081 + 1082 + list_for_each_entry(rtd, &card->rtd_list, list) { 1083 + /* does stream match DAI link ? */ 1084 + if (!rtd->dai_link->stream_name || 1085 + strcmp(w->sname, rtd->dai_link->stream_name)) 1086 + continue; 1087 + 1088 + switch (w->id) { 1089 + case snd_soc_dapm_dai_out: 1090 + for_each_rtd_cpu_dais(rtd, i, cpu_dai) { 1091 + if (cpu_dai->capture_widget == w) { 1092 + cpu_dai->capture_widget = NULL; 1093 + break; 1094 + } 1095 + } 1096 + break; 1097 + case snd_soc_dapm_dai_in: 1098 + for_each_rtd_cpu_dais(rtd, i, cpu_dai) { 1099 + if (cpu_dai->playback_widget == w) { 1100 + cpu_dai->playback_widget = NULL; 1101 + break; 1102 + } 1103 + } 1104 + break; 1105 + default: 1106 + break; 1107 + } 1108 + } 1073 1109 } 1074 1110 1075 1111 /* bind PCM ID to host component ID */ ··· 1397 1353 1398 1354 if (dai) 1399 1355 list_del(&dai->list); 1356 + 1357 + sof_disconnect_dai_widget(scomp, widget); 1358 + 1400 1359 break; 1401 1360 default: 1402 1361 break; ··· 1427 1380 } 1428 1381 kfree(scontrol->ipc_control_data); 1429 1382 list_del(&scontrol->list); 1383 + kfree(scontrol->name); 1430 1384 kfree(scontrol); 1431 1385 } 1432 1386
+7
sound/usb/clock.c
··· 572 572 /* continue processing */ 573 573 } 574 574 575 + /* FIXME - TEAC devices require the immediate interface setup */ 576 + if (rate != prev_rate && USB_ID_VENDOR(chip->usb_id) == 0x0644) { 577 + usb_set_interface(chip->dev, fmt->iface, fmt->altsetting); 578 + if (chip->quirk_flags & QUIRK_FLAG_IFACE_DELAY) 579 + msleep(50); 580 + } 581 + 575 582 validation: 576 583 /* validate clock after rate change */ 577 584 if (!uac_clock_source_is_valid(chip, fmt, clock))
+1
sound/usb/midi.c
··· 1194 1194 } while (drain_urbs && timeout); 1195 1195 finish_wait(&ep->drain_wait, &wait); 1196 1196 } 1197 + port->active = 0; 1197 1198 spin_unlock_irq(&ep->buffer_lock); 1198 1199 } 1199 1200
+4
sound/usb/mixer_maps.c
··· 599 599 .id = USB_ID(0x0db0, 0x419c), 600 600 .map = msi_mpg_x570s_carbon_max_wifi_alc4080_map, 601 601 }, 602 + { /* MSI MAG X570S Torpedo Max */ 603 + .id = USB_ID(0x0db0, 0xa073), 604 + .map = msi_mpg_x570s_carbon_max_wifi_alc4080_map, 605 + }, 602 606 { /* MSI TRX40 */ 603 607 .id = USB_ID(0x0db0, 0x543d), 604 608 .map = trx40_mobo_map,
+12
sound/usb/quirks-table.h
··· 2672 2672 .altset_idx = 1, 2673 2673 .attributes = 0, 2674 2674 .endpoint = 0x82, 2675 + .ep_idx = 1, 2675 2676 .ep_attr = USB_ENDPOINT_XFER_ISOC, 2676 2677 .datainterval = 1, 2677 2678 .maxpacksize = 0x0126, ··· 2876 2875 .altset_idx = 1, 2877 2876 .attributes = 0x4, 2878 2877 .endpoint = 0x81, 2878 + .ep_idx = 1, 2879 2879 .ep_attr = USB_ENDPOINT_XFER_ISOC | 2880 2880 USB_ENDPOINT_SYNC_ASYNC, 2881 2881 .maxpacksize = 0x130, ··· 3237 3235 } 3238 3236 }, 3239 3237 3238 + /* Rane SL-1 */ 3239 + { 3240 + USB_DEVICE(0x13e5, 0x0001), 3241 + .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { 3242 + .ifnum = QUIRK_ANY_INTERFACE, 3243 + .type = QUIRK_AUDIO_STANDARD_INTERFACE 3244 + } 3245 + }, 3246 + 3240 3247 /* disabled due to regression for other devices; 3241 3248 * see https://bugzilla.kernel.org/show_bug.cgi?id=199905 3242 3249 */ ··· 3393 3382 .altset_idx = 1, 3394 3383 .attributes = 0, 3395 3384 .endpoint = 0x03, 3385 + .ep_idx = 1, 3396 3386 .rates = SNDRV_PCM_RATE_96000, 3397 3387 .ep_attr = USB_ENDPOINT_XFER_ISOC | 3398 3388 USB_ENDPOINT_SYNC_ASYNC,
+2
sound/usb/quirks.c
··· 1824 1824 QUIRK_FLAG_IGNORE_CTL_ERROR), 1825 1825 DEVICE_FLG(0x06f8, 0xd002, /* Hercules DJ Console (Macintosh Edition) */ 1826 1826 QUIRK_FLAG_IGNORE_CTL_ERROR), 1827 + DEVICE_FLG(0x0711, 0x5800, /* MCT Trigger 5 USB-to-HDMI */ 1828 + QUIRK_FLAG_GET_SAMPLE_RATE), 1827 1829 DEVICE_FLG(0x074d, 0x3553, /* Outlaw RR2150 (Micronas UAC3553B) */ 1828 1830 QUIRK_FLAG_GET_SAMPLE_RATE), 1829 1831 DEVICE_FLG(0x0763, 0x2030, /* M-Audio Fast Track C400 */