History

ASoC: Merge up fixes

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

Mark Brown committed 3 years ago

Commit aeb2e9c2 parents 863b917 3d1bb6c35 files · +223 −108Browse files

Unified · Split

35 files
  1. .mailmap +1 −0
  2. Documentation/devicetree/bindings/sound/google,cros-ec-codec.yaml +1 −1
  3. Documentation/devicetree/bindings/sound/realtek,rt1015p.yaml +1 −1
  4. MAINTAINERS +1 −1
  5. include/sound/sof/dai.h +1 −1
  6. include/sound/sof/info.h +4 −0
  7. sound/hda/intel-dsp-config.c +5 −0
  8. sound/soc/amd/yc/acp6x-mach.c +7 −0
  9. sound/soc/codecs/cs42l51.c +1 −1
  10. sound/soc/codecs/hdac_hda.h +2 −2
  11. sound/soc/codecs/max98373-i2c.c +4 −0
  12. sound/soc/codecs/rt5514-spi.c +8 −7
  13. sound/soc/codecs/rt5677-spi.c +10 −9
  14. sound/soc/codecs/rt711-sdca-sdw.c +1 −1
  15. sound/soc/codecs/sgtl5000.c +1 −0
  16. sound/soc/codecs/tas2764.c +6 −13
  17. sound/soc/codecs/tas2770.c +6 −14
  18. sound/soc/codecs/tas2780.c +6 −13
  19. sound/soc/codecs/tlv320adc3xxx.c +3 −0
  20. sound/soc/codecs/wm8962.c +8 −0
  21. sound/soc/fsl/fsl_asrc.c +1 −1
  22. sound/soc/fsl/fsl_esai.c +1 −1
  23. sound/soc/fsl/fsl_micfil.c +19 −0
  24. sound/soc/fsl/fsl_sai.c +1 −1
  25. sound/soc/intel/boards/bytcht_es8316.c +7 −0
  26. sound/soc/intel/boards/sof_es8336.c +46 −14
  27. sound/soc/intel/common/soc-acpi-intel-icl-match.c +13 −0
  28. sound/soc/soc-core.c +15 −2
  29. sound/soc/soc-dapm.c +1 −1
  30. sound/soc/soc-ops.c +8 −3
  31. sound/soc/soc-pcm.c +2 −5
  32. sound/soc/sof/ipc3-topology.c +10 −5
  33. sound/soc/sof/topology.c +10 −10
  34. sound/soc/stm/stm32_adfsdm.c +11 −0
  35. sound/soc/stm/stm32_i2s.c +1 −1
