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

+367 -207
+1 -1
include/sound/soc-dai.h
··· 81 81 #define SND_SOC_DAIFMT_CBP_CFP (1 << 12) /* codec clk provider & frame provider */ 82 82 #define SND_SOC_DAIFMT_CBC_CFP (2 << 12) /* codec clk consumer & frame provider */ 83 83 #define SND_SOC_DAIFMT_CBP_CFC (3 << 12) /* codec clk provider & frame consumer */ 84 - #define SND_SOC_DAIFMT_CBC_CFC (4 << 12) /* codec clk consumer & frame follower */ 84 + #define SND_SOC_DAIFMT_CBC_CFC (4 << 12) /* codec clk consumer & frame consumer */ 85 85 86 86 /* previous definitions kept for backwards-compatibility, do not use in new contributions */ 87 87 #define SND_SOC_DAIFMT_CBM_CFM SND_SOC_DAIFMT_CBP_CFP
+26 -7
sound/core/control_led.c
··· 17 17 #define MAX_LED (((SNDRV_CTL_ELEM_ACCESS_MIC_LED - SNDRV_CTL_ELEM_ACCESS_SPK_LED) \ 18 18 >> SNDRV_CTL_ELEM_ACCESS_LED_SHIFT) + 1) 19 19 20 + #define to_led_card_dev(_dev) \ 21 + container_of(_dev, struct snd_ctl_led_card, dev) 22 + 20 23 enum snd_ctl_led_mode { 21 24 MODE_FOLLOW_MUTE = 0, 22 25 MODE_FOLLOW_ROUTE, ··· 374 371 snd_ctl_led_refresh(); 375 372 } 376 373 374 + static void snd_ctl_led_card_release(struct device *dev) 375 + { 376 + struct snd_ctl_led_card *led_card = to_led_card_dev(dev); 377 + 378 + kfree(led_card); 379 + } 380 + 381 + static void snd_ctl_led_release(struct device *dev) 382 + { 383 + } 384 + 385 + static void snd_ctl_led_dev_release(struct device *dev) 386 + { 387 + } 388 + 377 389 /* 378 390 * sysfs 379 391 */ ··· 685 667 led_card->number = card->number; 686 668 led_card->led = led; 687 669 device_initialize(&led_card->dev); 670 + led_card->dev.release = snd_ctl_led_card_release; 688 671 if (dev_set_name(&led_card->dev, "card%d", card->number) < 0) 689 672 goto cerr; 690 673 led_card->dev.parent = &led->dev; ··· 704 685 put_device(&led_card->dev); 705 686 cerr2: 706 687 printk(KERN_ERR "snd_ctl_led: unable to add card%d", card->number); 707 - kfree(led_card); 708 688 } 709 689 } 710 690 ··· 722 704 snprintf(link_name, sizeof(link_name), "led-%s", led->name); 723 705 sysfs_remove_link(&card->ctl_dev.kobj, link_name); 724 706 sysfs_remove_link(&led_card->dev.kobj, "card"); 725 - device_del(&led_card->dev); 726 - kfree(led_card); 707 + device_unregister(&led_card->dev); 727 708 led->cards[card->number] = NULL; 728 709 } 729 710 } ··· 744 727 745 728 device_initialize(&snd_ctl_led_dev); 746 729 snd_ctl_led_dev.class = sound_class; 730 + snd_ctl_led_dev.release = snd_ctl_led_dev_release; 747 731 dev_set_name(&snd_ctl_led_dev, "ctl-led"); 748 732 if (device_add(&snd_ctl_led_dev)) { 749 733 put_device(&snd_ctl_led_dev); ··· 755 737 INIT_LIST_HEAD(&led->controls); 756 738 device_initialize(&led->dev); 757 739 led->dev.parent = &snd_ctl_led_dev; 740 + led->dev.release = snd_ctl_led_release; 758 741 led->dev.groups = snd_ctl_led_dev_attr_groups; 759 742 dev_set_name(&led->dev, led->name); 760 743 if (device_add(&led->dev)) { 761 744 put_device(&led->dev); 762 745 for (; group > 0; group--) { 763 746 led = &snd_ctl_leds[group - 1]; 764 - device_del(&led->dev); 747 + device_unregister(&led->dev); 765 748 } 766 - device_del(&snd_ctl_led_dev); 749 + device_unregister(&snd_ctl_led_dev); 767 750 return -ENOMEM; 768 751 } 769 752 } ··· 790 771 } 791 772 for (group = 0; group < MAX_LED; group++) { 792 773 led = &snd_ctl_leds[group]; 793 - device_del(&led->dev); 774 + device_unregister(&led->dev); 794 775 } 795 - device_del(&snd_ctl_led_dev); 776 + device_unregister(&snd_ctl_led_dev); 796 777 snd_ctl_led_clean(NULL); 797 778 } 798 779
+2 -1
sound/core/timer.c
··· 520 520 return; 521 521 if (timer->hw.flags & SNDRV_TIMER_HW_SLAVE) 522 522 return; 523 + event += 10; /* convert to SNDRV_TIMER_EVENT_MXXX */ 523 524 list_for_each_entry(ts, &ti->slave_active_head, active_list) 524 525 if (ts->ccallback) 525 - ts->ccallback(ts, event + 100, &tstamp, resolution); 526 + ts->ccallback(ts, event, &tstamp, resolution); 526 527 } 527 528 528 529 /* start/continue a master timer */
+1 -1
sound/firewire/amdtp-stream.c
··· 1032 1032 static inline void cancel_stream(struct amdtp_stream *s) 1033 1033 { 1034 1034 s->packet_index = -1; 1035 - if (current_work() == &s->period_work) 1035 + if (in_interrupt()) 1036 1036 amdtp_stream_pcm_abort(s); 1037 1037 WRITE_ONCE(s->pcm_buffer_pointer, SNDRV_PCM_POS_XRUN); 1038 1038 }
+4
sound/hda/intel-dsp-config.c
··· 331 331 .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE, 332 332 .device = 0x51c8, 333 333 }, 334 + { 335 + .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE, 336 + .device = 0x51cc, 337 + }, 334 338 #endif 335 339 336 340 };
+5
sound/pci/hda/hda_codec.c
··· 2917 2917 #ifdef CONFIG_PM_SLEEP 2918 2918 static int hda_codec_pm_prepare(struct device *dev) 2919 2919 { 2920 + dev->power.power_state = PMSG_SUSPEND; 2920 2921 return pm_runtime_suspended(dev); 2921 2922 } 2922 2923 2923 2924 static void hda_codec_pm_complete(struct device *dev) 2924 2925 { 2925 2926 struct hda_codec *codec = dev_to_hda_codec(dev); 2927 + 2928 + /* If no other pm-functions are called between prepare() and complete() */ 2929 + if (dev->power.power_state.event == PM_EVENT_SUSPEND) 2930 + dev->power.power_state = PMSG_RESUME; 2926 2931 2927 2932 if (pm_runtime_suspended(dev) && (codec->jackpoll_interval || 2928 2933 hda_codec_need_resume(codec) || codec->forced_resume))
+1
sound/pci/hda/hda_generic.c
··· 3520 3520 static const struct snd_kcontrol_new cap_sw_temp = { 3521 3521 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 3522 3522 .name = "Capture Switch", 3523 + .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, 3523 3524 .info = cap_sw_info, 3524 3525 .get = cap_sw_get, 3525 3526 .put = cap_sw_put,
+3
sound/pci/hda/hda_intel.c
··· 2485 2485 /* Alderlake-P */ 2486 2486 { PCI_DEVICE(0x8086, 0x51c8), 2487 2487 .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE}, 2488 + /* Alderlake-M */ 2489 + { PCI_DEVICE(0x8086, 0x51cc), 2490 + .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE}, 2488 2491 /* Elkhart Lake */ 2489 2492 { PCI_DEVICE(0x8086, 0x4b55), 2490 2493 .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE},
+3 -4
sound/pci/hda/patch_cirrus.c
··· 2206 2206 break; 2207 2207 case HDA_FIXUP_ACT_PROBE: 2208 2208 2209 - /* Set initial volume on Bullseye to -26 dB */ 2210 - if (codec->fixup_id == CS8409_BULLSEYE) 2211 - snd_hda_codec_amp_init_stereo(codec, CS8409_CS42L42_DMIC_ADC_PIN_NID, 2212 - HDA_INPUT, 0, 0xff, 0x19); 2209 + /* Set initial DMIC volume to -26 dB */ 2210 + snd_hda_codec_amp_init_stereo(codec, CS8409_CS42L42_DMIC_ADC_PIN_NID, 2211 + HDA_INPUT, 0, 0xff, 0x19); 2213 2212 snd_hda_gen_add_kctl(&spec->gen, 2214 2213 NULL, &cs8409_cs42l42_hp_volume_mixer); 2215 2214 snd_hda_gen_add_kctl(&spec->gen,
+62 -1
sound/pci/hda/patch_realtek.c
··· 2603 2603 {} 2604 2604 }; 2605 2605 2606 + static const struct snd_hda_pin_quirk alc882_pin_fixup_tbl[] = { 2607 + SND_HDA_PIN_QUIRK(0x10ec1220, 0x1043, "ASUS", ALC1220_FIXUP_CLEVO_P950, 2608 + {0x14, 0x01014010}, 2609 + {0x15, 0x01011012}, 2610 + {0x16, 0x01016011}, 2611 + {0x18, 0x01a19040}, 2612 + {0x19, 0x02a19050}, 2613 + {0x1a, 0x0181304f}, 2614 + {0x1b, 0x0221401f}, 2615 + {0x1e, 0x01456130}), 2616 + SND_HDA_PIN_QUIRK(0x10ec1220, 0x1462, "MS-7C35", ALC1220_FIXUP_CLEVO_P950, 2617 + {0x14, 0x01015010}, 2618 + {0x15, 0x01011012}, 2619 + {0x16, 0x01011011}, 2620 + {0x18, 0x01a11040}, 2621 + {0x19, 0x02a19050}, 2622 + {0x1a, 0x0181104f}, 2623 + {0x1b, 0x0221401f}, 2624 + {0x1e, 0x01451130}), 2625 + {} 2626 + }; 2627 + 2606 2628 /* 2607 2629 * BIOS auto configuration 2608 2630 */ ··· 2666 2644 2667 2645 snd_hda_pick_fixup(codec, alc882_fixup_models, alc882_fixup_tbl, 2668 2646 alc882_fixups); 2647 + snd_hda_pick_pin_fixup(codec, alc882_pin_fixup_tbl, alc882_fixups, true); 2669 2648 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); 2670 2649 2671 2650 alc_auto_parse_customize_define(codec); ··· 6566 6543 ALC295_FIXUP_ASUS_DACS, 6567 6544 ALC295_FIXUP_HP_OMEN, 6568 6545 ALC285_FIXUP_HP_SPECTRE_X360, 6546 + ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, 6547 + ALC623_FIXUP_LENOVO_THINKSTATION_P340, 6548 + ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, 6569 6549 }; 6570 6550 6571 6551 static const struct hda_fixup alc269_fixups[] = { ··· 8135 8109 .chained = true, 8136 8110 .chain_id = ALC285_FIXUP_SPEAKER2_TO_DAC1, 8137 8111 }, 8112 + [ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP] = { 8113 + .type = HDA_FIXUP_FUNC, 8114 + .v.func = alc285_fixup_ideapad_s740_coef, 8115 + .chained = true, 8116 + .chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK, 8117 + }, 8118 + [ALC623_FIXUP_LENOVO_THINKSTATION_P340] = { 8119 + .type = HDA_FIXUP_FUNC, 8120 + .v.func = alc_fixup_no_shutup, 8121 + .chained = true, 8122 + .chain_id = ALC283_FIXUP_HEADSET_MIC, 8123 + }, 8124 + [ALC255_FIXUP_ACER_HEADPHONE_AND_MIC] = { 8125 + .type = HDA_FIXUP_PINS, 8126 + .v.pins = (const struct hda_pintbl[]) { 8127 + { 0x21, 0x03211030 }, /* Change the Headphone location to Left */ 8128 + { } 8129 + }, 8130 + .chained = true, 8131 + .chain_id = ALC255_FIXUP_XIAOMI_HEADSET_MIC 8132 + }, 8138 8133 }; 8139 8134 8140 8135 static const struct snd_pci_quirk alc269_fixup_tbl[] = { ··· 8192 8145 SND_PCI_QUIRK(0x1025, 0x132a, "Acer TravelMate B114-21", ALC233_FIXUP_ACER_HEADSET_MIC), 8193 8146 SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC), 8194 8147 SND_PCI_QUIRK(0x1025, 0x1430, "Acer TravelMate B311R-31", ALC256_FIXUP_ACER_MIC_NO_PRESENCE), 8148 + SND_PCI_QUIRK(0x1025, 0x1466, "Acer Aspire A515-56", ALC255_FIXUP_ACER_HEADPHONE_AND_MIC), 8195 8149 SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), 8196 8150 SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS), 8197 8151 SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X), ··· 8314 8266 SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE), 8315 8267 SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE), 8316 8268 SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3), 8269 + SND_PCI_QUIRK(0x103c, 0x841c, "HP Pavilion 15-CK0xx", ALC269_FIXUP_HP_MUTE_LED_MIC3), 8317 8270 SND_PCI_QUIRK(0x103c, 0x8497, "HP Envy x360", ALC269_FIXUP_HP_MUTE_LED_MIC3), 8318 8271 SND_PCI_QUIRK(0x103c, 0x84da, "HP OMEN dc0019-ur", ALC295_FIXUP_HP_OMEN), 8319 8272 SND_PCI_QUIRK(0x103c, 0x84e7, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3), 8320 8273 SND_PCI_QUIRK(0x103c, 0x8519, "HP Spectre x360 15-df0xxx", ALC285_FIXUP_HP_SPECTRE_X360), 8321 8274 SND_PCI_QUIRK(0x103c, 0x869d, "HP", ALC236_FIXUP_HP_MUTE_LED), 8322 8275 SND_PCI_QUIRK(0x103c, 0x86c7, "HP Envy AiO 32", ALC274_FIXUP_HP_ENVY_GPIO), 8276 + SND_PCI_QUIRK(0x103c, 0x8716, "HP Elite Dragonfly G2 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), 8277 + SND_PCI_QUIRK(0x103c, 0x8720, "HP EliteBook x360 1040 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), 8323 8278 SND_PCI_QUIRK(0x103c, 0x8724, "HP EliteBook 850 G7", ALC285_FIXUP_HP_GPIO_LED), 8324 8279 SND_PCI_QUIRK(0x103c, 0x8729, "HP", ALC285_FIXUP_HP_GPIO_LED), 8325 8280 SND_PCI_QUIRK(0x103c, 0x8730, "HP ProBook 445 G7", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), ··· 8341 8290 SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED), 8342 8291 SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP), 8343 8292 SND_PCI_QUIRK(0x103c, 0x8846, "HP EliteBook 850 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), 8293 + SND_PCI_QUIRK(0x103c, 0x884b, "HP EliteBook 840 Aero G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), 8344 8294 SND_PCI_QUIRK(0x103c, 0x884c, "HP EliteBook 840 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), 8295 + SND_PCI_QUIRK(0x103c, 0x886d, "HP ZBook Fury 17.3 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), 8296 + SND_PCI_QUIRK(0x103c, 0x8870, "HP ZBook Fury 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), 8297 + SND_PCI_QUIRK(0x103c, 0x8873, "HP ZBook Studio 15.6 Inch G8 Mobile Workstation PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), 8298 + SND_PCI_QUIRK(0x103c, 0x888d, "HP ZBook Power 15.6 inch G8 Mobile Workstation PC", ALC236_FIXUP_HP_GPIO_LED), 8299 + SND_PCI_QUIRK(0x103c, 0x8896, "HP EliteBook 855 G8 Notebook PC", ALC285_FIXUP_HP_MUTE_LED), 8345 8300 SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST), 8346 8301 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), 8347 8302 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), ··· 8484 8427 SND_PCI_QUIRK(0x1558, 0xc019, "Clevo NH77D[BE]Q", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 8485 8428 SND_PCI_QUIRK(0x1558, 0xc022, "Clevo NH77[DC][QW]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 8486 8429 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS), 8487 - SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), 8430 + SND_PCI_QUIRK(0x17aa, 0x1048, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340), 8488 8431 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE), 8489 8432 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE), 8490 8433 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE), ··· 8534 8477 SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), 8535 8478 SND_PCI_QUIRK(0x17aa, 0x3818, "Lenovo C940", ALC298_FIXUP_LENOVO_SPK_VOLUME), 8536 8479 SND_PCI_QUIRK(0x17aa, 0x3827, "Ideapad S740", ALC285_FIXUP_IDEAPAD_S740_COEF), 8480 + SND_PCI_QUIRK(0x17aa, 0x3843, "Yoga 9i", ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP), 8537 8481 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI), 8538 8482 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC), 8539 8483 SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI), ··· 8750 8692 {.id = ALC245_FIXUP_HP_X360_AMP, .name = "alc245-hp-x360-amp"}, 8751 8693 {.id = ALC295_FIXUP_HP_OMEN, .name = "alc295-hp-omen"}, 8752 8694 {.id = ALC285_FIXUP_HP_SPECTRE_X360, .name = "alc285-hp-spectre-x360"}, 8695 + {.id = ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, .name = "alc287-ideapad-bass-spk-amp"}, 8696 + {.id = ALC623_FIXUP_LENOVO_THINKSTATION_P340, .name = "alc623-lenovo-thinkstation-p340"}, 8697 + {.id = ALC255_FIXUP_ACER_HEADPHONE_AND_MIC, .name = "alc255-acer-headphone-and-mic"}, 8753 8698 {} 8754 8699 }; 8755 8700 #define ALC225_STANDARD_PINS \
-10
sound/soc/amd/raven/acp3x-pcm-dma.c
··· 235 235 return ret; 236 236 } 237 237 238 - if (!adata->play_stream && !adata->capture_stream && 239 - !adata->i2ssp_play_stream && !adata->i2ssp_capture_stream) 240 - rv_writel(1, adata->acp3x_base + mmACP_EXTERNAL_INTR_ENB); 241 - 242 238 i2s_data->acp3x_base = adata->acp3x_base; 243 239 runtime->private_data = i2s_data; 244 240 return ret; ··· 361 365 } 362 366 } 363 367 364 - /* Disable ACP irq, when the current stream is being closed and 365 - * another stream is also not active. 366 - */ 367 - if (!adata->play_stream && !adata->capture_stream && 368 - !adata->i2ssp_play_stream && !adata->i2ssp_capture_stream) 369 - rv_writel(0, adata->acp3x_base + mmACP_EXTERNAL_INTR_ENB); 370 368 return 0; 371 369 } 372 370
+1
sound/soc/amd/raven/acp3x.h
··· 77 77 #define ACP_POWER_OFF_IN_PROGRESS 0x03 78 78 79 79 #define ACP3x_ITER_IRER_SAMP_LEN_MASK 0x38 80 + #define ACP_EXT_INTR_STAT_CLEAR_MASK 0xFFFFFFFF 80 81 81 82 struct acp3x_platform_info { 82 83 u16 play_i2s_instance;
+15
sound/soc/amd/raven/pci-acp3x.c
··· 76 76 return -ETIMEDOUT; 77 77 } 78 78 79 + static void acp3x_enable_interrupts(void __iomem *acp_base) 80 + { 81 + rv_writel(0x01, acp_base + mmACP_EXTERNAL_INTR_ENB); 82 + } 83 + 84 + static void acp3x_disable_interrupts(void __iomem *acp_base) 85 + { 86 + rv_writel(ACP_EXT_INTR_STAT_CLEAR_MASK, acp_base + 87 + mmACP_EXTERNAL_INTR_STAT); 88 + rv_writel(0x00, acp_base + mmACP_EXTERNAL_INTR_CNTL); 89 + rv_writel(0x00, acp_base + mmACP_EXTERNAL_INTR_ENB); 90 + } 91 + 79 92 static int acp3x_init(struct acp3x_dev_data *adata) 80 93 { 81 94 void __iomem *acp3x_base = adata->acp3x_base; ··· 106 93 pr_err("ACP3x reset failed\n"); 107 94 return ret; 108 95 } 96 + acp3x_enable_interrupts(acp3x_base); 109 97 return 0; 110 98 } 111 99 ··· 114 100 { 115 101 int ret; 116 102 103 + acp3x_disable_interrupts(acp3x_base); 117 104 /* Reset */ 118 105 ret = acp3x_reset(acp3x_base); 119 106 if (ret) {
+1 -1
sound/soc/codecs/ak5558.c
··· 307 307 }; 308 308 309 309 static struct snd_soc_dai_driver ak5552_dai = { 310 - .name = "ak5558-aif", 310 + .name = "ak5552-aif", 311 311 .capture = { 312 312 .stream_name = "Capture", 313 313 .channels_min = 1,
+3
sound/soc/codecs/cs35l32.c
··· 261 261 .readable_reg = cs35l32_readable_register, 262 262 .precious_reg = cs35l32_precious_register, 263 263 .cache_type = REGCACHE_RBTREE, 264 + 265 + .use_single_read = true, 266 + .use_single_write = true, 264 267 }; 265 268 266 269 static int cs35l32_handle_of_data(struct i2c_client *i2c_client,
+1
sound/soc/codecs/cs35l33.c
··· 1201 1201 dev_err(&i2c_client->dev, 1202 1202 "CS35L33 Device ID (%X). Expected ID %X\n", 1203 1203 devid, CS35L33_CHIP_ID); 1204 + ret = -EINVAL; 1204 1205 goto err_enable; 1205 1206 } 1206 1207
+3
sound/soc/codecs/cs35l34.c
··· 800 800 .readable_reg = cs35l34_readable_register, 801 801 .precious_reg = cs35l34_precious_register, 802 802 .cache_type = REGCACHE_RBTREE, 803 + 804 + .use_single_read = true, 805 + .use_single_write = true, 803 806 }; 804 807 805 808 static int cs35l34_handle_of_data(struct i2c_client *i2c_client,
+3
sound/soc/codecs/cs42l42.c
··· 399 399 .reg_defaults = cs42l42_reg_defaults, 400 400 .num_reg_defaults = ARRAY_SIZE(cs42l42_reg_defaults), 401 401 .cache_type = REGCACHE_RBTREE, 402 + 403 + .use_single_read = true, 404 + .use_single_write = true, 402 405 }; 403 406 404 407 static DECLARE_TLV_DB_SCALE(adc_tlv, -9600, 100, false);
+6 -1
sound/soc/codecs/cs42l56.c
··· 1175 1175 struct cs42l56_platform_data *pdata = 1176 1176 dev_get_platdata(&i2c_client->dev); 1177 1177 int ret, i; 1178 - unsigned int devid = 0; 1178 + unsigned int devid; 1179 1179 unsigned int alpha_rev, metal_rev; 1180 1180 unsigned int reg; 1181 1181 ··· 1245 1245 } 1246 1246 1247 1247 ret = regmap_read(cs42l56->regmap, CS42L56_CHIP_ID_1, &reg); 1248 + if (ret) { 1249 + dev_err(&i2c_client->dev, "Failed to read chip ID: %d\n", ret); 1250 + return ret; 1251 + } 1252 + 1248 1253 devid = reg & CS42L56_CHIP_ID_MASK; 1249 1254 if (devid != CS42L56_DEVID) { 1250 1255 dev_err(&i2c_client->dev,
+3
sound/soc/codecs/cs42l73.c
··· 1268 1268 .volatile_reg = cs42l73_volatile_register, 1269 1269 .readable_reg = cs42l73_readable_register, 1270 1270 .cache_type = REGCACHE_RBTREE, 1271 + 1272 + .use_single_read = true, 1273 + .use_single_write = true, 1271 1274 }; 1272 1275 1273 1276 static int cs42l73_i2c_probe(struct i2c_client *i2c_client,
+3
sound/soc/codecs/cs53l30.c
··· 912 912 .writeable_reg = cs53l30_writeable_register, 913 913 .readable_reg = cs53l30_readable_register, 914 914 .cache_type = REGCACHE_RBTREE, 915 + 916 + .use_single_read = true, 917 + .use_single_write = true, 915 918 }; 916 919 917 920 static int cs53l30_i2c_probe(struct i2c_client *client,
+1 -4
sound/soc/codecs/da7219.c
··· 2181 2181 ret); 2182 2182 goto err; 2183 2183 } 2184 - 2185 - da7219->dai_clks[i] = devm_clk_hw_get_clk(dev, dai_clk_hw, NULL); 2186 - if (IS_ERR(da7219->dai_clks[i])) 2187 - return PTR_ERR(da7219->dai_clks[i]); 2184 + da7219->dai_clks[i] = dai_clk_hw->clk; 2188 2185 2189 2186 /* For DT setup onecell data, otherwise create lookup */ 2190 2187 if (np) {
+1
sound/soc/codecs/lpass-rx-macro.c
··· 3579 3579 { .compatible = "qcom,sm8250-lpass-rx-macro" }, 3580 3580 { } 3581 3581 }; 3582 + MODULE_DEVICE_TABLE(of, rx_macro_dt_match); 3582 3583 3583 3584 static struct platform_driver rx_macro_driver = { 3584 3585 .driver = {
+1
sound/soc/codecs/lpass-tx-macro.c
··· 1846 1846 { .compatible = "qcom,sm8250-lpass-tx-macro" }, 1847 1847 { } 1848 1848 }; 1849 + MODULE_DEVICE_TABLE(of, tx_macro_dt_match); 1849 1850 static struct platform_driver tx_macro_driver = { 1850 1851 .driver = { 1851 1852 .name = "tx_macro",
+11 -2
sound/soc/codecs/max98088.c
··· 41 41 enum max98088_type devtype; 42 42 struct max98088_pdata *pdata; 43 43 struct clk *mclk; 44 + unsigned char mclk_prescaler; 44 45 unsigned int sysclk; 45 46 struct max98088_cdata dai[2]; 46 47 int eq_textcnt; ··· 999 998 /* Configure NI when operating as master */ 1000 999 if (snd_soc_component_read(component, M98088_REG_14_DAI1_FORMAT) 1001 1000 & M98088_DAI_MAS) { 1001 + unsigned long pclk; 1002 + 1002 1003 if (max98088->sysclk == 0) { 1003 1004 dev_err(component->dev, "Invalid system clock frequency\n"); 1004 1005 return -EINVAL; 1005 1006 } 1006 1007 ni = 65536ULL * (rate < 50000 ? 96ULL : 48ULL) 1007 1008 * (unsigned long long int)rate; 1008 - do_div(ni, (unsigned long long int)max98088->sysclk); 1009 + pclk = DIV_ROUND_CLOSEST(max98088->sysclk, max98088->mclk_prescaler); 1010 + ni = DIV_ROUND_CLOSEST_ULL(ni, pclk); 1009 1011 snd_soc_component_write(component, M98088_REG_12_DAI1_CLKCFG_HI, 1010 1012 (ni >> 8) & 0x7F); 1011 1013 snd_soc_component_write(component, M98088_REG_13_DAI1_CLKCFG_LO, ··· 1069 1065 /* Configure NI when operating as master */ 1070 1066 if (snd_soc_component_read(component, M98088_REG_1C_DAI2_FORMAT) 1071 1067 & M98088_DAI_MAS) { 1068 + unsigned long pclk; 1069 + 1072 1070 if (max98088->sysclk == 0) { 1073 1071 dev_err(component->dev, "Invalid system clock frequency\n"); 1074 1072 return -EINVAL; 1075 1073 } 1076 1074 ni = 65536ULL * (rate < 50000 ? 96ULL : 48ULL) 1077 1075 * (unsigned long long int)rate; 1078 - do_div(ni, (unsigned long long int)max98088->sysclk); 1076 + pclk = DIV_ROUND_CLOSEST(max98088->sysclk, max98088->mclk_prescaler); 1077 + ni = DIV_ROUND_CLOSEST_ULL(ni, pclk); 1079 1078 snd_soc_component_write(component, M98088_REG_1A_DAI2_CLKCFG_HI, 1080 1079 (ni >> 8) & 0x7F); 1081 1080 snd_soc_component_write(component, M98088_REG_1B_DAI2_CLKCFG_LO, ··· 1120 1113 */ 1121 1114 if ((freq >= 10000000) && (freq < 20000000)) { 1122 1115 snd_soc_component_write(component, M98088_REG_10_SYS_CLK, 0x10); 1116 + max98088->mclk_prescaler = 1; 1123 1117 } else if ((freq >= 20000000) && (freq < 30000000)) { 1124 1118 snd_soc_component_write(component, M98088_REG_10_SYS_CLK, 0x20); 1119 + max98088->mclk_prescaler = 2; 1125 1120 } else { 1126 1121 dev_err(component->dev, "Invalid master clock frequency\n"); 1127 1122 return -EINVAL;
+2 -2
sound/soc/codecs/rt711-sdca.c
··· 683 683 ch_r = (rt711->fu1e_dapm_mute || rt711->fu1e_mixer_r_mute) ? 0x01 : 0x00; 684 684 685 685 err = regmap_write(rt711->regmap, 686 - SDW_SDCA_CTL(FUNC_NUM_JACK_CODEC, RT711_SDCA_ENT_USER_FU1E, 686 + SDW_SDCA_CTL(FUNC_NUM_MIC_ARRAY, RT711_SDCA_ENT_USER_FU1E, 687 687 RT711_SDCA_CTL_FU_MUTE, CH_L), ch_l); 688 688 if (err < 0) 689 689 return err; 690 690 691 691 err = regmap_write(rt711->regmap, 692 - SDW_SDCA_CTL(FUNC_NUM_JACK_CODEC, RT711_SDCA_ENT_USER_FU1E, 692 + SDW_SDCA_CTL(FUNC_NUM_MIC_ARRAY, RT711_SDCA_ENT_USER_FU1E, 693 693 RT711_SDCA_CTL_FU_MUTE, CH_R), ch_r); 694 694 if (err < 0) 695 695 return err;
+1
sound/soc/codecs/sti-sas.c
··· 408 408 }, 409 409 {}, 410 410 }; 411 + MODULE_DEVICE_TABLE(of, sti_sas_dev_match); 411 412 412 413 static int sti_sas_driver_probe(struct platform_device *pdev) 413 414 {
+1
sound/soc/fsl/Kconfig
··· 119 119 tristate "NXP Audio Base On RPMSG support" 120 120 depends on COMMON_CLK 121 121 depends on RPMSG 122 + depends on SND_IMX_SOC || SND_IMX_SOC = n 122 123 select SND_SOC_IMX_RPMSG if SND_IMX_SOC != n 123 124 help 124 125 Say Y if you want to add rpmsg audio support for the Freescale CPUs.
+29 -28
sound/soc/generic/audio-graph-card.c
··· 209 209 static int graph_parse_node(struct asoc_simple_priv *priv, 210 210 struct device_node *ep, 211 211 struct link_info *li, 212 - int is_cpu) 212 + int *cpu) 213 213 { 214 214 struct device *dev = simple_priv_to_dev(priv); 215 215 struct device_node *top = dev->of_node; ··· 217 217 struct simple_dai_props *dai_props = simple_priv_to_props(priv, li->link); 218 218 struct snd_soc_dai_link_component *dlc; 219 219 struct asoc_simple_dai *dai; 220 - int ret, single = 0; 220 + int ret; 221 221 222 - if (is_cpu) { 222 + if (cpu) { 223 223 dlc = asoc_link_to_cpu(dai_link, 0); 224 224 dai = simple_props_to_dai_cpu(dai_props, 0); 225 225 } else { ··· 229 229 230 230 graph_parse_mclk_fs(top, ep, dai_props); 231 231 232 - ret = asoc_simple_parse_dai(ep, dlc, &single); 232 + ret = asoc_simple_parse_dai(ep, dlc, cpu); 233 233 if (ret < 0) 234 234 return ret; 235 235 ··· 240 240 ret = asoc_simple_parse_clk(dev, ep, dai, dlc); 241 241 if (ret < 0) 242 242 return ret; 243 - 244 - if (is_cpu) 245 - asoc_simple_canonicalize_cpu(dlc, single); 246 243 247 244 return 0; 248 245 } ··· 273 276 struct link_info *li) 274 277 { 275 278 struct device *dev = simple_priv_to_dev(priv); 276 - struct snd_soc_card *card = simple_priv_to_card(priv); 277 279 struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link); 278 280 struct simple_dai_props *dai_props = simple_priv_to_props(priv, li->link); 279 281 struct device_node *top = dev->of_node; 280 282 struct device_node *ep = li->cpu ? cpu_ep : codec_ep; 281 - struct device_node *port; 282 - struct device_node *ports; 283 - struct snd_soc_dai_link_component *cpus = asoc_link_to_cpu(dai_link, 0); 284 - struct snd_soc_dai_link_component *codecs = asoc_link_to_codec(dai_link, 0); 285 283 char dai_name[64]; 286 284 int ret; 287 - 288 - port = of_get_parent(ep); 289 - ports = of_get_parent(port); 290 285 291 286 dev_dbg(dev, "link_of DPCM (%pOF)\n", ep); 292 287 293 288 if (li->cpu) { 289 + struct snd_soc_card *card = simple_priv_to_card(priv); 290 + struct snd_soc_dai_link_component *cpus = asoc_link_to_cpu(dai_link, 0); 291 + int is_single_links = 0; 292 + 294 293 /* Codec is dummy */ 295 294 296 295 /* FE settings */ 297 296 dai_link->dynamic = 1; 298 297 dai_link->dpcm_merged_format = 1; 299 298 300 - ret = graph_parse_node(priv, cpu_ep, li, 1); 299 + ret = graph_parse_node(priv, cpu_ep, li, &is_single_links); 301 300 if (ret) 302 - goto out_put_node; 301 + return ret; 303 302 304 303 snprintf(dai_name, sizeof(dai_name), 305 304 "fe.%pOFP.%s", cpus->of_node, cpus->dai_name); ··· 311 318 */ 312 319 if (card->component_chaining && !soc_component_is_pcm(cpus)) 313 320 dai_link->no_pcm = 1; 321 + 322 + asoc_simple_canonicalize_cpu(cpus, is_single_links); 314 323 } else { 315 - struct snd_soc_codec_conf *cconf; 324 + struct snd_soc_codec_conf *cconf = simple_props_to_codec_conf(dai_props, 0); 325 + struct snd_soc_dai_link_component *codecs = asoc_link_to_codec(dai_link, 0); 326 + struct device_node *port; 327 + struct device_node *ports; 316 328 317 329 /* CPU is dummy */ 318 330 ··· 325 327 dai_link->no_pcm = 1; 326 328 dai_link->be_hw_params_fixup = asoc_simple_be_hw_params_fixup; 327 329 328 - cconf = simple_props_to_codec_conf(dai_props, 0); 329 - 330 - ret = graph_parse_node(priv, codec_ep, li, 0); 330 + ret = graph_parse_node(priv, codec_ep, li, NULL); 331 331 if (ret < 0) 332 - goto out_put_node; 332 + return ret; 333 333 334 334 snprintf(dai_name, sizeof(dai_name), 335 335 "be.%pOFP.%s", codecs->of_node, codecs->dai_name); 336 336 337 337 /* check "prefix" from top node */ 338 + port = of_get_parent(ep); 339 + ports = of_get_parent(port); 338 340 snd_soc_of_parse_node_prefix(top, cconf, codecs->of_node, 339 341 "prefix"); 340 342 if (of_node_name_eq(ports, "ports")) 341 343 snd_soc_of_parse_node_prefix(ports, cconf, codecs->of_node, "prefix"); 342 344 snd_soc_of_parse_node_prefix(port, cconf, codecs->of_node, 343 345 "prefix"); 346 + 347 + of_node_put(ports); 348 + of_node_put(port); 344 349 } 345 350 346 351 graph_parse_convert(dev, ep, &dai_props->adata); ··· 352 351 353 352 ret = graph_link_init(priv, cpu_ep, codec_ep, li, dai_name); 354 353 355 - out_put_node: 356 354 li->link++; 357 355 358 - of_node_put(ports); 359 - of_node_put(port); 360 356 return ret; 361 357 } 362 358 ··· 367 369 struct snd_soc_dai_link_component *cpus = asoc_link_to_cpu(dai_link, 0); 368 370 struct snd_soc_dai_link_component *codecs = asoc_link_to_codec(dai_link, 0); 369 371 char dai_name[64]; 370 - int ret; 372 + int ret, is_single_links = 0; 371 373 372 374 dev_dbg(dev, "link_of (%pOF)\n", cpu_ep); 373 375 374 - ret = graph_parse_node(priv, cpu_ep, li, 1); 376 + ret = graph_parse_node(priv, cpu_ep, li, &is_single_links); 375 377 if (ret < 0) 376 378 return ret; 377 379 378 - ret = graph_parse_node(priv, codec_ep, li, 0); 380 + ret = graph_parse_node(priv, codec_ep, li, NULL); 379 381 if (ret < 0) 380 382 return ret; 381 383 382 384 snprintf(dai_name, sizeof(dai_name), 383 385 "%s-%s", cpus->dai_name, codecs->dai_name); 386 + 387 + asoc_simple_canonicalize_cpu(cpus, is_single_links); 388 + 384 389 ret = graph_link_init(priv, cpu_ep, codec_ep, li, dai_name); 385 390 if (ret < 0) 386 391 return ret;
+83 -85
sound/soc/generic/simple-card.c
··· 93 93 } 94 94 95 95 static void simple_parse_mclk_fs(struct device_node *top, 96 - struct device_node *cpu, 97 - struct device_node *codec, 96 + struct device_node *np, 98 97 struct simple_dai_props *props, 99 98 char *prefix) 100 99 { 101 - struct device_node *node = of_get_parent(cpu); 100 + struct device_node *node = of_get_parent(np); 102 101 char prop[128]; 103 102 104 103 snprintf(prop, sizeof(prop), "%smclk-fs", PREFIX); ··· 105 106 106 107 snprintf(prop, sizeof(prop), "%smclk-fs", prefix); 107 108 of_property_read_u32(node, prop, &props->mclk_fs); 108 - of_property_read_u32(cpu, prop, &props->mclk_fs); 109 - of_property_read_u32(codec, prop, &props->mclk_fs); 109 + of_property_read_u32(np, prop, &props->mclk_fs); 110 110 111 111 of_node_put(node); 112 + } 113 + 114 + static int simple_parse_node(struct asoc_simple_priv *priv, 115 + struct device_node *np, 116 + struct link_info *li, 117 + char *prefix, 118 + int *cpu) 119 + { 120 + struct device *dev = simple_priv_to_dev(priv); 121 + struct device_node *top = dev->of_node; 122 + struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link); 123 + struct simple_dai_props *dai_props = simple_priv_to_props(priv, li->link); 124 + struct snd_soc_dai_link_component *dlc; 125 + struct asoc_simple_dai *dai; 126 + int ret; 127 + 128 + if (cpu) { 129 + dlc = asoc_link_to_cpu(dai_link, 0); 130 + dai = simple_props_to_dai_cpu(dai_props, 0); 131 + } else { 132 + dlc = asoc_link_to_codec(dai_link, 0); 133 + dai = simple_props_to_dai_codec(dai_props, 0); 134 + } 135 + 136 + simple_parse_mclk_fs(top, np, dai_props, prefix); 137 + 138 + ret = asoc_simple_parse_dai(np, dlc, cpu); 139 + if (ret) 140 + return ret; 141 + 142 + ret = asoc_simple_parse_clk(dev, np, dai, dlc); 143 + if (ret) 144 + return ret; 145 + 146 + ret = asoc_simple_parse_tdm(np, dai); 147 + if (ret) 148 + return ret; 149 + 150 + return 0; 151 + } 152 + 153 + static int simple_link_init(struct asoc_simple_priv *priv, 154 + struct device_node *node, 155 + struct device_node *codec, 156 + struct link_info *li, 157 + char *prefix, char *name) 158 + { 159 + struct device *dev = simple_priv_to_dev(priv); 160 + struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link); 161 + int ret; 162 + 163 + ret = asoc_simple_parse_daifmt(dev, node, codec, 164 + prefix, &dai_link->dai_fmt); 165 + if (ret < 0) 166 + return 0; 167 + 168 + dai_link->init = asoc_simple_dai_init; 169 + dai_link->ops = &simple_ops; 170 + 171 + return asoc_simple_set_dailink_name(dev, dai_link, name); 112 172 } 113 173 114 174 static int simple_dai_link_of_dpcm(struct asoc_simple_priv *priv, ··· 179 121 struct device *dev = simple_priv_to_dev(priv); 180 122 struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link); 181 123 struct simple_dai_props *dai_props = simple_priv_to_props(priv, li->link); 182 - struct asoc_simple_dai *dai; 183 - struct snd_soc_dai_link_component *cpus = asoc_link_to_cpu(dai_link, 0); 184 - struct snd_soc_dai_link_component *codecs = asoc_link_to_codec(dai_link, 0); 185 - struct snd_soc_dai_link_component *platforms = asoc_link_to_platform(dai_link, 0); 186 124 struct device_node *top = dev->of_node; 187 125 struct device_node *node = of_get_parent(np); 188 126 char *prefix = ""; 127 + char dai_name[64]; 189 128 int ret; 190 129 191 130 dev_dbg(dev, "link_of DPCM (%pOF)\n", np); 192 - 193 - li->link++; 194 131 195 132 /* For single DAI link & old style of DT node */ 196 133 if (is_top) 197 134 prefix = PREFIX; 198 135 199 136 if (li->cpu) { 137 + struct snd_soc_dai_link_component *cpus = asoc_link_to_cpu(dai_link, 0); 138 + struct snd_soc_dai_link_component *platforms = asoc_link_to_platform(dai_link, 0); 200 139 int is_single_links = 0; 201 140 202 141 /* Codec is dummy */ ··· 202 147 dai_link->dynamic = 1; 203 148 dai_link->dpcm_merged_format = 1; 204 149 205 - dai = simple_props_to_dai_cpu(dai_props, 0); 206 - 207 - ret = asoc_simple_parse_dai(np, cpus, &is_single_links); 208 - if (ret) 209 - goto out_put_node; 210 - 211 - ret = asoc_simple_parse_clk(dev, np, dai, cpus); 150 + ret = simple_parse_node(priv, np, li, prefix, &is_single_links); 212 151 if (ret < 0) 213 152 goto out_put_node; 214 153 215 - ret = asoc_simple_set_dailink_name(dev, dai_link, 216 - "fe.%s", 217 - cpus->dai_name); 218 - if (ret < 0) 219 - goto out_put_node; 154 + snprintf(dai_name, sizeof(dai_name), "fe.%s", cpus->dai_name); 220 155 221 156 asoc_simple_canonicalize_cpu(cpus, is_single_links); 222 157 asoc_simple_canonicalize_platform(platforms, cpus); 223 158 } else { 159 + struct snd_soc_dai_link_component *codecs = asoc_link_to_codec(dai_link, 0); 224 160 struct snd_soc_codec_conf *cconf; 225 161 226 162 /* CPU is dummy */ ··· 220 174 dai_link->no_pcm = 1; 221 175 dai_link->be_hw_params_fixup = asoc_simple_be_hw_params_fixup; 222 176 223 - dai = simple_props_to_dai_codec(dai_props, 0); 224 177 cconf = simple_props_to_codec_conf(dai_props, 0); 225 178 226 - ret = asoc_simple_parse_dai(np, codecs, NULL); 179 + ret = simple_parse_node(priv, np, li, prefix, NULL); 227 180 if (ret < 0) 228 181 goto out_put_node; 229 182 230 - ret = asoc_simple_parse_clk(dev, np, dai, codecs); 231 - if (ret < 0) 232 - goto out_put_node; 233 - 234 - ret = asoc_simple_set_dailink_name(dev, dai_link, 235 - "be.%s", 236 - codecs->dai_name); 237 - if (ret < 0) 238 - goto out_put_node; 183 + snprintf(dai_name, sizeof(dai_name), "be.%s", codecs->dai_name); 239 184 240 185 /* check "prefix" from top node */ 241 186 snd_soc_of_parse_node_prefix(top, cconf, codecs->of_node, ··· 238 201 } 239 202 240 203 simple_parse_convert(dev, np, &dai_props->adata); 241 - simple_parse_mclk_fs(top, np, codec, dai_props, prefix); 242 - 243 - ret = asoc_simple_parse_tdm(np, dai); 244 - if (ret) 245 - goto out_put_node; 246 - 247 - ret = asoc_simple_parse_daifmt(dev, node, codec, 248 - prefix, &dai_link->dai_fmt); 249 - if (ret < 0) 250 - goto out_put_node; 251 204 252 205 snd_soc_dai_link_set_capabilities(dai_link); 253 206 254 - dai_link->ops = &simple_ops; 255 - dai_link->init = asoc_simple_dai_init; 207 + ret = simple_link_init(priv, node, codec, li, prefix, dai_name); 256 208 257 209 out_put_node: 210 + li->link++; 211 + 258 212 of_node_put(node); 259 213 return ret; 260 214 } ··· 258 230 { 259 231 struct device *dev = simple_priv_to_dev(priv); 260 232 struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link); 261 - struct simple_dai_props *dai_props = simple_priv_to_props(priv, li->link); 262 - struct asoc_simple_dai *cpu_dai = simple_props_to_dai_cpu(dai_props, 0); 263 - struct asoc_simple_dai *codec_dai = simple_props_to_dai_codec(dai_props, 0); 264 233 struct snd_soc_dai_link_component *cpus = asoc_link_to_cpu(dai_link, 0); 265 234 struct snd_soc_dai_link_component *codecs = asoc_link_to_codec(dai_link, 0); 266 235 struct snd_soc_dai_link_component *platforms = asoc_link_to_platform(dai_link, 0); 267 - struct device_node *top = dev->of_node; 268 236 struct device_node *cpu = NULL; 269 237 struct device_node *node = NULL; 270 238 struct device_node *plat = NULL; 239 + char dai_name[64]; 271 240 char prop[128]; 272 241 char *prefix = ""; 273 242 int ret, single_cpu = 0; 274 243 275 244 cpu = np; 276 245 node = of_get_parent(np); 277 - li->link++; 278 246 279 247 dev_dbg(dev, "link_of (%pOF)\n", node); 280 248 ··· 281 257 snprintf(prop, sizeof(prop), "%splat", prefix); 282 258 plat = of_get_child_by_name(node, prop); 283 259 284 - ret = asoc_simple_parse_daifmt(dev, node, codec, 285 - prefix, &dai_link->dai_fmt); 260 + ret = simple_parse_node(priv, cpu, li, prefix, &single_cpu); 286 261 if (ret < 0) 287 262 goto dai_link_of_err; 288 263 289 - simple_parse_mclk_fs(top, cpu, codec, dai_props, prefix); 290 - 291 - ret = asoc_simple_parse_dai(cpu, cpus, &single_cpu); 292 - if (ret < 0) 293 - goto dai_link_of_err; 294 - 295 - ret = asoc_simple_parse_dai(codec, codecs, NULL); 264 + ret = simple_parse_node(priv, codec, li, prefix, NULL); 296 265 if (ret < 0) 297 266 goto dai_link_of_err; 298 267 ··· 293 276 if (ret < 0) 294 277 goto dai_link_of_err; 295 278 296 - ret = asoc_simple_parse_tdm(cpu, cpu_dai); 297 - if (ret < 0) 298 - goto dai_link_of_err; 299 - 300 - ret = asoc_simple_parse_tdm(codec, codec_dai); 301 - if (ret < 0) 302 - goto dai_link_of_err; 303 - 304 - ret = asoc_simple_parse_clk(dev, cpu, cpu_dai, cpus); 305 - if (ret < 0) 306 - goto dai_link_of_err; 307 - 308 - ret = asoc_simple_parse_clk(dev, codec, codec_dai, codecs); 309 - if (ret < 0) 310 - goto dai_link_of_err; 311 - 312 - ret = asoc_simple_set_dailink_name(dev, dai_link, 313 - "%s-%s", 314 - cpus->dai_name, 315 - codecs->dai_name); 316 - if (ret < 0) 317 - goto dai_link_of_err; 318 - 319 - dai_link->ops = &simple_ops; 320 - dai_link->init = asoc_simple_dai_init; 279 + snprintf(dai_name, sizeof(dai_name), 280 + "%s-%s", cpus->dai_name, codecs->dai_name); 321 281 322 282 asoc_simple_canonicalize_cpu(cpus, single_cpu); 323 283 asoc_simple_canonicalize_platform(platforms, cpus); 324 284 285 + ret = simple_link_init(priv, node, codec, li, prefix, dai_name); 286 + 325 287 dai_link_of_err: 326 288 of_node_put(plat); 327 289 of_node_put(node); 290 + 291 + li->link++; 328 292 329 293 return ret; 330 294 }
+25
sound/soc/intel/boards/bytcr_rt5640.c
··· 574 574 BYT_RT5640_SSP0_AIF1 | 575 575 BYT_RT5640_MCLK_EN), 576 576 }, 577 + { /* Glavey TM800A550L */ 578 + .matches = { 579 + DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"), 580 + DMI_MATCH(DMI_BOARD_NAME, "Aptio CRB"), 581 + /* Above strings are too generic, also match on BIOS version */ 582 + DMI_MATCH(DMI_BIOS_VERSION, "ZY-8-BI-PX4S70VTR400-X423B-005-D"), 583 + }, 584 + .driver_data = (void *)(BYTCR_INPUT_DEFAULTS | 585 + BYT_RT5640_SSP0_AIF1 | 586 + BYT_RT5640_MCLK_EN), 587 + }, 577 588 { 578 589 .matches = { 579 590 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), ··· 661 650 BYT_RT5640_OVCD_TH_2000UA | 662 651 BYT_RT5640_OVCD_SF_0P75 | 663 652 BYT_RT5640_MONO_SPEAKER | 653 + BYT_RT5640_MCLK_EN), 654 + }, 655 + { /* Lenovo Miix 3-830 */ 656 + .matches = { 657 + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"), 658 + DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "Lenovo MIIX 3-830"), 659 + }, 660 + .driver_data = (void *)(BYT_RT5640_IN1_MAP | 661 + BYT_RT5640_JD_SRC_JD2_IN4N | 662 + BYT_RT5640_OVCD_TH_2000UA | 663 + BYT_RT5640_OVCD_SF_0P75 | 664 + BYT_RT5640_MONO_SPEAKER | 665 + BYT_RT5640_DIFF_MIC | 666 + BYT_RT5640_SSP0_AIF1 | 664 667 BYT_RT5640_MCLK_EN), 665 668 }, 666 669 { /* Linx Linx7 tablet */
+1 -11
sound/soc/qcom/lpass-cpu.c
··· 835 835 if (dai_id == LPASS_DP_RX) 836 836 continue; 837 837 838 - drvdata->mi2s_osr_clk[dai_id] = devm_clk_get(dev, 838 + drvdata->mi2s_osr_clk[dai_id] = devm_clk_get_optional(dev, 839 839 variant->dai_osr_clk_names[i]); 840 - if (IS_ERR(drvdata->mi2s_osr_clk[dai_id])) { 841 - dev_warn(dev, 842 - "%s() error getting optional %s: %ld\n", 843 - __func__, 844 - variant->dai_osr_clk_names[i], 845 - PTR_ERR(drvdata->mi2s_osr_clk[dai_id])); 846 - 847 - drvdata->mi2s_osr_clk[dai_id] = NULL; 848 - } 849 - 850 840 drvdata->mi2s_bit_clk[dai_id] = devm_clk_get(dev, 851 841 variant->dai_bit_clk_names[i]); 852 842 if (IS_ERR(drvdata->mi2s_bit_clk[dai_id])) {
+5
sound/soc/sof/intel/hda-dai.c
··· 421 421 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 422 422 struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, SOF_AUDIO_PCM_DRV_NAME); 423 423 struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(component); 424 + struct sof_ipc_fw_version *v = &sdev->fw_ready.version; 424 425 struct sof_ipc_dai_config *config; 425 426 struct snd_sof_dai *sof_dai; 426 427 struct sof_ipc_reply reply; 427 428 int ret; 429 + 430 + /* DAI_CONFIG IPC during hw_params is not supported in older firmware */ 431 + if (v->abi_version < SOF_ABI_VER(3, 18, 0)) 432 + return 0; 428 433 429 434 list_for_each_entry(sof_dai, &sdev->dai_list, list) { 430 435 if (!sof_dai->cpu_dai_name || !sof_dai->dai_config)
+1 -4
sound/soc/stm/stm32_sai_sub.c
··· 484 484 dev_err(dev, "mclk register returned %d\n", ret); 485 485 return ret; 486 486 } 487 - 488 - sai->sai_mclk = devm_clk_hw_get_clk(dev, hw, NULL); 489 - if (IS_ERR(sai->sai_mclk)) 490 - return PTR_ERR(sai->sai_mclk); 487 + sai->sai_mclk = hw->clk; 491 488 492 489 /* register mclk provider */ 493 490 return devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, hw);
+1 -1
sound/usb/format.c
··· 436 436 if (snd_BUG_ON(altsetting >= 64 - 8)) 437 437 return false; 438 438 439 - err = snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0), UAC2_CS_CUR, 439 + err = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), UAC2_CS_CUR, 440 440 USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_IN, 441 441 UAC2_AS_VAL_ALT_SETTINGS << 8, 442 442 iface, &raw_data, sizeof(raw_data));
+4
sound/usb/line6/driver.c
··· 699 699 line6->buffer_message = kmalloc(LINE6_MIDI_MESSAGE_MAXLEN, GFP_KERNEL); 700 700 if (!line6->buffer_message) 701 701 return -ENOMEM; 702 + 703 + ret = line6_init_midi(line6); 704 + if (ret < 0) 705 + return ret; 702 706 } else { 703 707 ret = line6_hwdep_init(line6); 704 708 if (ret < 0)
-5
sound/usb/line6/pod.c
··· 376 376 if (err < 0) 377 377 return err; 378 378 379 - /* initialize MIDI subsystem: */ 380 - err = line6_init_midi(line6); 381 - if (err < 0) 382 - return err; 383 - 384 379 /* initialize PCM subsystem: */ 385 380 err = line6_init_pcm(line6, &pod_pcm_properties); 386 381 if (err < 0)
-6
sound/usb/line6/variax.c
··· 159 159 const struct usb_device_id *id) 160 160 { 161 161 struct usb_line6_variax *variax = line6_to_variax(line6); 162 - int err; 163 162 164 163 line6->process_message = line6_variax_process_message; 165 164 line6->disconnect = line6_variax_disconnect; ··· 170 171 171 172 if (variax->buffer_activate == NULL) 172 173 return -ENOMEM; 173 - 174 - /* initialize MIDI subsystem: */ 175 - err = line6_init_midi(&variax->line6); 176 - if (err < 0) 177 - return err; 178 174 179 175 /* initiate startup procedure: */ 180 176 schedule_delayed_work(&line6->startup_work,
+1 -1
sound/usb/mixer_quirks.c
··· 3060 3060 case USB_ID(0x1235, 0x8203): /* Focusrite Scarlett 6i6 2nd Gen */ 3061 3061 case USB_ID(0x1235, 0x8204): /* Focusrite Scarlett 18i8 2nd Gen */ 3062 3062 case USB_ID(0x1235, 0x8201): /* Focusrite Scarlett 18i20 2nd Gen */ 3063 - err = snd_scarlett_gen2_controls_create(mixer); 3063 + err = snd_scarlett_gen2_init(mixer); 3064 3064 break; 3065 3065 3066 3066 case USB_ID(0x041e, 0x323b): /* Creative Sound Blaster E1 */
+51 -30
sound/usb/mixer_scarlett_gen2.c
··· 635 635 /* send a second message to get the response */ 636 636 637 637 err = snd_usb_ctl_msg(mixer->chip->dev, 638 - usb_sndctrlpipe(mixer->chip->dev, 0), 638 + usb_rcvctrlpipe(mixer->chip->dev, 0), 639 639 SCARLETT2_USB_VENDOR_SPECIFIC_CMD_RESP, 640 640 USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_IN, 641 641 0, ··· 1997 1997 return usb_submit_urb(mixer->urb, GFP_KERNEL); 1998 1998 } 1999 1999 2000 - /* Entry point */ 2001 - int snd_scarlett_gen2_controls_create(struct usb_mixer_interface *mixer) 2000 + static int snd_scarlett_gen2_controls_create(struct usb_mixer_interface *mixer, 2001 + const struct scarlett2_device_info *info) 2002 2002 { 2003 - const struct scarlett2_device_info *info; 2004 2003 int err; 2005 - 2006 - /* only use UAC_VERSION_2 */ 2007 - if (!mixer->protocol) 2008 - return 0; 2009 - 2010 - switch (mixer->chip->usb_id) { 2011 - case USB_ID(0x1235, 0x8203): 2012 - info = &s6i6_gen2_info; 2013 - break; 2014 - case USB_ID(0x1235, 0x8204): 2015 - info = &s18i8_gen2_info; 2016 - break; 2017 - case USB_ID(0x1235, 0x8201): 2018 - info = &s18i20_gen2_info; 2019 - break; 2020 - default: /* device not (yet) supported */ 2021 - return -EINVAL; 2022 - } 2023 - 2024 - if (!(mixer->chip->setup & SCARLETT2_ENABLE)) { 2025 - usb_audio_err(mixer->chip, 2026 - "Focusrite Scarlett Gen 2 Mixer Driver disabled; " 2027 - "use options snd_usb_audio device_setup=1 " 2028 - "to enable and report any issues to g@b4.vu"); 2029 - return 0; 2030 - } 2031 2004 2032 2005 /* Initialise private data, routing, sequence number */ 2033 2006 err = scarlett2_init_private(mixer, info); ··· 2045 2072 } 2046 2073 2047 2074 return 0; 2075 + } 2076 + 2077 + int snd_scarlett_gen2_init(struct usb_mixer_interface *mixer) 2078 + { 2079 + struct snd_usb_audio *chip = mixer->chip; 2080 + const struct scarlett2_device_info *info; 2081 + int err; 2082 + 2083 + /* only use UAC_VERSION_2 */ 2084 + if (!mixer->protocol) 2085 + return 0; 2086 + 2087 + switch (chip->usb_id) { 2088 + case USB_ID(0x1235, 0x8203): 2089 + info = &s6i6_gen2_info; 2090 + break; 2091 + case USB_ID(0x1235, 0x8204): 2092 + info = &s18i8_gen2_info; 2093 + break; 2094 + case USB_ID(0x1235, 0x8201): 2095 + info = &s18i20_gen2_info; 2096 + break; 2097 + default: /* device not (yet) supported */ 2098 + return -EINVAL; 2099 + } 2100 + 2101 + if (!(chip->setup & SCARLETT2_ENABLE)) { 2102 + usb_audio_info(chip, 2103 + "Focusrite Scarlett Gen 2 Mixer Driver disabled; " 2104 + "use options snd_usb_audio vid=0x%04x pid=0x%04x " 2105 + "device_setup=1 to enable and report any issues " 2106 + "to g@b4.vu", 2107 + USB_ID_VENDOR(chip->usb_id), 2108 + USB_ID_PRODUCT(chip->usb_id)); 2109 + return 0; 2110 + } 2111 + 2112 + usb_audio_info(chip, 2113 + "Focusrite Scarlett Gen 2 Mixer Driver enabled pid=0x%04x", 2114 + USB_ID_PRODUCT(chip->usb_id)); 2115 + 2116 + err = snd_scarlett_gen2_controls_create(mixer, info); 2117 + if (err < 0) 2118 + usb_audio_err(mixer->chip, 2119 + "Error initialising Scarlett Mixer Driver: %d", 2120 + err); 2121 + 2122 + return err; 2048 2123 }
+1 -1
sound/usb/mixer_scarlett_gen2.h
··· 2 2 #ifndef __USB_MIXER_SCARLETT_GEN2_H 3 3 #define __USB_MIXER_SCARLETT_GEN2_H 4 4 5 - int snd_scarlett_gen2_controls_create(struct usb_mixer_interface *mixer); 5 + int snd_scarlett_gen2_init(struct usb_mixer_interface *mixer); 6 6 7 7 #endif /* __USB_MIXER_SCARLETT_GEN2_H */