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

Configure Feed

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

Merge tag 'sound-fix-6.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
"A collection of small fixes:

- Lots of ASoC SOF fixes and related reworks

- ASoC TAS codec fixes including DT updates

- A few HD-audio quirks and regression fixes

- Minor fixes for aloop, oxygen and scarlett2 mixer"

* tag 'sound-fix-6.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (23 commits)
ALSA: hda/realtek: Enable headset mic on Lenovo M70 Gen5
ALSA: hda/realtek: Enable mute/micmute LEDs and limit mic boost on HP ZBook
ALSA: hda/relatek: Enable Mute LED on HP Laptop 15s-fq2xxx
ASoC: SOF: ipc4-loader: remove the CPC check warnings
ASoC: SOF: ipc4-pcm: remove log message for LLP
ALSA: hda: generic: Remove obsolete call to ledtrig_audio_get
ALSA: scarlett2: Fix yet more -Wformat-truncation warnings
ALSA: hda: Properly setup HDMI stream
ASoC: audio-graph-card2: fix index check on graph_parse_node_multi_nm()
ASoC: SOF: icp3-dtrace: Revert "Fix wrong kfree() usage"
ALSA: oxygen: Fix right channel of capture volume mixer
ALSA: aloop: Introduce a function to get if access is interleaved mode
ASoC: mediatek: sof-common: Add NULL check for normal_link string
ASoC: mediatek: mt8195: Remove afe-dai component and rework codec link
ASoC: mediatek: mt8192: Check existence of dai_name before dereferencing
ASoC: Intel: bxt_rt298: Fix kernel ops due to COMP_DUMMY change
ASoC: Intel: bxt_da7219_max98357a: Fix kernel ops due to COMP_DUMMY change
ASoC: codecs: rtq9128: Fix TDM enable and DAI format control flow
ASoC: codecs: rtq9128: Fix PM_RUNTIME usage
ASoC: tas2781: Add tas2563 into driver
...

