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

Merge series "ASoC: Intel: machine driver updates for 5.9" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

Small patchset to harden the SoundWire machine driver, change bad
HIDs, update PLL settings and avoid memory leaks. Given that the
SoundWire core parts are not upstream it's probably not necessary to
provide the patches to stable branches.

Bard Liao (1):
ASoC: Intel: sof_sdw_rt711: remove hard-coded codec name

Kai Vehmanen (2):
ASoC: Intel: sof_sdw: add support for systems without i915 audio
ASoC: Intel: sof_sdw: avoid crash if invalid DSP topology loaded

Libin Yang (1):
ASoC: Intel: common: change match table ehl-rt5660

Pierre-Louis Bossart (1):
ASoC: Intel: sof_sdw_rt711: remove properties in card remove

Yong Zhi (1):
ASoC: intel: board: sof_rt5682: Update rt1015 pll input clk freq

sound/soc/intel/boards/sof_rt5682.c | 9 +++++-
sound/soc/intel/boards/sof_sdw.c | 31 +++++++++++++------
sound/soc/intel/boards/sof_sdw_common.h | 2 ++
sound/soc/intel/boards/sof_sdw_hdmi.c | 6 ++++
sound/soc/intel/boards/sof_sdw_rt711.c | 17 +++++++++-
.../intel/common/soc-acpi-intel-ehl-match.c | 2 +-
6 files changed, 54 insertions(+), 13 deletions(-)

base-commit: 22e9b54307987787efa0ee534aa9e31982ec1161
--
2.25.1