.mailmap+1−0
@@ -416,6 +416,7 @@ TripleX Chung <xxx.phy@gmail.com> <triplex@zh-kernel.org> · 415 unmodified lines
416416 TripleX Chung <xxx.phy@gmail.com> <zhongyu@18mail.cn>
417417 Tsuneo Yoshioka <Tsuneo.Yoshioka@f-secure.com>
418418 Tycho Andersen <tycho@tycho.pizza> <tycho@tycho.ws>
419+Tzung-Bi Shih <tzungbi@kernel.org> <tzungbi@google.com>
419420 Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de>
420421 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
421422 Uwe Kleine-König <ukleinek@strlen.de>
Documentation/devicetree/bindings/sound/google,cros-ec-codec.yaml+1−1
@@ -8,7 +8,7 @@ title: Audio codec controlled by ChromeOS EC · 7 unmodified lines
88
99 maintainers:
1010 - Cheng-Yi Chiang <cychiang@chromium.org>
11− - Tzung-Bi Shih <tzungbi@google.com>
11+ - Tzung-Bi Shih <tzungbi@kernel.org>
1212
1313 description: |
1414 Google's ChromeOS EC codec is a digital mic codec provided by the
Documentation/devicetree/bindings/sound/realtek,rt1015p.yaml+1−1
@@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# · 6 unmodified lines
77 title: Realtek rt1015p codec devicetree bindings
88
99 maintainers:
10− - Tzung-Bi Shih <tzungbi@google.com>
10+ - Tzung-Bi Shih <tzungbi@kernel.org>
1111
1212 description: |
1313 Rt1015p is a rt1015 variant which does not support I2C and
MAINTAINERS+1−1
@@ -4911,7 +4911,7 @@ F: drivers/platform/chrome/ · 4910 unmodified lines
49114911
49124912 CHROMEOS EC CODEC DRIVER
49134913 M: Cheng-Yi Chiang <cychiang@chromium.org>
4914−M: Tzung-Bi Shih <tzungbi@google.com>
4914+M: Tzung-Bi Shih <tzungbi@kernel.org>
49154915 R: Guenter Roeck <groeck@chromium.org>
49164916 L: chrome-platform@lists.linux.dev
49174917 S: Maintained
include/sound/sof/dai.h+1−1
@@ -84,8 +84,8 @@ enum sof_ipc_dai_type { · 83 unmodified lines
8484 SOF_DAI_AMD_BT, /**< AMD ACP BT*/
8585 SOF_DAI_AMD_SP, /**< AMD ACP SP */
8686 SOF_DAI_AMD_DMIC, /**< AMD ACP DMIC */
87− SOF_DAI_AMD_HS, /**< Amd HS */
8887 SOF_DAI_MEDIATEK_AFE, /**< Mediatek AFE */
88+ SOF_DAI_AMD_HS, /**< Amd HS */
8989 };
9090
9191 /* general purpose DAI configuration */
include/sound/sof/info.h+4−0
@@ -36,6 +36,10 @@ enum sof_ipc_ext_data { · 35 unmodified lines
3636 SOF_IPC_EXT_USER_ABI_INFO = 4,
3737 };
3838
39+/* Build u32 number in format MMmmmppp */
40+#define SOF_FW_VER(MAJOR, MINOR, PATCH) ((uint32_t)( \
41+ ((MAJOR) << 24) | ((MINOR) << 12) | (PATCH)))
42+
3943 /* FW version - SOF_IPC_GLB_VERSION */
4044 struct sof_ipc_fw_version {
4145 struct sof_ipc_hdr hdr;
sound/hda/intel-dsp-config.c+5−0
@@ -320,6 +320,11 @@ static const struct config_entry config_table[] = { · 319 unmodified lines
320320 {}
321321 }
322322 },
323+ {
324+ .flags = FLAG_SOF,
325+ .device = 0x34c8,
326+ .codec_hid = &essx_83x6,
327+ },
323328 {
324329 .flags = FLAG_SOF | FLAG_SOF_ONLY_IF_DMIC_OR_SOUNDWIRE,
325330 .device = 0x34c8,
sound/soc/amd/yc/acp6x-mach.c+7−0
@@ -206,6 +206,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = { · 205 unmodified lines
206206 DMI_MATCH(DMI_PRODUCT_NAME, "UM5302TA"),
207207 }
208208 },
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+ },
209216 {}
210217 };
211218
sound/soc/codecs/cs42l51.c+1−1
@@ -143,7 +143,7 @@ static const struct snd_kcontrol_new cs42l51_snd_controls[] = { · 142 unmodified lines
143143 0, 0xA0, 96, adc_att_tlv),
144144 SOC_DOUBLE_R_SX_TLV("PGA Volume",
145145 CS42L51_ALC_PGA_CTL, CS42L51_ALC_PGB_CTL,
146− 0, 0x19, 30, pga_tlv),
146+ 0, 0x1A, 30, pga_tlv),
147147 SOC_SINGLE("Playback Deemphasis Switch", CS42L51_DAC_CTL, 3, 1, 0),
148148 SOC_SINGLE("Auto-Mute Switch", CS42L51_DAC_CTL, 2, 1, 0),
149149 SOC_SINGLE("Soft Ramp Switch", CS42L51_DAC_CTL, 1, 1, 0),
sound/soc/codecs/hdac_hda.h+2−2
@@ -14,7 +14,7 @@ enum { · 13 unmodified lines
1414 HDAC_HDMI_1_DAI_ID,
1515 HDAC_HDMI_2_DAI_ID,
1616 HDAC_HDMI_3_DAI_ID,
17− HDAC_LAST_DAI_ID = HDAC_HDMI_3_DAI_ID,
17+ HDAC_DAI_ID_NUM
1818 };
1919
2020 struct hdac_hda_pcm {
@@ -24,7 +24,7 @@ struct hdac_hda_pcm { · 3 unmodified lines
2424
2525 struct hdac_hda_priv {
2626 struct hda_codec *codec;
27− struct hdac_hda_pcm pcm[HDAC_LAST_DAI_ID];
27+ struct hdac_hda_pcm pcm[HDAC_DAI_ID_NUM];
2828 bool need_display_power;
2929 };
3030
sound/soc/codecs/max98373-i2c.c+4−0
@@ -549,6 +549,10 @@ static int max98373_i2c_probe(struct i2c_client *i2c) · 548 unmodified lines
549549 max98373->cache = devm_kcalloc(&i2c->dev, max98373->cache_num,
550550 sizeof(*max98373->cache),
551551 GFP_KERNEL);
552+ if (!max98373->cache) {
553+ ret = -ENOMEM;
554+ return ret;
555+ }
552556
553557 for (i = 0; i < max98373->cache_num; i++)
554558 max98373->cache[i].reg = max98373_i2c_cache_reg[i];
sound/soc/codecs/rt5514-spi.c+8−7
@@ -298,13 +298,14 @@ static int rt5514_spi_pcm_new(struct snd_soc_component *component, · 297 unmodified lines
298298 }
299299
300300 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,
308309 };
309310
310311 /**
sound/soc/codecs/rt5677-spi.c+10−9
@@ -396,15 +396,16 @@ static int rt5677_spi_pcm_probe(struct snd_soc_component *component) · 395 unmodified lines
396396 }
397397
398398 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,
408409 };
409410
410411 /* Select a suitable transfer command for the next transfer to ensure
sound/soc/codecs/rt711-sdca-sdw.c+1−1
@@ -230,7 +230,7 @@ static int rt711_sdca_read_prop(struct sdw_slave *slave) · 229 unmodified lines
230230 }
231231
232232 /* set the timeout values */
233− prop->clk_stop_timeout = 20;
233+ prop->clk_stop_timeout = 700;
234234
235235 /* wake-up event */
236236 prop->wake_capable = 1;
sound/soc/codecs/sgtl5000.c+1−0
@@ -1794,6 +1794,7 @@ static void sgtl5000_i2c_remove(struct i2c_client *client) · 1793 unmodified lines
17941794 {
17951795 struct sgtl5000_priv *sgtl5000 = i2c_get_clientdata(client);
17961796
1797+ regmap_write(sgtl5000->regmap, SGTL5000_CHIP_CLK_CTRL, SGTL5000_CHIP_CLK_CTRL_DEFAULT);
17971798 regmap_write(sgtl5000->regmap, SGTL5000_CHIP_DIG_POWER, SGTL5000_DIG_POWER_DEFAULT);
17981799 regmap_write(sgtl5000->regmap, SGTL5000_CHIP_ANA_POWER, SGTL5000_ANA_POWER_DEFAULT);
17991800
sound/soc/codecs/tas2764.c+6−13
@@ -438,20 +438,13 @@ static int tas2764_set_dai_tdm_slot(struct snd_soc_dai *dai, · 437 unmodified lines
438438 if (tx_mask == 0 || rx_mask != 0)
439439 return -EINVAL;
440440
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;
446445 } 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);
455448 }
456449
457450 if (tx_mask != 0 || left_slot >= slots || right_slot >= slots)
sound/soc/codecs/tas2770.c+6−14
@@ -395,21 +395,13 @@ static int tas2770_set_dai_tdm_slot(struct snd_soc_dai *dai, · 394 unmodified lines
395395 if (tx_mask == 0 || rx_mask != 0)
396396 return -EINVAL;
397397
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;
404402 } 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);
413405 }
414406
415407 if (tx_mask != 0 || left_slot >= slots || right_slot >= slots)
sound/soc/codecs/tas2780.c+6−13
@@ -380,20 +380,13 @@ static int tas2780_set_dai_tdm_slot(struct snd_soc_dai *dai, · 379 unmodified lines
380380 if (tx_mask == 0 || rx_mask != 0)
381381 return -EINVAL;
382382
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;
388387 } 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);
397390 }
398391
399392 if (tx_mask != 0 || left_slot >= slots || right_slot >= slots)
sound/soc/codecs/tlv320adc3xxx.c+3−0
@@ -14,6 +14,7 @@ · 13 unmodified lines
1414
1515 #include <dt-bindings/sound/tlv320adc3xxx.h>
1616 #include <linux/clk.h>
17+#include <linux/gpio/consumer.h>
1718 #include <linux/module.h>
1819 #include <linux/moduleparam.h>
1920 #include <linux/io.h>
@@ -1025,7 +1026,9 @@ static const struct gpio_chip adc3xxx_gpio_chip = { · 1005 unmodified lines
10251026
10261027 static void adc3xxx_free_gpio(struct adc3xxx *adc3xxx)
10271028 {
1029+#ifdef CONFIG_GPIOLIB
10281030 gpiochip_remove(&adc3xxx->gpio_chip);
1031+#endif
10291032 }
10301033
10311034 static void adc3xxx_init_gpio(struct adc3xxx *adc3xxx)
sound/soc/codecs/wm8962.c+8−0
@@ -2503,6 +2503,14 @@ static void wm8962_configure_bclk(struct snd_soc_component *component) · 2502 unmodified lines
25032503 snd_soc_component_update_bits(component, WM8962_CLOCKING2,
25042504 WM8962_SYSCLK_ENA_MASK, WM8962_SYSCLK_ENA);
25052505
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);
25062514 dspclk = snd_soc_component_read(component, WM8962_CLOCKING1);
25072515
25082516 if (snd_soc_component_get_bias_level(component) != SND_SOC_BIAS_ON)
sound/soc/fsl/fsl_asrc.c+1−1
@@ -1232,7 +1232,7 @@ static int fsl_asrc_probe(struct platform_device *pdev) · 1231 unmodified lines
12321232 }
12331233
12341234 ret = pm_runtime_put_sync(&pdev->dev);
1235− if (ret < 0)
1235+ if (ret < 0 && ret != -ENOSYS)
12361236 goto err_pm_get_sync;
12371237
12381238 ret = devm_snd_soc_register_component(&pdev->dev, &fsl_asrc_component,
sound/soc/fsl/fsl_esai.c+1−1
@@ -1069,7 +1069,7 @@ static int fsl_esai_probe(struct platform_device *pdev) · 1068 unmodified lines
10691069 regmap_write(esai_priv->regmap, REG_ESAI_RSMB, 0);
10701070
10711071 ret = pm_runtime_put_sync(&pdev->dev);
1072− if (ret < 0)
1072+ if (ret < 0 && ret != -ENOSYS)
10731073 goto err_pm_get_sync;
10741074
10751075 /*
sound/soc/fsl/fsl_micfil.c+19−0
@@ -376,6 +376,25 @@ static int fsl_micfil_reset(struct device *dev) · 375 unmodified lines
376376 if (ret)
377377 return ret;
378378
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+
379398 return 0;
380399 }
381400
sound/soc/fsl/fsl_sai.c+1−1
@@ -1448,7 +1448,7 @@ static int fsl_sai_probe(struct platform_device *pdev) · 1447 unmodified lines
14481448 }
14491449
14501450 ret = pm_runtime_put_sync(dev);
1451− if (ret < 0)
1451+ if (ret < 0 && ret != -ENOSYS)
14521452 goto err_pm_get_sync;
14531453
14541454 /*
sound/soc/intel/boards/bytcht_es8316.c+7−0
@@ -443,6 +443,13 @@ static const struct dmi_system_id byt_cht_es8316_quirk_table[] = { · 442 unmodified lines
443443 | BYT_CHT_ES8316_INTMIC_IN2_MAP
444444 | BYT_CHT_ES8316_JD_INVERTED),
445445 },
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+ },
446453 { /* Teclast X98 Plus II */
447454 .matches = {
448455 DMI_MATCH(DMI_SYS_VENDOR, "TECLAST"),
sound/soc/intel/boards/sof_es8336.c+46−14
@@ -63,6 +63,7 @@ struct sof_es8336_private { · 62 unmodified lines
6363 struct snd_soc_jack jack;
6464 struct list_head hdmi_pcm_list;
6565 bool speaker_en;
66+ struct delayed_work pcm_pop_work;
6667 };
6768
6869 struct sof_hdmi_pcm {
@@ -111,6 +112,46 @@ static void log_quirks(struct device *dev) · 42 unmodified lines
111112 dev_info(dev, "quirk headset at mic1 port enabled\n");
112113 }
113114
115+static void pcm_pop_work_events(struct work_struct *work)
116+{
117+ struct sof_es8336_private *priv =
118+ container_of(work, struct sof_es8336_private, pcm_pop_work.work);
119+
120+ gpiod_set_value_cansleep(priv->gpio_speakers, priv->speaker_en);
121+
122+ if (quirk & SOF_ES8336_HEADPHONE_GPIO)
123+ gpiod_set_value_cansleep(priv->gpio_headphone, priv->speaker_en);
124+
125+}
126+
127+static int sof_8336_trigger(struct snd_pcm_substream *substream, int cmd)
128+{
129+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
130+ struct snd_soc_card *card = rtd->card;
131+ struct sof_es8336_private *priv = snd_soc_card_get_drvdata(card);
132+
133+ switch (cmd) {
134+ case SNDRV_PCM_TRIGGER_START:
135+ case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
136+ case SNDRV_PCM_TRIGGER_RESUME:
137+ break;
138+
139+ case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
140+ case SNDRV_PCM_TRIGGER_SUSPEND:
141+ case SNDRV_PCM_TRIGGER_STOP:
142+ if (priv->speaker_en == false)
143+ if (substream->stream == 0) {
144+ cancel_delayed_work(&priv->pcm_pop_work);
145+ gpiod_set_value_cansleep(priv->gpio_speakers, true);
146+ }
147+ break;
148+ default:
149+ return -EINVAL;
150+ }
151+
152+ return 0;
153+}
154+
114155 static int sof_es8316_speaker_power_event(struct snd_soc_dapm_widget *w,
115156 struct snd_kcontrol *kcontrol, int event)
116157 {
@@ -122,19 +163,7 @@ static int sof_es8316_speaker_power_event(struct snd_soc_dapm_widget *w, · 5 unmodified lines
122163
123164 priv->speaker_en = !SND_SOC_DAPM_EVENT_ON(event);
124165
125− if (SND_SOC_DAPM_EVENT_ON(event))
126− msleep(70);
127−
128− gpiod_set_value_cansleep(priv->gpio_speakers, priv->speaker_en);
129−
130− if (!(quirk & SOF_ES8336_HEADPHONE_GPIO))
131− return 0;
132−
133− if (SND_SOC_DAPM_EVENT_ON(event))
134− msleep(70);
135−
136− gpiod_set_value_cansleep(priv->gpio_headphone, priv->speaker_en);
137−
166+ queue_delayed_work(system_wq, &priv->pcm_pop_work, msecs_to_jiffies(70));
138167 return 0;
139168 }
140169
@@ -344,6 +373,7 @@ static int sof_es8336_hw_params(struct snd_pcm_substream *substream, · 203 unmodified lines
344373 /* machine stream operations */
345374 static struct snd_soc_ops sof_es8336_ops = {
346375 .hw_params = sof_es8336_hw_params,
376+ .trigger = sof_8336_trigger,
347377 };
348378
349379 static struct snd_soc_dai_link_component platform_component[] = {
@@ -723,7 +753,8 @@ static int sof_es8336_probe(struct platform_device *pdev) · 373 unmodified lines
723753 }
724754
725755 INIT_LIST_HEAD(&priv->hdmi_pcm_list);
726−
756+ INIT_DELAYED_WORK(&priv->pcm_pop_work,
757+ pcm_pop_work_events);
727758 snd_soc_card_set_drvdata(card, priv);
728759
729760 if (mach->mach_params.dmic_num > 0) {
@@ -752,6 +783,7 @@ static int sof_es8336_remove(struct platform_device *pdev) · 22 unmodified lines
752783 struct snd_soc_card *card = platform_get_drvdata(pdev);
753784 struct sof_es8336_private *priv = snd_soc_card_get_drvdata(card);
754785
786+ cancel_delayed_work(&priv->pcm_pop_work);
755787 gpiod_put(priv->gpio_speakers);
756788 device_remove_software_node(priv->codec_dev);
757789 put_device(priv->codec_dev);
sound/soc/intel/common/soc-acpi-intel-icl-match.c+13−0
@@ -10,6 +10,11 @@ · 9 unmodified lines
1010 #include <sound/soc-acpi-intel-match.h>
1111 #include "../skylake/skl.h"
1212
13+static const struct snd_soc_acpi_codecs essx_83x6 = {
14+ .num_codecs = 3,
15+ .codecs = { "ESSX8316", "ESSX8326", "ESSX8336"},
16+};
17+
1318 static struct skl_machine_pdata icl_pdata = {
1419 .use_tplg_pcm = true,
1520 };
@@ -27,6 +32,14 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_icl_machines[] = { · 11 unmodified lines
2732 .drv_name = "sof_rt5682",
2833 .sof_tplg_filename = "sof-icl-rt5682.tplg",
2934 },
35+ {
36+ .comp_ids = &essx_83x6,
37+ .drv_name = "sof-essx8336",
38+ .sof_tplg_filename = "sof-icl-es8336", /* the tplg suffix is added at run time */
39+ .tplg_quirk_mask = SND_SOC_ACPI_TPLG_INTEL_SSP_NUMBER |
40+ SND_SOC_ACPI_TPLG_INTEL_SSP_MSB |
41+ SND_SOC_ACPI_TPLG_INTEL_DMIC_NUMBER,
42+ },
3043 {},
3144 };
3245 EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_icl_machines);
sound/soc/soc-core.c+15−2
@@ -3477,10 +3477,23 @@ EXPORT_SYMBOL_GPL(snd_soc_of_get_dai_link_cpus); · 3476 unmodified lines
34773477
34783478 static int __init snd_soc_init(void)
34793479 {
3480+ int ret;
3481+
34803482 snd_soc_debugfs_init();
3481− snd_soc_util_init();
3483+ ret = snd_soc_util_init();
3484+ if (ret)
3485+ goto err_util_init;
34823486
3483− return platform_driver_register(&soc_driver);
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;
34843497 }
34853498 module_init(snd_soc_init);
34863499
sound/soc/soc-dapm.c+1−1
@@ -3620,7 +3620,7 @@ snd_soc_dapm_new_control_unlocked(struct snd_soc_dapm_context *dapm, · 3619 unmodified lines
36203620
36213621 switch (w->id) {
36223622 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);
36243624 if (IS_ERR(w->regulator)) {
36253625 ret = PTR_ERR(w->regulator);
36263626 goto request_failed;
sound/soc/soc-ops.c+8−3
@@ -452,7 +452,7 @@ int snd_soc_put_volsw_sx(struct snd_kcontrol *kcontrol, · 451 unmodified lines
452452 val = ucontrol->value.integer.value[0];
453453 if (mc->platform_max && val > mc->platform_max)
454454 return -EINVAL;
455− if (val > max - min)
455+ if (val > max)
456456 return -EINVAL;
457457 val_mask = mask << shift;
458458 val = (val + min) & mask;
@@ -464,10 +464,15 @@ int snd_soc_put_volsw_sx(struct snd_kcontrol *kcontrol, · 5 unmodified lines
464464 ret = err;
465465
466466 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;
468473
469474 val_mask = mask << rshift;
470− val2 = (ucontrol->value.integer.value[1] + min) & mask;
475+ val2 = (val2 + min) & mask;
471476 val2 = val2 << rshift;
472477
473478 err = snd_soc_component_update_bits(component, reg2, val_mask,
sound/soc/soc-pcm.c+2−5
@@ -822,11 +822,6 @@ static int __soc_pcm_open(struct snd_soc_pcm_runtime *rtd, · 821 unmodified lines
822822 ret = snd_soc_dai_startup(dai, substream);
823823 if (ret < 0)
824824 goto err;
825−
826− if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
827− dai->tx_mask = 0;
828− else
829− dai->rx_mask = 0;
830825 }
831826
832827 /* Dynamic PCM DAI links compat checks use dynamic capabilities */
@@ -1252,6 +1247,8 @@ static void dpcm_be_reparent(struct snd_soc_pcm_runtime *fe, · 419 unmodified lines
12521247 return;
12531248
12541249 be_substream = snd_soc_dpcm_get_substream(be, stream);
1250+ if (!be_substream)
1251+ return;
12551252
12561253 for_each_dpcm_fe(be, stream, dpcm) {
12571254 if (dpcm->fe == fe)
sound/soc/sof/ipc3-topology.c+10−5
@@ -2275,6 +2275,7 @@ static int sof_ipc3_tear_down_all_pipelines(struct snd_sof_dev *sdev, bool verif · 2274 unmodified lines
22752275 struct sof_ipc_fw_version *v = &sdev->fw_ready.version;
22762276 struct snd_sof_widget *swidget;
22772277 struct snd_sof_route *sroute;
2278+ bool dyn_widgets = false;
22782279 int ret;
22792280
22802281 /*
@@ -2284,12 +2285,14 @@ static int sof_ipc3_tear_down_all_pipelines(struct snd_sof_dev *sdev, bool verif · 3 unmodified lines
22842285 * topology loading the sound card unavailable to open PCMs.
22852286 */
22862287 list_for_each_entry(swidget, &sdev->widget_list, list) {
2287− if (swidget->dynamic_pipeline_widget)
2288+ if (swidget->dynamic_pipeline_widget) {
2289+ dyn_widgets = true;
22882290 continue;
2291+ }
22892292
2290− /* Do not free widgets for static pipelines with FW ABI older than 3.19 */
2293+ /* Do not free widgets for static pipelines with FW older than SOF2.2 */
22912294 if (!verify && !swidget->dynamic_pipeline_widget &&
2292− v->abi_version < SOF_ABI_VER(3, 19, 0)) {
2295+ SOF_FW_VER(v->major, v->minor, v->micro) < SOF_FW_VER(2, 2, 0)) {
22932296 swidget->use_count = 0;
22942297 swidget->complete = 0;
22952298 continue;
@@ -2303,9 +2306,11 @@ static int sof_ipc3_tear_down_all_pipelines(struct snd_sof_dev *sdev, bool verif · 7 unmodified lines
23032306 /*
23042307 * Tear down all pipelines associated with PCMs that did not get suspended
23052308 * and unset the prepare flag so that they can be set up again during resume.
2306− * Skip this step for older firmware.
2309+ * Skip this step for older firmware unless topology has any
2310+ * dynamic pipeline (in which case the step is mandatory).
23072311 */
2308− if (!verify && v->abi_version >= SOF_ABI_VER(3, 19, 0)) {
2312+ if (!verify && (dyn_widgets || SOF_FW_VER(v->major, v->minor, v->micro) >=
2313+ SOF_FW_VER(2, 2, 0))) {
23092314 ret = sof_tear_down_left_over_pipelines(sdev);
23102315 if (ret < 0) {
23112316 dev_err(sdev->dev, "failed to tear down paused pipelines\n");
sound/soc/sof/topology.c+10−10
@@ -1499,16 +1499,6 @@ static int sof_widget_ready(struct snd_soc_component *scomp, int index, · 1498 unmodified lines
14991499 break;
15001500 }
15011501
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−
15121502 /* check token parsing reply */
15131503 if (ret < 0) {
15141504 dev_err(scomp->dev,
@@ -1520,6 +1510,16 @@ static int sof_widget_ready(struct snd_soc_component *scomp, int index, · 5 unmodified lines
15201510 return ret;
15211511 }
15221512
1513+ if (sof_debug_check_flag(SOF_DBG_DISABLE_MULTICORE)) {
1514+ swidget->core = SOF_DSP_PRIMARY_CORE;
1515+ } else {
1516+ int core = sof_get_token_value(SOF_TKN_COMP_CORE_ID, swidget->tuples,
1517+ swidget->num_tuples);
1518+
1519+ if (core >= 0)
1520+ swidget->core = core;
1521+ }
1522+
15231523 /* bind widget to external event */
15241524 if (tw->event_type) {
15251525 if (widget_ops[w->id].bind_event) {
sound/soc/stm/stm32_adfsdm.c+11−0
@@ -304,6 +304,11 @@ static int stm32_adfsdm_dummy_cb(const void *data, void *private) · 303 unmodified lines
304304 return 0;
305305 }
306306
307+static void stm32_adfsdm_cleanup(void *data)
308+{
309+ iio_channel_release_all_cb(data);
310+}
311+
307312 static struct snd_soc_component_driver stm32_adfsdm_soc_platform = {
308313 .open = stm32_adfsdm_pcm_open,
309314 .close = stm32_adfsdm_pcm_close,
@@ -350,6 +355,12 @@ static int stm32_adfsdm_probe(struct platform_device *pdev) · 40 unmodified lines
350355 if (IS_ERR(priv->iio_cb))
351356 return PTR_ERR(priv->iio_cb);
352357
358+ ret = devm_add_action_or_reset(&pdev->dev, stm32_adfsdm_cleanup, priv->iio_cb);
359+ if (ret < 0) {
360+ dev_err(&pdev->dev, "Unable to add action\n");
361+ return ret;
362+ }
363+
353364 component = devm_kzalloc(&pdev->dev, sizeof(*component), GFP_KERNEL);
354365 if (!component)
355366 return -ENOMEM;
sound/soc/stm/stm32_i2s.c+1−1
@@ -1077,7 +1077,7 @@ static int stm32_i2s_parse_dt(struct platform_device *pdev, · 1076 unmodified lines
10771077 if (irq < 0)
10781078 return irq;
10791079
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,
10811081 dev_name(&pdev->dev), i2s);
10821082 if (ret) {
10831083 dev_err(&pdev->dev, "irq request returned %d\n", ret);