History

Merge branch 'for-linus' into for-next

Merge for 5.18-rc1

Takashi Iwai committed 4 years ago

Commit 1212fa12 parents 03a8b0d 7b0efea57 files · +492 −263Browse files

Unified · Split

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