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

ASoC: Merge up fixes

Merge the fixes branch up so we can apply further AMD work.

+224 -109
+1
.mailmap
··· 416 416 TripleX Chung <xxx.phy@gmail.com> <zhongyu@18mail.cn> 417 417 Tsuneo Yoshioka <Tsuneo.Yoshioka@f-secure.com> 418 418 Tycho Andersen <tycho@tycho.pizza> <tycho@tycho.ws> 419 + Tzung-Bi Shih <tzungbi@kernel.org> <tzungbi@google.com> 419 420 Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de> 420 421 Uwe Kleine-König <u.kleine-koenig@pengutronix.de> 421 422 Uwe Kleine-König <ukleinek@strlen.de>
+1 -1
Documentation/devicetree/bindings/sound/google,cros-ec-codec.yaml
··· 8 8 9 9 maintainers: 10 10 - Cheng-Yi Chiang <cychiang@chromium.org> 11 - - Tzung-Bi Shih <tzungbi@google.com> 11 + - Tzung-Bi Shih <tzungbi@kernel.org> 12 12 13 13 description: | 14 14 Google's ChromeOS EC codec is a digital mic codec provided by the
+1 -1
Documentation/devicetree/bindings/sound/realtek,rt1015p.yaml
··· 7 7 title: Realtek rt1015p codec devicetree bindings 8 8 9 9 maintainers: 10 - - Tzung-Bi Shih <tzungbi@google.com> 10 + - Tzung-Bi Shih <tzungbi@kernel.org> 11 11 12 12 description: | 13 13 Rt1015p is a rt1015 variant which does not support I2C and
+1 -1
MAINTAINERS
··· 4911 4911 4912 4912 CHROMEOS EC CODEC DRIVER 4913 4913 M: Cheng-Yi Chiang <cychiang@chromium.org> 4914 - M: Tzung-Bi Shih <tzungbi@google.com> 4914 + M: Tzung-Bi Shih <tzungbi@kernel.org> 4915 4915 R: Guenter Roeck <groeck@chromium.org> 4916 4916 L: chrome-platform@lists.linux.dev 4917 4917 S: Maintained
+1 -1
include/sound/sof/dai.h
··· 84 84 SOF_DAI_AMD_BT, /**< AMD ACP BT*/ 85 85 SOF_DAI_AMD_SP, /**< AMD ACP SP */ 86 86 SOF_DAI_AMD_DMIC, /**< AMD ACP DMIC */ 87 - SOF_DAI_AMD_HS, /**< Amd HS */ 88 87 SOF_DAI_MEDIATEK_AFE, /**< Mediatek AFE */ 88 + SOF_DAI_AMD_HS, /**< Amd HS */ 89 89 }; 90 90 91 91 /* general purpose DAI configuration */
+4
include/sound/sof/info.h
··· 36 36 SOF_IPC_EXT_USER_ABI_INFO = 4, 37 37 }; 38 38 39 + /* Build u32 number in format MMmmmppp */ 40 + #define SOF_FW_VER(MAJOR, MINOR, PATCH) ((uint32_t)( \ 41 + ((MAJOR) << 24) | ((MINOR) << 12) | (PATCH))) 42 + 39 43 /* FW version - SOF_IPC_GLB_VERSION */ 40 44 struct sof_ipc_fw_version { 41 45 struct sof_ipc_hdr hdr;
+5
sound/hda/intel-dsp-config.c
··· 321 321 } 322 322 }, 323 323 { 324 + .flags = FLAG_SOF, 325 + .device = 0x34c8, 326 + .codec_hid = &essx_83x6, 327 + }, 328 + { 324 329 .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE, 325 330 .device = 0x34c8, 326 331 },
+7
sound/soc/amd/yc/acp6x-mach.c
··· 206 206 DMI_MATCH(DMI_PRODUCT_NAME, "UM5302TA"), 207 207 } 208 208 }, 209 + { 210 + .driver_data = &acp6x_card, 211 + .matches = { 212 + DMI_MATCH(DMI_BOARD_VENDOR, "Alienware"), 213 + DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m17 R5 AMD"), 214 + } 215 + }, 209 216 {} 210 217 }; 211 218
+1 -1
sound/soc/codecs/cs42l51.c
··· 143 143 0, 0xA0, 96, adc_att_tlv), 144 144 SOC_DOUBLE_R_SX_TLV("PGA Volume", 145 145 CS42L51_ALC_PGA_CTL, CS42L51_ALC_PGB_CTL, 146 - 0, 0x19, 30, pga_tlv), 146 + 0, 0x1A, 30, pga_tlv), 147 147 SOC_SINGLE("Playback Deemphasis Switch", CS42L51_DAC_CTL, 3, 1, 0), 148 148 SOC_SINGLE("Auto-Mute Switch", CS42L51_DAC_CTL, 2, 1, 0), 149 149 SOC_SINGLE("Soft Ramp Switch", CS42L51_DAC_CTL, 1, 1, 0),
+2 -2
sound/soc/codecs/hdac_hda.h
··· 14 14 HDAC_HDMI_1_DAI_ID, 15 15 HDAC_HDMI_2_DAI_ID, 16 16 HDAC_HDMI_3_DAI_ID, 17 - HDAC_LAST_DAI_ID = HDAC_HDMI_3_DAI_ID, 17 + HDAC_DAI_ID_NUM 18 18 }; 19 19 20 20 struct hdac_hda_pcm { ··· 24 24 25 25 struct hdac_hda_priv { 26 26 struct hda_codec *codec; 27 - struct hdac_hda_pcm pcm[HDAC_LAST_DAI_ID]; 27 + struct hdac_hda_pcm pcm[HDAC_DAI_ID_NUM]; 28 28 bool need_display_power; 29 29 }; 30 30
+4
sound/soc/codecs/max98373-i2c.c
··· 549 549 max98373->cache = devm_kcalloc(&i2c->dev, max98373->cache_num, 550 550 sizeof(*max98373->cache), 551 551 GFP_KERNEL); 552 + if (!max98373->cache) { 553 + ret = -ENOMEM; 554 + return ret; 555 + } 552 556 553 557 for (i = 0; i < max98373->cache_num; i++) 554 558 max98373->cache[i].reg = max98373_i2c_cache_reg[i];
+8 -7
sound/soc/codecs/rt5514-spi.c
··· 298 298 } 299 299 300 300 static const struct snd_soc_component_driver rt5514_spi_component = { 301 - .name = DRV_NAME, 302 - .probe = rt5514_spi_pcm_probe, 303 - .open = rt5514_spi_pcm_open, 304 - .hw_params = rt5514_spi_hw_params, 305 - .hw_free = rt5514_spi_hw_free, 306 - .pointer = rt5514_spi_pcm_pointer, 307 - .pcm_construct = rt5514_spi_pcm_new, 301 + .name = DRV_NAME, 302 + .probe = rt5514_spi_pcm_probe, 303 + .open = rt5514_spi_pcm_open, 304 + .hw_params = rt5514_spi_hw_params, 305 + .hw_free = rt5514_spi_hw_free, 306 + .pointer = rt5514_spi_pcm_pointer, 307 + .pcm_construct = rt5514_spi_pcm_new, 308 + .legacy_dai_naming = 1, 308 309 }; 309 310 310 311 /**
+10 -9
sound/soc/codecs/rt5677-spi.c
··· 396 396 } 397 397 398 398 static const struct snd_soc_component_driver rt5677_spi_dai_component = { 399 - .name = DRV_NAME, 400 - .probe = rt5677_spi_pcm_probe, 401 - .open = rt5677_spi_pcm_open, 402 - .close = rt5677_spi_pcm_close, 403 - .hw_params = rt5677_spi_hw_params, 404 - .hw_free = rt5677_spi_hw_free, 405 - .prepare = rt5677_spi_prepare, 406 - .pointer = rt5677_spi_pcm_pointer, 407 - .pcm_construct = rt5677_spi_pcm_new, 399 + .name = DRV_NAME, 400 + .probe = rt5677_spi_pcm_probe, 401 + .open = rt5677_spi_pcm_open, 402 + .close = rt5677_spi_pcm_close, 403 + .hw_params = rt5677_spi_hw_params, 404 + .hw_free = rt5677_spi_hw_free, 405 + .prepare = rt5677_spi_prepare, 406 + .pointer = rt5677_spi_pcm_pointer, 407 + .pcm_construct = rt5677_spi_pcm_new, 408 + .legacy_dai_naming = 1, 408 409 }; 409 410 410 411 /* Select a suitable transfer command for the next transfer to ensure
+1 -1
sound/soc/codecs/rt711-sdca-sdw.c
··· 230 230 } 231 231 232 232 /* set the timeout values */ 233 - prop->clk_stop_timeout = 20; 233 + prop->clk_stop_timeout = 700; 234 234 235 235 /* wake-up event */ 236 236 prop->wake_capable = 1;
+1
sound/soc/codecs/sgtl5000.c
··· 1794 1794 { 1795 1795 struct sgtl5000_priv *sgtl5000 = i2c_get_clientdata(client); 1796 1796 1797 + regmap_write(sgtl5000->regmap, SGTL5000_CHIP_CLK_CTRL, SGTL5000_CHIP_CLK_CTRL_DEFAULT); 1797 1798 regmap_write(sgtl5000->regmap, SGTL5000_CHIP_DIG_POWER, SGTL5000_DIG_POWER_DEFAULT); 1798 1799 regmap_write(sgtl5000->regmap, SGTL5000_CHIP_ANA_POWER, SGTL5000_ANA_POWER_DEFAULT); 1799 1800
+6 -13
sound/soc/codecs/tas2764.c
··· 438 438 if (tx_mask == 0 || rx_mask != 0) 439 439 return -EINVAL; 440 440 441 - if (slots == 1) { 442 - if (tx_mask != 1) 443 - return -EINVAL; 444 - left_slot = 0; 445 - right_slot = 0; 441 + left_slot = __ffs(tx_mask); 442 + tx_mask &= ~(1 << left_slot); 443 + if (tx_mask == 0) { 444 + right_slot = left_slot; 446 445 } else { 447 - left_slot = __ffs(tx_mask); 448 - tx_mask &= ~(1 << left_slot); 449 - if (tx_mask == 0) { 450 - right_slot = left_slot; 451 - } else { 452 - right_slot = __ffs(tx_mask); 453 - tx_mask &= ~(1 << right_slot); 454 - } 446 + right_slot = __ffs(tx_mask); 447 + tx_mask &= ~(1 << right_slot); 455 448 } 456 449 457 450 if (tx_mask != 0 || left_slot >= slots || right_slot >= slots)
+6 -14
sound/soc/codecs/tas2770.c
··· 395 395 if (tx_mask == 0 || rx_mask != 0) 396 396 return -EINVAL; 397 397 398 - if (slots == 1) { 399 - if (tx_mask != 1) 400 - return -EINVAL; 401 - 402 - left_slot = 0; 403 - right_slot = 0; 398 + left_slot = __ffs(tx_mask); 399 + tx_mask &= ~(1 << left_slot); 400 + if (tx_mask == 0) { 401 + right_slot = left_slot; 404 402 } else { 405 - left_slot = __ffs(tx_mask); 406 - tx_mask &= ~(1 << left_slot); 407 - if (tx_mask == 0) { 408 - right_slot = left_slot; 409 - } else { 410 - right_slot = __ffs(tx_mask); 411 - tx_mask &= ~(1 << right_slot); 412 - } 403 + right_slot = __ffs(tx_mask); 404 + tx_mask &= ~(1 << right_slot); 413 405 } 414 406 415 407 if (tx_mask != 0 || left_slot >= slots || right_slot >= slots)
+6 -13
sound/soc/codecs/tas2780.c
··· 380 380 if (tx_mask == 0 || rx_mask != 0) 381 381 return -EINVAL; 382 382 383 - if (slots == 1) { 384 - if (tx_mask != 1) 385 - return -EINVAL; 386 - left_slot = 0; 387 - right_slot = 0; 383 + left_slot = __ffs(tx_mask); 384 + tx_mask &= ~(1 << left_slot); 385 + if (tx_mask == 0) { 386 + right_slot = left_slot; 388 387 } else { 389 - left_slot = __ffs(tx_mask); 390 - tx_mask &= ~(1 << left_slot); 391 - if (tx_mask == 0) { 392 - right_slot = left_slot; 393 - } else { 394 - right_slot = __ffs(tx_mask); 395 - tx_mask &= ~(1 << right_slot); 396 - } 388 + right_slot = __ffs(tx_mask); 389 + tx_mask &= ~(1 << right_slot); 397 390 } 398 391 399 392 if (tx_mask != 0 || left_slot >= slots || right_slot >= slots)
+3
sound/soc/codecs/tlv320adc3xxx.c
··· 14 14 15 15 #include <dt-bindings/sound/tlv320adc3xxx.h> 16 16 #include <linux/clk.h> 17 + #include <linux/gpio/consumer.h> 17 18 #include <linux/module.h> 18 19 #include <linux/moduleparam.h> 19 20 #include <linux/io.h> ··· 1026 1025 1027 1026 static void adc3xxx_free_gpio(struct adc3xxx *adc3xxx) 1028 1027 { 1028 + #ifdef CONFIG_GPIOLIB 1029 1029 gpiochip_remove(&adc3xxx->gpio_chip); 1030 + #endif 1030 1031 } 1031 1032 1032 1033 static void adc3xxx_init_gpio(struct adc3xxx *adc3xxx)
+8
sound/soc/codecs/wm8962.c
··· 2503 2503 snd_soc_component_update_bits(component, WM8962_CLOCKING2, 2504 2504 WM8962_SYSCLK_ENA_MASK, WM8962_SYSCLK_ENA); 2505 2505 2506 + /* DSPCLK_DIV field in WM8962_CLOCKING1 register is used to generate 2507 + * correct frequency of LRCLK and BCLK. Sometimes the read-only value 2508 + * can't be updated timely after enabling SYSCLK. This results in wrong 2509 + * calculation values. Delay is introduced here to wait for newest 2510 + * value from register. The time of the delay should be at least 2511 + * 500~1000us according to test. 2512 + */ 2513 + usleep_range(500, 1000); 2506 2514 dspclk = snd_soc_component_read(component, WM8962_CLOCKING1); 2507 2515 2508 2516 if (snd_soc_component_get_bias_level(component) != SND_SOC_BIAS_ON)
+1 -1
sound/soc/fsl/fsl_asrc.c
··· 1232 1232 } 1233 1233 1234 1234 ret = pm_runtime_put_sync(&pdev->dev); 1235 - if (ret < 0) 1235 + if (ret < 0 && ret != -ENOSYS) 1236 1236 goto err_pm_get_sync; 1237 1237 1238 1238 ret = devm_snd_soc_register_component(&pdev->dev, &fsl_asrc_component,
+1 -1
sound/soc/fsl/fsl_esai.c
··· 1069 1069 regmap_write(esai_priv->regmap, REG_ESAI_RSMB, 0); 1070 1070 1071 1071 ret = pm_runtime_put_sync(&pdev->dev); 1072 - if (ret < 0) 1072 + if (ret < 0 && ret != -ENOSYS) 1073 1073 goto err_pm_get_sync; 1074 1074 1075 1075 /*
+19
sound/soc/fsl/fsl_micfil.c
··· 376 376 if (ret) 377 377 return ret; 378 378 379 + /* 380 + * SRES is self-cleared bit, but REG_MICFIL_CTRL1 is defined 381 + * as non-volatile register, so SRES still remain in regmap 382 + * cache after set, that every update of REG_MICFIL_CTRL1, 383 + * software reset happens. so clear it explicitly. 384 + */ 385 + ret = regmap_clear_bits(micfil->regmap, REG_MICFIL_CTRL1, 386 + MICFIL_CTRL1_SRES); 387 + if (ret) 388 + return ret; 389 + 390 + /* 391 + * Set SRES should clear CHnF flags, But even add delay here 392 + * the CHnF may not be cleared sometimes, so clear CHnF explicitly. 393 + */ 394 + ret = regmap_write_bits(micfil->regmap, REG_MICFIL_STAT, 0xFF, 0xFF); 395 + if (ret) 396 + return ret; 397 + 379 398 return 0; 380 399 } 381 400
+1 -1
sound/soc/fsl/fsl_sai.c
··· 1448 1448 } 1449 1449 1450 1450 ret = pm_runtime_put_sync(dev); 1451 - if (ret < 0) 1451 + if (ret < 0 && ret != -ENOSYS) 1452 1452 goto err_pm_get_sync; 1453 1453 1454 1454 /*
+7
sound/soc/intel/boards/bytcht_es8316.c
··· 443 443 | BYT_CHT_ES8316_INTMIC_IN2_MAP 444 444 | BYT_CHT_ES8316_JD_INVERTED), 445 445 }, 446 + { /* Nanote UMPC-01 */ 447 + .matches = { 448 + DMI_MATCH(DMI_SYS_VENDOR, "RWC CO.,LTD"), 449 + DMI_MATCH(DMI_PRODUCT_NAME, "UMPC-01"), 450 + }, 451 + .driver_data = (void *)BYT_CHT_ES8316_INTMIC_IN1_MAP, 452 + }, 446 453 { /* Teclast X98 Plus II */ 447 454 .matches = { 448 455 DMI_MATCH(DMI_SYS_VENDOR, "TECLAST"),
+46 -14
sound/soc/intel/boards/sof_es8336.c
··· 63 63 struct snd_soc_jack jack; 64 64 struct list_head hdmi_pcm_list; 65 65 bool speaker_en; 66 + struct delayed_work pcm_pop_work; 66 67 }; 67 68 68 69 struct sof_hdmi_pcm { ··· 112 111 dev_info(dev, "quirk headset at mic1 port enabled\n"); 113 112 } 114 113 114 + static void pcm_pop_work_events(struct work_struct *work) 115 + { 116 + struct sof_es8336_private *priv = 117 + container_of(work, struct sof_es8336_private, pcm_pop_work.work); 118 + 119 + gpiod_set_value_cansleep(priv->gpio_speakers, priv->speaker_en); 120 + 121 + if (quirk & SOF_ES8336_HEADPHONE_GPIO) 122 + gpiod_set_value_cansleep(priv->gpio_headphone, priv->speaker_en); 123 + 124 + } 125 + 126 + static int sof_8336_trigger(struct snd_pcm_substream *substream, int cmd) 127 + { 128 + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); 129 + struct snd_soc_card *card = rtd->card; 130 + struct sof_es8336_private *priv = snd_soc_card_get_drvdata(card); 131 + 132 + switch (cmd) { 133 + case SNDRV_PCM_TRIGGER_START: 134 + case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 135 + case SNDRV_PCM_TRIGGER_RESUME: 136 + break; 137 + 138 + case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 139 + case SNDRV_PCM_TRIGGER_SUSPEND: 140 + case SNDRV_PCM_TRIGGER_STOP: 141 + if (priv->speaker_en == false) 142 + if (substream->stream == 0) { 143 + cancel_delayed_work(&priv->pcm_pop_work); 144 + gpiod_set_value_cansleep(priv->gpio_speakers, true); 145 + } 146 + break; 147 + default: 148 + return -EINVAL; 149 + } 150 + 151 + return 0; 152 + } 153 + 115 154 static int sof_es8316_speaker_power_event(struct snd_soc_dapm_widget *w, 116 155 struct snd_kcontrol *kcontrol, int event) 117 156 { ··· 163 122 164 123 priv->speaker_en = !SND_SOC_DAPM_EVENT_ON(event); 165 124 166 - if (SND_SOC_DAPM_EVENT_ON(event)) 167 - msleep(70); 168 - 169 - gpiod_set_value_cansleep(priv->gpio_speakers, priv->speaker_en); 170 - 171 - if (!(quirk & SOF_ES8336_HEADPHONE_GPIO)) 172 - return 0; 173 - 174 - if (SND_SOC_DAPM_EVENT_ON(event)) 175 - msleep(70); 176 - 177 - gpiod_set_value_cansleep(priv->gpio_headphone, priv->speaker_en); 178 - 125 + queue_delayed_work(system_wq, &priv->pcm_pop_work, msecs_to_jiffies(70)); 179 126 return 0; 180 127 } 181 128 ··· 373 344 /* machine stream operations */ 374 345 static struct snd_soc_ops sof_es8336_ops = { 375 346 .hw_params = sof_es8336_hw_params, 347 + .trigger = sof_8336_trigger, 376 348 }; 377 349 378 350 static struct snd_soc_dai_link_component platform_component[] = { ··· 753 723 } 754 724 755 725 INIT_LIST_HEAD(&priv->hdmi_pcm_list); 756 - 726 + INIT_DELAYED_WORK(&priv->pcm_pop_work, 727 + pcm_pop_work_events); 757 728 snd_soc_card_set_drvdata(card, priv); 758 729 759 730 if (mach->mach_params.dmic_num > 0) { ··· 783 752 struct snd_soc_card *card = platform_get_drvdata(pdev); 784 753 struct sof_es8336_private *priv = snd_soc_card_get_drvdata(card); 785 754 755 + cancel_delayed_work(&priv->pcm_pop_work); 786 756 gpiod_put(priv->gpio_speakers); 787 757 device_remove_software_node(priv->codec_dev); 788 758 put_device(priv->codec_dev);
+13
sound/soc/intel/common/soc-acpi-intel-icl-match.c
··· 10 10 #include <sound/soc-acpi-intel-match.h> 11 11 #include "../skylake/skl.h" 12 12 13 + static const struct snd_soc_acpi_codecs essx_83x6 = { 14 + .num_codecs = 3, 15 + .codecs = { "ESSX8316", "ESSX8326", "ESSX8336"}, 16 + }; 17 + 13 18 static struct skl_machine_pdata icl_pdata = { 14 19 .use_tplg_pcm = true, 15 20 }; ··· 31 26 .id = "10EC5682", 32 27 .drv_name = "sof_rt5682", 33 28 .sof_tplg_filename = "sof-icl-rt5682.tplg", 29 + }, 30 + { 31 + .comp_ids = &essx_83x6, 32 + .drv_name = "sof-essx8336", 33 + .sof_tplg_filename = "sof-icl-es8336", /* the tplg suffix is added at run time */ 34 + .tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_SSP_NUMBER | 35 + SND_SOC_ACPI_TPLG_INTEL_SSP_MSB | 36 + SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER, 34 37 }, 35 38 {}, 36 39 };
+16 -3
sound/soc/soc-core.c
··· 3477 3477 3478 3478 static int __init snd_soc_init(void) 3479 3479 { 3480 - snd_soc_debugfs_init(); 3481 - snd_soc_util_init(); 3480 + int ret; 3482 3481 3483 - return platform_driver_register(&soc_driver); 3482 + snd_soc_debugfs_init(); 3483 + ret = snd_soc_util_init(); 3484 + if (ret) 3485 + goto err_util_init; 3486 + 3487 + ret = platform_driver_register(&soc_driver); 3488 + if (ret) 3489 + goto err_register; 3490 + return 0; 3491 + 3492 + err_register: 3493 + snd_soc_util_exit(); 3494 + err_util_init: 3495 + snd_soc_debugfs_exit(); 3496 + return ret; 3484 3497 } 3485 3498 module_init(snd_soc_init); 3486 3499
+1 -1
sound/soc/soc-dapm.c
··· 3620 3620 3621 3621 switch (w->id) { 3622 3622 case snd_soc_dapm_regulator_supply: 3623 - w->regulator = devm_regulator_get(dapm->dev, w->name); 3623 + w->regulator = devm_regulator_get(dapm->dev, widget->name); 3624 3624 if (IS_ERR(w->regulator)) { 3625 3625 ret = PTR_ERR(w->regulator); 3626 3626 goto request_failed;
+8 -3
sound/soc/soc-ops.c
··· 452 452 val = ucontrol->value.integer.value[0]; 453 453 if (mc->platform_max && val > mc->platform_max) 454 454 return -EINVAL; 455 - if (val > max - min) 455 + if (val > max) 456 456 return -EINVAL; 457 457 val_mask = mask << shift; 458 458 val = (val + min) & mask; ··· 464 464 ret = err; 465 465 466 466 if (snd_soc_volsw_is_stereo(mc)) { 467 - unsigned int val2; 467 + unsigned int val2 = ucontrol->value.integer.value[1]; 468 + 469 + if (mc->platform_max && val2 > mc->platform_max) 470 + return -EINVAL; 471 + if (val2 > max) 472 + return -EINVAL; 468 473 469 474 val_mask = mask << rshift; 470 - val2 = (ucontrol->value.integer.value[1] + min) & mask; 475 + val2 = (val2 + min) & mask; 471 476 val2 = val2 << rshift; 472 477 473 478 err = snd_soc_component_update_bits(component, reg2, val_mask,
+2 -5
sound/soc/soc-pcm.c
··· 822 822 ret = snd_soc_dai_startup(dai, substream); 823 823 if (ret < 0) 824 824 goto err; 825 - 826 - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 827 - dai->tx_mask = 0; 828 - else 829 - dai->rx_mask = 0; 830 825 } 831 826 832 827 /* Dynamic PCM DAI links compat checks use dynamic capabilities */ ··· 1247 1252 return; 1248 1253 1249 1254 be_substream = snd_soc_dpcm_get_substream(be, stream); 1255 + if (!be_substream) 1256 + return; 1250 1257 1251 1258 for_each_dpcm_fe(be, stream, dpcm) { 1252 1259 if (dpcm->fe == fe)
+10 -5
sound/soc/sof/ipc3-topology.c
··· 2275 2275 struct sof_ipc_fw_version *v = &sdev->fw_ready.version; 2276 2276 struct snd_sof_widget *swidget; 2277 2277 struct snd_sof_route *sroute; 2278 + bool dyn_widgets = false; 2278 2279 int ret; 2279 2280 2280 2281 /* ··· 2285 2284 * topology loading the sound card unavailable to open PCMs. 2286 2285 */ 2287 2286 list_for_each_entry(swidget, &sdev->widget_list, list) { 2288 - if (swidget->dynamic_pipeline_widget) 2287 + if (swidget->dynamic_pipeline_widget) { 2288 + dyn_widgets = true; 2289 2289 continue; 2290 + } 2290 2291 2291 - /* Do not free widgets for static pipelines with FW ABI older than 3.19 */ 2292 + /* Do not free widgets for static pipelines with FW older than SOF2.2 */ 2292 2293 if (!verify && !swidget->dynamic_pipeline_widget && 2293 - v->abi_version < SOF_ABI_VER(3, 19, 0)) { 2294 + SOF_FW_VER(v->major, v->minor, v->micro) < SOF_FW_VER(2, 2, 0)) { 2294 2295 swidget->use_count = 0; 2295 2296 swidget->complete = 0; 2296 2297 continue; ··· 2306 2303 /* 2307 2304 * Tear down all pipelines associated with PCMs that did not get suspended 2308 2305 * and unset the prepare flag so that they can be set up again during resume. 2309 - * Skip this step for older firmware. 2306 + * Skip this step for older firmware unless topology has any 2307 + * dynamic pipeline (in which case the step is mandatory). 2310 2308 */ 2311 - if (!verify && v->abi_version >= SOF_ABI_VER(3, 19, 0)) { 2309 + if (!verify && (dyn_widgets || SOF_FW_VER(v->major, v->minor, v->micro) >= 2310 + SOF_FW_VER(2, 2, 0))) { 2312 2311 ret = sof_tear_down_left_over_pipelines(sdev); 2313 2312 if (ret < 0) { 2314 2313 dev_err(sdev->dev, "failed to tear down paused pipelines\n");
+10 -10
sound/soc/sof/topology.c
··· 1499 1499 break; 1500 1500 } 1501 1501 1502 - if (sof_debug_check_flag(SOF_DBG_DISABLE_MULTICORE)) { 1503 - swidget->core = SOF_DSP_PRIMARY_CORE; 1504 - } else { 1505 - int core = sof_get_token_value(SOF_TKN_COMP_CORE_ID, swidget->tuples, 1506 - swidget->num_tuples); 1507 - 1508 - if (core >= 0) 1509 - swidget->core = core; 1510 - } 1511 - 1512 1502 /* check token parsing reply */ 1513 1503 if (ret < 0) { 1514 1504 dev_err(scomp->dev, ··· 1508 1518 ? tw->sname : "none"); 1509 1519 kfree(swidget); 1510 1520 return ret; 1521 + } 1522 + 1523 + if (sof_debug_check_flag(SOF_DBG_DISABLE_MULTICORE)) { 1524 + swidget->core = SOF_DSP_PRIMARY_CORE; 1525 + } else { 1526 + int core = sof_get_token_value(SOF_TKN_COMP_CORE_ID, swidget->tuples, 1527 + swidget->num_tuples); 1528 + 1529 + if (core >= 0) 1530 + swidget->core = core; 1511 1531 } 1512 1532 1513 1533 /* bind widget to external event */
+11
sound/soc/stm/stm32_adfsdm.c
··· 304 304 return 0; 305 305 } 306 306 307 + static void stm32_adfsdm_cleanup(void *data) 308 + { 309 + iio_channel_release_all_cb(data); 310 + } 311 + 307 312 static struct snd_soc_component_driver stm32_adfsdm_soc_platform = { 308 313 .open = stm32_adfsdm_pcm_open, 309 314 .close = stm32_adfsdm_pcm_close, ··· 354 349 priv->iio_cb = iio_channel_get_all_cb(&pdev->dev, &stm32_adfsdm_dummy_cb, NULL); 355 350 if (IS_ERR(priv->iio_cb)) 356 351 return PTR_ERR(priv->iio_cb); 352 + 353 + ret = devm_add_action_or_reset(&pdev->dev, stm32_adfsdm_cleanup, priv->iio_cb); 354 + if (ret < 0) { 355 + dev_err(&pdev->dev, "Unable to add action\n"); 356 + return ret; 357 + } 357 358 358 359 component = devm_kzalloc(&pdev->dev, sizeof(*component), GFP_KERNEL); 359 360 if (!component)
+1 -1
sound/soc/stm/stm32_i2s.c
··· 1077 1077 if (irq < 0) 1078 1078 return irq; 1079 1079 1080 - ret = devm_request_irq(&pdev->dev, irq, stm32_i2s_isr, IRQF_ONESHOT, 1080 + ret = devm_request_irq(&pdev->dev, irq, stm32_i2s_isr, 0, 1081 1081 dev_name(&pdev->dev), i2s); 1082 1082 if (ret) { 1083 1083 dev_err(&pdev->dev, "irq request returned %d\n", ret);