+98 -33
+1
include/sound/soc-dai.h
··· 161 161 int snd_soc_dai_compress_new(struct snd_soc_dai *dai, 162 162 struct snd_soc_pcm_runtime *rtd, int num); 163 163 bool snd_soc_dai_stream_valid(struct snd_soc_dai *dai, int stream); 164 + void snd_soc_dai_link_set_capabilities(struct snd_soc_dai_link *dai_link); 164 165 void snd_soc_dai_action(struct snd_soc_dai *dai, 165 166 int stream, int action); 166 167 static inline void snd_soc_dai_activate(struct snd_soc_dai *dai,
-8
sound/soc/codecs/max98373.c
··· 331 331 regmap_write(max98373->regmap, 332 332 MAX98373_R202A_PCM_TO_SPK_MONO_MIX_2, 333 333 0x1); 334 - /* Set inital volume (0dB) */ 335 - regmap_write(max98373->regmap, 336 - MAX98373_R203D_AMP_DIG_VOL_CTRL, 337 - 0x00); 338 - regmap_write(max98373->regmap, 339 - MAX98373_R203E_AMP_PATH_GAIN, 340 - 0x00); 341 334 /* Enable DC blocker */ 342 335 regmap_write(max98373->regmap, 343 336 MAX98373_R203F_AMP_DSP_CFG, ··· 390 397 .num_dapm_widgets = ARRAY_SIZE(max98373_dapm_widgets), 391 398 .dapm_routes = max98373_audio_map, 392 399 .num_dapm_routes = ARRAY_SIZE(max98373_audio_map), 393 - .idle_bias_on = 1, 394 400 .use_pmdown_time = 1, 395 401 .endianness = 1, 396 402 .non_legacy_dai_naming = 1,
+4 -4
sound/soc/codecs/rt286.c
··· 272 272 regmap_read(rt286->regmap, RT286_GET_MIC1_SENSE, &buf); 273 273 *mic = buf & 0x80000000; 274 274 } 275 - if (!*mic) { 275 + 276 + if (!*hp) { 276 277 snd_soc_dapm_disable_pin(dapm, "HV"); 277 278 snd_soc_dapm_disable_pin(dapm, "VREF"); 278 - } 279 - if (!*hp) 280 279 snd_soc_dapm_disable_pin(dapm, "LDO1"); 281 - snd_soc_dapm_sync(dapm); 280 + snd_soc_dapm_sync(dapm); 281 + } 282 282 283 283 return 0; 284 284 }
+19 -8
sound/soc/codecs/rt5682.c
··· 970 970 rt5682_enable_push_button_irq(component, false); 971 971 snd_soc_component_update_bits(component, RT5682_CBJ_CTRL_1, 972 972 RT5682_TRIG_JD_MASK, RT5682_TRIG_JD_LOW); 973 - if (snd_soc_dapm_get_pin_status(dapm, "MICBIAS")) 973 + if (!snd_soc_dapm_get_pin_status(dapm, "MICBIAS")) 974 + snd_soc_component_update_bits(component, 975 + RT5682_PWR_ANLG_1, RT5682_PWR_MB, 0); 976 + if (!snd_soc_dapm_get_pin_status(dapm, "Vref2")) 974 977 snd_soc_component_update_bits(component, 975 978 RT5682_PWR_ANLG_1, RT5682_PWR_VREF2, 0); 976 - else 977 - snd_soc_component_update_bits(component, 978 - RT5682_PWR_ANLG_1, 979 - RT5682_PWR_VREF2 | RT5682_PWR_MB, 0); 980 979 snd_soc_component_update_bits(component, RT5682_PWR_ANLG_3, 981 980 RT5682_PWR_CBJ, 0); 982 981 snd_soc_component_update_bits(component, RT5682_MICBIAS_2, ··· 1087 1088 /* jack was out, report jack type */ 1088 1089 rt5682->jack_type = 1089 1090 rt5682_headset_detect(rt5682->component, 1); 1090 - } else { 1091 + } else if ((rt5682->jack_type & SND_JACK_HEADSET) == 1092 + SND_JACK_HEADSET) { 1091 1093 /* jack is already in, report button event */ 1092 1094 rt5682->jack_type = SND_JACK_HEADSET; 1093 1095 btn_type = rt5682_button_detect(rt5682->component); ··· 1614 1614 0, set_filter_clk, SND_SOC_DAPM_PRE_PMU), 1615 1615 SND_SOC_DAPM_SUPPLY("Vref1", RT5682_PWR_ANLG_1, RT5682_PWR_VREF1_BIT, 0, 1616 1616 rt5682_set_verf, SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU), 1617 - SND_SOC_DAPM_SUPPLY("Vref2", RT5682_PWR_ANLG_1, RT5682_PWR_VREF2_BIT, 0, 1618 - NULL, 0), 1617 + SND_SOC_DAPM_SUPPLY("Vref2", SND_SOC_NOPM, 0, 0, NULL, 0), 1619 1618 SND_SOC_DAPM_SUPPLY("MICBIAS", SND_SOC_NOPM, 0, 0, NULL, 0), 1620 1619 1621 1620 /* ASRC */ ··· 2504 2505 snd_soc_dapm_force_enable_pin_unlocked(dapm, "MICBIAS"); 2505 2506 snd_soc_component_update_bits(component, RT5682_PWR_ANLG_1, 2506 2507 RT5682_PWR_MB, RT5682_PWR_MB); 2508 + 2509 + snd_soc_dapm_force_enable_pin_unlocked(dapm, "Vref2"); 2510 + snd_soc_component_update_bits(component, RT5682_PWR_ANLG_1, 2511 + RT5682_PWR_VREF2 | RT5682_PWR_FV2, 2512 + RT5682_PWR_VREF2); 2513 + usleep_range(55000, 60000); 2514 + snd_soc_component_update_bits(component, RT5682_PWR_ANLG_1, 2515 + RT5682_PWR_FV2, RT5682_PWR_FV2); 2516 + 2507 2517 snd_soc_dapm_force_enable_pin_unlocked(dapm, "I2S1"); 2508 2518 snd_soc_dapm_force_enable_pin_unlocked(dapm, "PLL2F"); 2509 2519 snd_soc_dapm_force_enable_pin_unlocked(dapm, "PLL2B"); ··· 2538 2530 snd_soc_dapm_mutex_lock(dapm); 2539 2531 2540 2532 snd_soc_dapm_disable_pin_unlocked(dapm, "MICBIAS"); 2533 + snd_soc_dapm_disable_pin_unlocked(dapm, "Vref2"); 2541 2534 if (!rt5682->jack_type) 2542 2535 snd_soc_component_update_bits(component, RT5682_PWR_ANLG_1, 2536 + RT5682_PWR_VREF2 | RT5682_PWR_FV2 | 2543 2537 RT5682_PWR_MB, 0); 2538 + 2544 2539 snd_soc_dapm_disable_pin_unlocked(dapm, "I2S1"); 2545 2540 snd_soc_dapm_disable_pin_unlocked(dapm, "PLL2F"); 2546 2541 snd_soc_dapm_disable_pin_unlocked(dapm, "PLL2B");
+5 -1
sound/soc/codecs/wm8974.c
··· 186 186 187 187 /* Boost mixer */ 188 188 static const struct snd_kcontrol_new wm8974_boost_mixer[] = { 189 - SOC_DAPM_SINGLE("Aux Switch", WM8974_INPPGA, 6, 1, 0), 189 + SOC_DAPM_SINGLE("Aux Switch", WM8974_INPPGA, 6, 1, 1), 190 190 }; 191 191 192 192 /* Input PGA */ ··· 474 474 iface |= 0x0008; 475 475 break; 476 476 case SND_SOC_DAIFMT_DSP_A: 477 + if ((fmt & SND_SOC_DAIFMT_INV_MASK) == SND_SOC_DAIFMT_IB_IF || 478 + (fmt & SND_SOC_DAIFMT_INV_MASK) == SND_SOC_DAIFMT_NB_IF) { 479 + return -EINVAL; 480 + } 477 481 iface |= 0x00018; 478 482 break; 479 483 default:
+2 -2
sound/soc/generic/audio-graph-card.c
··· 317 317 if (ret < 0) 318 318 goto out_put_node; 319 319 320 - dai_link->dpcm_playback = 1; 321 - dai_link->dpcm_capture = 1; 320 + snd_soc_dai_link_set_capabilities(dai_link); 321 + 322 322 dai_link->ops = &graph_ops; 323 323 dai_link->init = asoc_simple_dai_init; 324 324
+2 -2
sound/soc/generic/simple-card.c
··· 231 231 if (ret < 0) 232 232 goto out_put_node; 233 233 234 - dai_link->dpcm_playback = 1; 235 - dai_link->dpcm_capture = 1; 234 + snd_soc_dai_link_set_capabilities(dai_link); 235 + 236 236 dai_link->ops = &simple_ops; 237 237 dai_link->init = asoc_simple_dai_init; 238 238
+1
sound/soc/intel/boards/bdw-rt5677.c
··· 367 367 { 368 368 .name = "Codec DSP", 369 369 .stream_name = "Wake on Voice", 370 + .capture_only = 1, 370 371 .ops = &bdw_rt5677_dsp_ops, 371 372 SND_SOC_DAILINK_REG(dsp), 372 373 },
+3 -1
sound/soc/intel/boards/bytcht_es8316.c
··· 552 552 553 553 if (cnt) { 554 554 ret = device_add_properties(codec_dev, props); 555 - if (ret) 555 + if (ret) { 556 + put_device(codec_dev); 556 557 return ret; 558 + } 557 559 } 558 560 559 561 devm_acpi_dev_add_driver_gpios(codec_dev, byt_cht_es8316_gpios);
+1 -1
sound/soc/intel/common/soc-acpi-intel-ehl-match.c
··· 12 12 13 13 struct snd_soc_acpi_mach snd_soc_acpi_intel_ehl_machines[] = { 14 14 { 15 - .id = "INTC1027", 15 + .id = "10EC5660", 16 16 .drv_name = "ehl_rt5660", 17 17 .sof_fw_filename = "sof-ehl.ri", 18 18 .sof_tplg_filename = "sof-ehl-rt5660.tplg",
+1 -1
sound/soc/meson/axg-card.c
··· 116 116 117 117 lb = &card->dai_link[*index + 1]; 118 118 119 - lb->name = kasprintf(GFP_KERNEL, "%s-lb", pad->name); 119 + lb->name = devm_kasprintf(card->dev, GFP_KERNEL, "%s-lb", pad->name); 120 120 if (!lb->name) 121 121 return -ENOMEM; 122 122
+38
sound/soc/soc-dai.c
··· 393 393 return stream->channels_min; 394 394 } 395 395 396 + /* 397 + * snd_soc_dai_link_set_capabilities() - set dai_link properties based on its DAIs 398 + */ 399 + void snd_soc_dai_link_set_capabilities(struct snd_soc_dai_link *dai_link) 400 + { 401 + struct snd_soc_dai_link_component *cpu; 402 + struct snd_soc_dai_link_component *codec; 403 + struct snd_soc_dai *dai; 404 + bool supported[SNDRV_PCM_STREAM_LAST + 1]; 405 + int direction; 406 + int i; 407 + 408 + for_each_pcm_streams(direction) { 409 + supported[direction] = true; 410 + 411 + for_each_link_cpus(dai_link, i, cpu) { 412 + dai = snd_soc_find_dai(cpu); 413 + if (!dai || !snd_soc_dai_stream_valid(dai, direction)) { 414 + supported[direction] = false; 415 + break; 416 + } 417 + } 418 + if (!supported[direction]) 419 + continue; 420 + for_each_link_codecs(dai_link, i, codec) { 421 + dai = snd_soc_find_dai(codec); 422 + if (!dai || !snd_soc_dai_stream_valid(dai, direction)) { 423 + supported[direction] = false; 424 + break; 425 + } 426 + } 427 + } 428 + 429 + dai_link->dpcm_playback = supported[SNDRV_PCM_STREAM_PLAYBACK]; 430 + dai_link->dpcm_capture = supported[SNDRV_PCM_STREAM_CAPTURE]; 431 + } 432 + EXPORT_SYMBOL_GPL(snd_soc_dai_link_set_capabilities); 433 + 396 434 void snd_soc_dai_action(struct snd_soc_dai *dai, 397 435 int stream, int action) 398 436 {
+5 -5
sound/soc/sof/core.c
··· 345 345 struct snd_sof_pdata *pdata = sdev->pdata; 346 346 int ret; 347 347 348 - ret = snd_sof_dsp_power_down_notify(sdev); 349 - if (ret < 0) 350 - dev_warn(dev, "error: %d failed to prepare DSP for device removal", 351 - ret); 352 - 353 348 if (IS_ENABLED(CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE)) 354 349 cancel_work_sync(&sdev->probe_work); 355 350 356 351 if (sdev->fw_state > SOF_FW_BOOT_NOT_STARTED) { 352 + ret = snd_sof_dsp_power_down_notify(sdev); 353 + if (ret < 0) 354 + dev_warn(dev, "error: %d failed to prepare DSP for device removal", 355 + ret); 356 + 357 357 snd_sof_fw_unload(sdev); 358 358 snd_sof_ipc_free(sdev); 359 359 snd_sof_free_debug(sdev);
+8
sound/soc/sof/imx/imx8.c
··· 375 375 static struct snd_soc_dai_driver imx8_dai[] = { 376 376 { 377 377 .name = "esai-port", 378 + .playback = { 379 + .channels_min = 1, 380 + .channels_max = 8, 381 + }, 382 + .capture = { 383 + .channels_min = 1, 384 + .channels_max = 8, 385 + }, 378 386 }, 379 387 }; 380 388
+8
sound/soc/sof/imx/imx8m.c
··· 240 240 static struct snd_soc_dai_driver imx8m_dai[] = { 241 241 { 242 242 .name = "sai-port", 243 + .playback = { 244 + .channels_min = 1, 245 + .channels_max = 32, 246 + }, 247 + .capture = { 248 + .channels_min = 1, 249 + .channels_max = 32, 250 + }, 243 251 }, 244 252 }; 245 253