+209 -149
-2
Documentation/devicetree/bindings/sound/tas2562.yaml
··· 18 18 19 19 Specifications about the audio amplifier can be found at: 20 20 https://www.ti.com/lit/gpn/tas2562 21 - https://www.ti.com/lit/gpn/tas2563 22 21 https://www.ti.com/lit/gpn/tas2564 23 22 https://www.ti.com/lit/gpn/tas2110 24 23 ··· 28 29 compatible: 29 30 enum: 30 31 - ti,tas2562 31 - - ti,tas2563 32 32 - ti,tas2564 33 33 - ti,tas2110 34 34
+63 -15
Documentation/devicetree/bindings/sound/ti,tas2781.yaml
··· 5 5 $id: http://devicetree.org/schemas/sound/ti,tas2781.yaml# 6 6 $schema: http://devicetree.org/meta-schemas/core.yaml# 7 7 8 - title: Texas Instruments TAS2781 SmartAMP 8 + title: Texas Instruments TAS2563/TAS2781 SmartAMP 9 9 10 10 maintainers: 11 11 - Shenghao Ding <shenghao-ding@ti.com> 12 12 13 - description: 14 - The TAS2781 is a mono, digital input Class-D audio amplifier 15 - optimized for efficiently driving high peak power into small 16 - loudspeakers. An integrated on-chip DSP supports Texas Instruments 17 - Smart Amp speaker protection algorithm. The integrated speaker 18 - voltage and current sense provides for real time 13 + description: | 14 + The TAS2563/TAS2781 is a mono, digital input Class-D audio 15 + amplifier optimized for efficiently driving high peak power into 16 + small loudspeakers. An integrated on-chip DSP supports Texas 17 + Instruments Smart Amp speaker protection algorithm. The 18 + integrated speaker voltage and current sense provides for real time 19 19 monitoring of loudspeaker behavior. 20 20 21 - allOf: 22 - - $ref: dai-common.yaml# 21 + Specifications about the audio amplifier can be found at: 22 + https://www.ti.com/lit/gpn/tas2563 23 + https://www.ti.com/lit/gpn/tas2781 23 24 24 25 properties: 25 26 compatible: 26 - enum: 27 - - ti,tas2781 27 + description: | 28 + ti,tas2563: 6.1-W Boosted Class-D Audio Amplifier With Integrated 29 + DSP and IV Sense, 16/20/24/32bit stereo I2S or multichannel TDM. 30 + 31 + ti,tas2781: 24-V Class-D Amplifier with Real Time Integrated Speaker 32 + Protection and Audio Processing, 16/20/24/32bit stereo I2S or 33 + multichannel TDM. 34 + oneOf: 35 + - items: 36 + - enum: 37 + - ti,tas2563 38 + - const: ti,tas2781 39 + - enum: 40 + - ti,tas2781 28 41 29 42 reg: 30 43 description: 31 - I2C address, in multiple tas2781s case, all the i2c address 44 + I2C address, in multiple-AMP case, all the i2c address 32 45 aggregate as one Audio Device to support multiple audio slots. 33 46 maxItems: 8 34 47 minItems: 1 35 - items: 36 - minimum: 0x38 37 - maximum: 0x3f 38 48 39 49 reset-gpios: 40 50 maxItems: 1 ··· 58 48 required: 59 49 - compatible 60 50 - reg 51 + 52 + allOf: 53 + - $ref: dai-common.yaml# 54 + - if: 55 + properties: 56 + compatible: 57 + contains: 58 + enum: 59 + - ti,tas2563 60 + then: 61 + properties: 62 + reg: 63 + description: 64 + I2C address, in multiple-AMP case, all the i2c address 65 + aggregate as one Audio Device to support multiple audio slots. 66 + maxItems: 4 67 + minItems: 1 68 + items: 69 + minimum: 0x4c 70 + maximum: 0x4f 71 + 72 + - if: 73 + properties: 74 + compatible: 75 + contains: 76 + enum: 77 + - ti,tas2781 78 + then: 79 + properties: 80 + reg: 81 + description: 82 + I2C address, in multiple-AMP case, all the i2c address 83 + aggregate as one Audio Device to support multiple audio slots. 84 + maxItems: 8 85 + minItems: 1 86 + items: 87 + minimum: 0x38 88 + maximum: 0x3f 61 89 62 90 additionalProperties: false 63 91
+5 -4
include/sound/tas2781.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 2 // 3 - // ALSA SoC Texas Instruments TAS2781 Audio Smart Amplifier 3 + // ALSA SoC Texas Instruments TAS2563/TAS2781 Audio Smart Amplifier 4 4 // 5 5 // Copyright (C) 2022 - 2023 Texas Instruments Incorporated 6 6 // https://www.ti.com 7 7 // 8 - // The TAS2781 driver implements a flexible and configurable 8 + // The TAS2563/TAS2781 driver implements a flexible and configurable 9 9 // algo coefficient setting for one, two, or even multiple 10 - // TAS2781 chips. 10 + // TAS2563/TAS2781 chips. 11 11 // 12 12 // Author: Shenghao Ding <shenghao-ding@ti.com> 13 13 // Author: Kevin Lu <kevin-lu@ti.com> ··· 60 60 #define TASDEVICE_CMD_FIELD_W 0x4 61 61 62 62 enum audio_device { 63 - TAS2781 = 0, 63 + TAS2563, 64 + TAS2781, 64 65 }; 65 66 66 67 enum device_catlog_id {
+17 -6
sound/drivers/aloop.c
··· 322 322 return 0; 323 323 } 324 324 325 + static bool is_access_interleaved(snd_pcm_access_t access) 326 + { 327 + switch (access) { 328 + case SNDRV_PCM_ACCESS_MMAP_INTERLEAVED: 329 + case SNDRV_PCM_ACCESS_RW_INTERLEAVED: 330 + return true; 331 + default: 332 + return false; 333 + } 334 + }; 335 + 325 336 static int loopback_check_format(struct loopback_cable *cable, int stream) 326 337 { 327 338 struct snd_pcm_runtime *runtime, *cruntime; ··· 352 341 check = runtime->format != cruntime->format || 353 342 runtime->rate != cruntime->rate || 354 343 runtime->channels != cruntime->channels || 355 - runtime->access != cruntime->access; 344 + is_access_interleaved(runtime->access) != 345 + is_access_interleaved(cruntime->access); 356 346 if (!check) 357 347 return 0; 358 348 if (stream == SNDRV_PCM_STREAM_CAPTURE) { ··· 381 369 &setup->channels_id); 382 370 setup->channels = runtime->channels; 383 371 } 384 - if (setup->access != runtime->access) { 372 + if (is_access_interleaved(setup->access) != 373 + is_access_interleaved(runtime->access)) { 385 374 snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_VALUE, 386 375 &setup->access_id); 387 376 setup->access = runtime->access; ··· 597 584 size = play->pcm_buffer_size - src_off; 598 585 if (dst_off + size > capt->pcm_buffer_size) 599 586 size = capt->pcm_buffer_size - dst_off; 600 - if (runtime->access == SNDRV_PCM_ACCESS_RW_NONINTERLEAVED || 601 - runtime->access == SNDRV_PCM_ACCESS_MMAP_NONINTERLEAVED) 587 + if (!is_access_interleaved(runtime->access)) 602 588 copy_play_buf_part_n(play, capt, size, src_off, dst_off); 603 589 else 604 590 memcpy(dst + dst_off, src + src_off, size); ··· 1556 1544 mutex_lock(&loopback->cable_lock); 1557 1545 access = loopback->setup[kcontrol->id.subdevice][kcontrol->id.device].access; 1558 1546 1559 - ucontrol->value.enumerated.item[0] = access == SNDRV_PCM_ACCESS_RW_NONINTERLEAVED || 1560 - access == SNDRV_PCM_ACCESS_MMAP_NONINTERLEAVED; 1547 + ucontrol->value.enumerated.item[0] = !is_access_interleaved(access); 1561 1548 1562 1549 mutex_unlock(&loopback->cable_lock); 1563 1550 return 0;
-1
sound/pci/hda/hda_generic.c
··· 3946 3946 cdev->max_brightness = 1; 3947 3947 cdev->default_trigger = micmute ? "audio-micmute" : "audio-mute"; 3948 3948 cdev->brightness_set_blocking = callback; 3949 - cdev->brightness = ledtrig_audio_get(idx); 3950 3949 cdev->flags = LED_CORE_SUSPENDRESUME; 3951 3950 3952 3951 err = led_classdev_register(&codec->core.dev, cdev);
+6
sound/pci/hda/patch_hdmi.c
··· 2301 2301 codec_dbg(codec, "hdmi: pcm_num set to %d\n", pcm_num); 2302 2302 2303 2303 for (idx = 0; idx < pcm_num; idx++) { 2304 + struct hdmi_spec_per_cvt *per_cvt; 2304 2305 struct hda_pcm *info; 2305 2306 struct hda_pcm_stream *pstr; 2306 2307 ··· 2317 2316 pstr = &info->stream[SNDRV_PCM_STREAM_PLAYBACK]; 2318 2317 pstr->substreams = 1; 2319 2318 pstr->ops = generic_ops; 2319 + 2320 + per_cvt = get_cvt(spec, 0); 2321 + pstr->channels_min = per_cvt->channels_min; 2322 + pstr->channels_max = per_cvt->channels_max; 2323 + 2320 2324 /* pcm number is less than pcm_rec array size */ 2321 2325 if (spec->pcm_used >= ARRAY_SIZE(spec->pcm_rec)) 2322 2326 break;
+3
sound/pci/hda/patch_realtek.c
··· 9861 9861 SND_PCI_QUIRK(0x103c, 0x87f5, "HP", ALC287_FIXUP_HP_GPIO_LED), 9862 9862 SND_PCI_QUIRK(0x103c, 0x87f6, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP), 9863 9863 SND_PCI_QUIRK(0x103c, 0x87f7, "HP Spectre x360 14", ALC245_FIXUP_HP_X360_AMP), 9864 + SND_PCI_QUIRK(0x103c, 0x87fe, "HP Laptop 15s-fq2xxx", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), 9864 9865 SND_PCI_QUIRK(0x103c, 0x8805, "HP ProBook 650 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), 9865 9866 SND_PCI_QUIRK(0x103c, 0x880d, "HP EliteBook 830 G8 Notebook PC", ALC285_FIXUP_HP_GPIO_LED), 9866 9867 SND_PCI_QUIRK(0x103c, 0x8811, "HP Spectre x360 15-eb1xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1), ··· 9956 9955 SND_PCI_QUIRK(0x103c, 0x8c71, "HP EliteBook 845 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), 9957 9956 SND_PCI_QUIRK(0x103c, 0x8c72, "HP EliteBook 865 G11", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), 9958 9957 SND_PCI_QUIRK(0x103c, 0x8c96, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 9958 + SND_PCI_QUIRK(0x103c, 0x8c97, "HP ZBook", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 9959 9959 SND_PCI_QUIRK(0x103c, 0x8ca4, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 9960 9960 SND_PCI_QUIRK(0x103c, 0x8ca7, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 9961 9961 SND_PCI_QUIRK(0x103c, 0x8cf5, "HP ZBook Studio 16", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED), ··· 10233 10231 SND_PCI_QUIRK(0x17aa, 0x3176, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), 10234 10232 SND_PCI_QUIRK(0x17aa, 0x3178, "ThinkCentre Station", ALC283_FIXUP_HEADSET_MIC), 10235 10233 SND_PCI_QUIRK(0x17aa, 0x31af, "ThinkCentre Station", ALC623_FIXUP_LENOVO_THINKSTATION_P340), 10234 + SND_PCI_QUIRK(0x17aa, 0x334b, "Lenovo ThinkCentre M70 Gen5", ALC283_FIXUP_HEADSET_MIC), 10236 10235 SND_PCI_QUIRK(0x17aa, 0x3801, "Lenovo Yoga9 14IAP7", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN), 10237 10236 SND_PCI_QUIRK(0x17aa, 0x3802, "Lenovo Yoga DuetITL 2021", ALC287_FIXUP_YOGA7_14ITL_SPEAKERS), 10238 10237 SND_PCI_QUIRK(0x17aa, 0x3813, "Legion 7i 15IMHG05", ALC287_FIXUP_LEGION_15IMHG05_SPEAKERS),
+1 -1
sound/pci/oxygen/oxygen_mixer.c
··· 718 718 oldreg = oxygen_read_ac97(chip, 1, AC97_REC_GAIN); 719 719 newreg = oldreg & ~0x0707; 720 720 newreg = newreg | (value->value.integer.value[0] & 7); 721 - newreg = newreg | ((value->value.integer.value[0] & 7) << 8); 721 + newreg = newreg | ((value->value.integer.value[1] & 7) << 8); 722 722 change = newreg != oldreg; 723 723 if (change) 724 724 oxygen_write_ac97(chip, 1, AC97_REC_GAIN, newreg);
+41 -32
sound/soc/codecs/rtq9128.c
··· 59 59 60 60 struct rtq9128_data { 61 61 struct gpio_desc *enable; 62 + unsigned int daifmt; 62 63 int tdm_slots; 63 64 int tdm_slot_width; 64 65 bool tdm_input_data2_select; ··· 392 391 unsigned int val; 393 392 int i, ret; 394 393 395 - pm_runtime_resume_and_get(comp->dev); 394 + ret = pm_runtime_resume_and_get(comp->dev); 395 + if (ret < 0) { 396 + dev_err(comp->dev, "Failed to resume device (%d)\n", ret); 397 + return ret; 398 + } 396 399 397 400 val = snd_soc_component_read(comp, RTQ9128_REG_EFUSE_DATA); 398 401 ··· 442 437 static int rtq9128_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) 443 438 { 444 439 struct rtq9128_data *data = snd_soc_dai_get_drvdata(dai); 445 - struct snd_soc_component *comp = dai->component; 446 440 struct device *dev = dai->dev; 447 - unsigned int audfmt, fmtval; 448 - int ret; 449 441 450 442 dev_dbg(dev, "%s: fmt 0x%8x\n", __func__, fmt); 451 443 ··· 452 450 return -EINVAL; 453 451 } 454 452 455 - fmtval = fmt & SND_SOC_DAIFMT_FORMAT_MASK; 456 - if (data->tdm_slots && fmtval != SND_SOC_DAIFMT_DSP_A && fmtval != SND_SOC_DAIFMT_DSP_B) { 457 - dev_err(dev, "TDM is used, format only support DSP_A or DSP_B\n"); 458 - return -EINVAL; 459 - } 453 + /* Store here and will be used in runtime hw_params for DAI format setting */ 454 + data->daifmt = fmt; 460 455 461 - switch (fmtval) { 462 - case SND_SOC_DAIFMT_I2S: 463 - audfmt = 8; 464 - break; 465 - case SND_SOC_DAIFMT_LEFT_J: 466 - audfmt = 9; 467 - break; 468 - case SND_SOC_DAIFMT_RIGHT_J: 469 - audfmt = 10; 470 - break; 471 - case SND_SOC_DAIFMT_DSP_A: 472 - audfmt = data->tdm_slots ? 12 : 11; 473 - break; 474 - case SND_SOC_DAIFMT_DSP_B: 475 - audfmt = data->tdm_slots ? 4 : 3; 476 - break; 477 - default: 478 - dev_err(dev, "Unsupported format 0x%8x\n", fmt); 479 - return -EINVAL; 480 - } 481 - 482 - ret = snd_soc_component_write_field(comp, RTQ9128_REG_I2S_OPT, RTQ9128_AUDFMT_MASK, audfmt); 483 - return ret < 0 ? ret : 0; 456 + return 0; 484 457 } 485 458 486 459 static int rtq9128_dai_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask, ··· 531 554 unsigned int width, slot_width, bitrate, audbit, dolen; 532 555 struct snd_soc_component *comp = dai->component; 533 556 struct device *dev = dai->dev; 557 + unsigned int fmtval, audfmt; 534 558 int ret; 535 559 536 560 dev_dbg(dev, "%s: width %d\n", __func__, params_width(param)); 561 + 562 + fmtval = FIELD_GET(SND_SOC_DAIFMT_FORMAT_MASK, data->daifmt); 563 + if (data->tdm_slots && fmtval != SND_SOC_DAIFMT_DSP_A && fmtval != SND_SOC_DAIFMT_DSP_B) { 564 + dev_err(dev, "TDM is used, format only support DSP_A or DSP_B\n"); 565 + return -EINVAL; 566 + } 567 + 568 + switch (fmtval) { 569 + case SND_SOC_DAIFMT_I2S: 570 + audfmt = 8; 571 + break; 572 + case SND_SOC_DAIFMT_LEFT_J: 573 + audfmt = 9; 574 + break; 575 + case SND_SOC_DAIFMT_RIGHT_J: 576 + audfmt = 10; 577 + break; 578 + case SND_SOC_DAIFMT_DSP_A: 579 + audfmt = data->tdm_slots ? 12 : 11; 580 + break; 581 + case SND_SOC_DAIFMT_DSP_B: 582 + audfmt = data->tdm_slots ? 4 : 3; 583 + break; 584 + default: 585 + dev_err(dev, "Unsupported format 0x%8x\n", fmtval); 586 + return -EINVAL; 587 + } 537 588 538 589 switch (width = params_width(param)) { 539 590 case 16: ··· 615 610 dev_err(dev, "Unsupported slot width (%d)\n", slot_width); 616 611 return -EINVAL; 617 612 } 613 + 614 + ret = snd_soc_component_write_field(comp, RTQ9128_REG_I2S_OPT, RTQ9128_AUDFMT_MASK, audfmt); 615 + if (ret < 0) 616 + return ret; 618 617 619 618 ret = snd_soc_component_write_field(comp, RTQ9128_REG_I2S_OPT, RTQ9128_AUDBIT_MASK, audbit); 620 619 if (ret < 0)
-3
sound/soc/codecs/tas2562.c
··· 59 59 60 60 enum tas256x_model { 61 61 TAS2562, 62 - TAS2563, 63 62 TAS2564, 64 63 TAS2110, 65 64 }; ··· 720 721 721 722 static const struct i2c_device_id tas2562_id[] = { 722 723 { "tas2562", TAS2562 }, 723 - { "tas2563", TAS2563 }, 724 724 { "tas2564", TAS2564 }, 725 725 { "tas2110", TAS2110 }, 726 726 { } ··· 768 770 #ifdef CONFIG_OF 769 771 static const struct of_device_id tas2562_of_match[] = { 770 772 { .compatible = "ti,tas2562", }, 771 - { .compatible = "ti,tas2563", }, 772 773 { .compatible = "ti,tas2564", }, 773 774 { .compatible = "ti,tas2110", }, 774 775 { },
+5 -3
sound/soc/codecs/tas2781-i2c.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 // 3 - // ALSA SoC Texas Instruments TAS2781 Audio Smart Amplifier 3 + // ALSA SoC Texas Instruments TAS2563/TAS2781 Audio Smart Amplifier 4 4 // 5 5 // Copyright (C) 2022 - 2023 Texas Instruments Incorporated 6 6 // https://www.ti.com 7 7 // 8 - // The TAS2781 driver implements a flexible and configurable 8 + // The TAS2563/TAS2781 driver implements a flexible and configurable 9 9 // algo coefficient setting for one, two, or even multiple 10 - // TAS2781 chips. 10 + // TAS2563/TAS2781 chips. 11 11 // 12 12 // Author: Shenghao Ding <shenghao-ding@ti.com> 13 13 // Author: Kevin Lu <kevin-lu@ti.com> ··· 32 32 #include <sound/tas2781-tlv.h> 33 33 34 34 static const struct i2c_device_id tasdevice_id[] = { 35 + { "tas2563", TAS2563 }, 35 36 { "tas2781", TAS2781 }, 36 37 {} 37 38 }; ··· 40 39 41 40 #ifdef CONFIG_OF 42 41 static const struct of_device_id tasdevice_of_match[] = { 42 + { .compatible = "ti,tas2563" }, 43 43 { .compatible = "ti,tas2781" }, 44 44 {}, 45 45 };
+1 -1
sound/soc/generic/audio-graph-card2.c
··· 556 556 struct device_node *mcodec_port; 557 557 int codec_idx; 558 558 559 - if (*nm_idx >= nm_max) 559 + if (*nm_idx > nm_max) 560 560 break; 561 561 562 562 mcpu_ep_n = of_get_next_child(mcpu_port, mcpu_ep_n);
+6
sound/soc/intel/boards/bxt_da7219_max98357a.c
··· 797 797 broxton_audio_card.name = "glkda7219max"; 798 798 /* Fixup the SSP entries for geminilake */ 799 799 for (i = 0; i < ARRAY_SIZE(broxton_dais); i++) { 800 + if (!broxton_dais[i].codecs->dai_name) 801 + continue; 802 + 800 803 /* MAXIM_CODEC is connected to SSP1. */ 801 804 if (!strcmp(broxton_dais[i].codecs->dai_name, 802 805 BXT_MAXIM_CODEC_DAI)) { ··· 825 822 broxton_audio_card.name = "cmlda7219max"; 826 823 827 824 for (i = 0; i < ARRAY_SIZE(broxton_dais); i++) { 825 + if (!broxton_dais[i].codecs->dai_name) 826 + continue; 827 + 828 828 /* MAXIM_CODEC is connected to SSP1. */ 829 829 if (!strcmp(broxton_dais[i].codecs->dai_name, 830 830 BXT_MAXIM_CODEC_DAI)) {
+2 -1
sound/soc/intel/boards/bxt_rt298.c
··· 604 604 int i; 605 605 606 606 for (i = 0; i < ARRAY_SIZE(broxton_rt298_dais); i++) { 607 - if (!strncmp(card->dai_link[i].codecs->name, "i2c-INT343A:00", 607 + if (card->dai_link[i].codecs->name && 608 + !strncmp(card->dai_link[i].codecs->name, "i2c-INT343A:00", 608 609 I2C_NAME_SIZE)) { 609 610 if (!strncmp(card->name, "broxton-rt298", 610 611 PLATFORM_NAME_SIZE)) {
+1 -1
sound/soc/mediatek/common/mtk-dsp-sof-common.c
··· 24 24 struct snd_soc_dai_link *sof_dai_link = NULL; 25 25 const struct sof_conn_stream *conn = &sof_priv->conn_streams[i]; 26 26 27 - if (strcmp(rtd->dai_link->name, conn->normal_link)) 27 + if (conn->normal_link && strcmp(rtd->dai_link->name, conn->normal_link)) 28 28 continue; 29 29 30 30 for_each_card_rtds(card, runtime) {
+2 -1
sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c
··· 1208 1208 dai_link->ignore = 0; 1209 1209 } 1210 1210 1211 - if (strcmp(dai_link->codecs[0].dai_name, RT1015_CODEC_DAI) == 0) 1211 + if (dai_link->num_codecs && dai_link->codecs[0].dai_name && 1212 + strcmp(dai_link->codecs[0].dai_name, RT1015_CODEC_DAI) == 0) 1212 1213 dai_link->ops = &mt8192_rt1015_i2s_ops; 1213 1214 1214 1215 if (!dai_link->platforms->name)
+1 -32
sound/soc/mediatek/mt8195/mt8195-afe-pcm.c
··· 1795 1795 MT8195_AFE_IRQ_28), 1796 1796 }; 1797 1797 1798 - static const struct snd_soc_component_driver mt8195_afe_pcm_dai_component = { 1799 - .name = "mt8195-afe-pcm-dai", 1800 - }; 1801 - 1802 1798 static const struct mtk_base_memif_data memif_data[MT8195_AFE_MEMIF_NUM] = { 1803 1799 [MT8195_AFE_MEMIF_DL2] = { 1804 1800 .name = "DL2", ··· 3033 3037 struct device *dev = &pdev->dev; 3034 3038 struct reset_control *rstc; 3035 3039 int i, irq_id, ret; 3036 - struct snd_soc_component *component; 3037 3040 3038 3041 ret = of_reserved_mem_device_init(dev); 3039 3042 if (ret) ··· 3165 3170 3166 3171 /* register component */ 3167 3172 ret = devm_snd_soc_register_component(dev, &mt8195_afe_component, 3168 - NULL, 0); 3173 + afe->dai_drivers, afe->num_dai_drivers); 3169 3174 if (ret) { 3170 3175 dev_warn(dev, "err_platform\n"); 3171 - goto err_pm_put; 3172 - } 3173 - 3174 - component = devm_kzalloc(dev, sizeof(*component), GFP_KERNEL); 3175 - if (!component) { 3176 - ret = -ENOMEM; 3177 - goto err_pm_put; 3178 - } 3179 - 3180 - ret = snd_soc_component_initialize(component, 3181 - &mt8195_afe_pcm_dai_component, 3182 - dev); 3183 - if (ret) 3184 - goto err_pm_put; 3185 - 3186 - #ifdef CONFIG_DEBUG_FS 3187 - component->debugfs_prefix = "pcm"; 3188 - #endif 3189 - 3190 - ret = snd_soc_add_component(component, 3191 - afe->dai_drivers, 3192 - afe->num_dai_drivers); 3193 - if (ret) { 3194 - dev_warn(dev, "err_dai_component\n"); 3195 3176 goto err_pm_put; 3196 3177 } 3197 3178 ··· 3195 3224 3196 3225 static void mt8195_afe_pcm_dev_remove(struct platform_device *pdev) 3197 3226 { 3198 - snd_soc_unregister_component(&pdev->dev); 3199 - 3200 3227 pm_runtime_disable(&pdev->dev); 3201 3228 if (!pm_runtime_status_suspended(&pdev->dev)) 3202 3229 mt8195_afe_runtime_suspend(&pdev->dev);
+28 -13
sound/soc/mediatek/mt8195/mt8195-mt6359.c
··· 934 934 935 935 SND_SOC_DAILINK_DEFS(ETDM2_IN_BE, 936 936 DAILINK_COMP_ARRAY(COMP_CPU("ETDM2_IN")), 937 - DAILINK_COMP_ARRAY(COMP_DUMMY()), 937 + DAILINK_COMP_ARRAY(COMP_EMPTY()), 938 938 DAILINK_COMP_ARRAY(COMP_EMPTY())); 939 939 940 940 SND_SOC_DAILINK_DEFS(ETDM1_OUT_BE, 941 941 DAILINK_COMP_ARRAY(COMP_CPU("ETDM1_OUT")), 942 - DAILINK_COMP_ARRAY(COMP_DUMMY()), 943 942 DAILINK_COMP_ARRAY(COMP_EMPTY())); 944 943 945 944 SND_SOC_DAILINK_DEFS(ETDM2_OUT_BE, ··· 1236 1237 SND_SOC_DAIFMT_NB_NF | 1237 1238 SND_SOC_DAIFMT_CBS_CFS, 1238 1239 .dpcm_capture = 1, 1239 - .init = mt8195_rt5682_init, 1240 - .ops = &mt8195_rt5682_etdm_ops, 1241 1240 .be_hw_params_fixup = mt8195_etdm_hw_params_fixup, 1242 1241 SND_SOC_DAILINK_REG(ETDM2_IN_BE), 1243 1242 }, ··· 1246 1249 SND_SOC_DAIFMT_NB_NF | 1247 1250 SND_SOC_DAIFMT_CBS_CFS, 1248 1251 .dpcm_playback = 1, 1249 - .ops = &mt8195_rt5682_etdm_ops, 1250 1252 .be_hw_params_fixup = mt8195_etdm_hw_params_fixup, 1251 1253 SND_SOC_DAILINK_REG(ETDM1_OUT_BE), 1252 1254 }, ··· 1377 1381 struct snd_soc_dai_link *dai_link; 1378 1382 struct mtk_soc_card_data *soc_card_data; 1379 1383 struct mt8195_mt6359_priv *mach_priv; 1380 - struct device_node *platform_node, *adsp_node, *dp_node, *hdmi_node; 1384 + struct device_node *platform_node, *adsp_node, *codec_node, *dp_node, *hdmi_node; 1381 1385 struct mt8195_card_data *card_data; 1382 1386 int is5682s = 0; 1383 1387 int init6359 = 0; ··· 1397 1401 if (!card->name) 1398 1402 card->name = card_data->name; 1399 1403 1400 - if (strstr(card->name, "_5682s")) 1404 + if (strstr(card->name, "_5682s")) { 1405 + codec_node = of_find_compatible_node(NULL, NULL, "realtek,rt5682s"); 1401 1406 is5682s = 1; 1407 + } else 1408 + codec_node = of_find_compatible_node(NULL, NULL, "realtek,rt5682i"); 1409 + 1402 1410 soc_card_data = devm_kzalloc(&pdev->dev, sizeof(*card_data), GFP_KERNEL); 1403 1411 if (!soc_card_data) 1404 1412 return -ENOMEM; ··· 1488 1488 dai_link->codecs->dai_name = "i2s-hifi"; 1489 1489 dai_link->init = mt8195_hdmi_codec_init; 1490 1490 } 1491 - } else if (strcmp(dai_link->name, "ETDM1_OUT_BE") == 0 || 1492 - strcmp(dai_link->name, "ETDM2_IN_BE") == 0) { 1493 - dai_link->codecs->name = 1494 - is5682s ? RT5682S_DEV0_NAME : RT5682_DEV0_NAME; 1495 - dai_link->codecs->dai_name = 1496 - is5682s ? RT5682S_CODEC_DAI : RT5682_CODEC_DAI; 1491 + } else if (strcmp(dai_link->name, "ETDM1_OUT_BE") == 0) { 1492 + if (!codec_node) { 1493 + dev_err(&pdev->dev, "Codec not found!\n"); 1494 + } else { 1495 + dai_link->codecs->of_node = codec_node; 1496 + dai_link->codecs->name = NULL; 1497 + dai_link->codecs->dai_name = 1498 + is5682s ? RT5682S_CODEC_DAI : RT5682_CODEC_DAI; 1499 + dai_link->init = mt8195_rt5682_init; 1500 + dai_link->ops = &mt8195_rt5682_etdm_ops; 1501 + } 1502 + } else if (strcmp(dai_link->name, "ETDM2_IN_BE") == 0) { 1503 + if (!codec_node) { 1504 + dev_err(&pdev->dev, "Codec not found!\n"); 1505 + } else { 1506 + dai_link->codecs->of_node = codec_node; 1507 + dai_link->codecs->name = NULL; 1508 + dai_link->codecs->dai_name = 1509 + is5682s ? RT5682S_CODEC_DAI : RT5682_CODEC_DAI; 1510 + dai_link->ops = &mt8195_rt5682_etdm_ops; 1511 + } 1497 1512 } else if (strcmp(dai_link->name, "DL_SRC_BE") == 0 || 1498 1513 strcmp(dai_link->name, "UL_SRC1_BE") == 0 || 1499 1514 strcmp(dai_link->name, "UL_SRC2_BE") == 0) {
+1 -2
sound/soc/sof/ipc3-dtrace.c
··· 137 137 dev_err(sdev->dev, 138 138 "Parsing filter entry '%s' failed with %d\n", 139 139 entry, entry_len); 140 - kfree(*out); 141 140 return -EINVAL; 142 141 } 143 142 } ··· 208 209 ret = ipc3_trace_update_filter(sdev, num_elems, elems); 209 210 if (ret < 0) { 210 211 dev_err(sdev->dev, "Filter update failed: %d\n", ret); 211 - kfree(elems); 212 212 goto error; 213 213 } 214 214 } 215 215 ret = count; 216 216 error: 217 217 kfree(string); 218 + kfree(elems); 218 219 return ret; 219 220 } 220 221
+4 -7
sound/soc/sof/ipc4-loader.c
··· 482 482 msg = "No CPC match in the firmware file's manifest"; 483 483 484 484 no_cpc: 485 - dev_warn(sdev->dev, "%s (UUID: %pUL): %s (ibs/obs: %u/%u)\n", 486 - fw_module->man4_module_entry.name, 487 - &fw_module->man4_module_entry.uuid, msg, basecfg->ibs, 488 - basecfg->obs); 489 - dev_warn_once(sdev->dev, "Please try to update the firmware.\n"); 490 - dev_warn_once(sdev->dev, "If the issue persists, file a bug at\n"); 491 - dev_warn_once(sdev->dev, "https://github.com/thesofproject/sof/issues/\n"); 485 + dev_dbg(sdev->dev, "%s (UUID: %pUL): %s (ibs/obs: %u/%u)\n", 486 + fw_module->man4_module_entry.name, 487 + &fw_module->man4_module_entry.uuid, msg, basecfg->ibs, 488 + basecfg->obs); 492 489 } 493 490 494 491 const struct sof_ipc_fw_loader_ops ipc4_loader_ops = {
+1 -3
sound/soc/sof/ipc4-pcm.c
··· 768 768 info->llp_offset = offsetof(struct sof_ipc4_fw_registers, llp_evad_reading_slot) + 769 769 sdev->fw_info_box.offset; 770 770 sof_mailbox_read(sdev, info->llp_offset, &llp_slot, sizeof(llp_slot)); 771 - if (llp_slot.node_id != dai_copier->data.gtw_cfg.node_id) { 772 - dev_info(sdev->dev, "no llp found, fall back to default HDA path"); 771 + if (llp_slot.node_id != dai_copier->data.gtw_cfg.node_id) 773 772 info->llp_offset = 0; 774 - } 775 773 } 776 774 777 775 static int sof_ipc4_pcm_hw_params(struct snd_soc_component *component,
+21 -21
sound/usb/mixer_scarlett2.c
··· 5361 5361 if (private->vol_sw_hw_switch[index]) 5362 5362 scarlett2_vol_ctl_set_writable(mixer, i, 0); 5363 5363 5364 - snprintf(s, sizeof(s), 5365 - "Line Out %02d Volume Control Playback Enum", 5366 - i + 1); 5364 + scnprintf(s, sizeof(s), 5365 + "Line Out %02d Volume Control Playback Enum", 5366 + i + 1); 5367 5367 err = scarlett2_add_new_ctl(mixer, 5368 5368 &scarlett2_sw_hw_enum_ctl, 5369 5369 i, 1, s, ··· 5406 5406 5407 5407 /* Add input level (line/inst) controls */ 5408 5408 for (i = 0; i < info->level_input_count; i++) { 5409 - snprintf(s, sizeof(s), fmt, i + 1 + info->level_input_first, 5410 - "Level", "Enum"); 5409 + scnprintf(s, sizeof(s), fmt, i + 1 + info->level_input_first, 5410 + "Level", "Enum"); 5411 5411 err = scarlett2_add_new_ctl(mixer, &scarlett2_level_enum_ctl, 5412 5412 i, 1, s, &private->level_ctls[i]); 5413 5413 if (err < 0) ··· 5416 5416 5417 5417 /* Add input pad controls */ 5418 5418 for (i = 0; i < info->pad_input_count; i++) { 5419 - snprintf(s, sizeof(s), fmt, i + 1, "Pad", "Switch"); 5419 + scnprintf(s, sizeof(s), fmt, i + 1, "Pad", "Switch"); 5420 5420 err = scarlett2_add_new_ctl(mixer, &scarlett2_pad_ctl, 5421 5421 i, 1, s, &private->pad_ctls[i]); 5422 5422 if (err < 0) ··· 5425 5425 5426 5426 /* Add input air controls */ 5427 5427 for (i = 0; i < info->air_input_count; i++) { 5428 - snprintf(s, sizeof(s), fmt, i + 1 + info->air_input_first, 5429 - "Air", info->air_option ? "Enum" : "Switch"); 5428 + scnprintf(s, sizeof(s), fmt, i + 1 + info->air_input_first, 5429 + "Air", info->air_option ? "Enum" : "Switch"); 5430 5430 err = scarlett2_add_new_ctl( 5431 5431 mixer, &scarlett2_air_ctl[info->air_option], 5432 5432 i, 1, s, &private->air_ctls[i]); ··· 5481 5481 5482 5482 for (i = 0; i < info->gain_input_count; i++) { 5483 5483 if (i % 2) { 5484 - snprintf(s, sizeof(s), 5485 - "Line In %d-%d Link Capture Switch", 5486 - i, i + 1); 5484 + scnprintf(s, sizeof(s), 5485 + "Line In %d-%d Link Capture Switch", 5486 + i, i + 1); 5487 5487 err = scarlett2_add_new_ctl( 5488 5488 mixer, &scarlett2_input_link_ctl, 5489 5489 i / 2, 1, s, ··· 5492 5492 return err; 5493 5493 } 5494 5494 5495 - snprintf(s, sizeof(s), fmt, i + 1, 5496 - "Gain", "Volume"); 5495 + scnprintf(s, sizeof(s), fmt, i + 1, 5496 + "Gain", "Volume"); 5497 5497 err = scarlett2_add_new_ctl( 5498 5498 mixer, &scarlett2_input_gain_ctl, 5499 5499 i, 1, s, &private->input_gain_ctls[i]); 5500 5500 if (err < 0) 5501 5501 return err; 5502 5502 5503 - snprintf(s, sizeof(s), fmt, i + 1, 5504 - "Autogain", "Switch"); 5503 + scnprintf(s, sizeof(s), fmt, i + 1, 5504 + "Autogain", "Switch"); 5505 5505 err = scarlett2_add_new_ctl( 5506 5506 mixer, &scarlett2_autogain_switch_ctl, 5507 5507 i, 1, s, &private->autogain_ctls[i]); 5508 5508 if (err < 0) 5509 5509 return err; 5510 5510 5511 - snprintf(s, sizeof(s), fmt, i + 1, 5512 - "Autogain Status", "Enum"); 5511 + scnprintf(s, sizeof(s), fmt, i + 1, 5512 + "Autogain Status", "Enum"); 5513 5513 err = scarlett2_add_new_ctl( 5514 5514 mixer, &scarlett2_autogain_status_ctl, 5515 5515 i, 1, s, &private->autogain_status_ctls[i]); 5516 5516 5517 - snprintf(s, sizeof(s), fmt, i + 1, 5518 - "Safe", "Switch"); 5517 + scnprintf(s, sizeof(s), fmt, i + 1, 5518 + "Safe", "Switch"); 5519 5519 err = scarlett2_add_new_ctl( 5520 5520 mixer, &scarlett2_safe_ctl, 5521 5521 i, 1, s, &private->safe_ctls[i]); ··· 5902 5902 for (k = 0; k < private->num_mix_in; k++, index++) { 5903 5903 char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 5904 5904 5905 - snprintf(name, sizeof(name), format, 5906 - mix_type, 'A' + j, k + 1); 5905 + scnprintf(name, sizeof(name), format, 5906 + mix_type, 'A' + j, k + 1); 5907 5907 5908 5908 err = scarlett2_add_new_ctl( 5909 5909 mixer, &scarlett2_monitor_mix_ctl,