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-5.4-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
"It became a bit largish, but all small and good for 5.4:

- A regression fix of ALSA timer code bug that sneaked in by a recent
cleanup; never trust innocent-looking guys...

- Fix for compress API max size check signedness

- Fixes in HD-audio: CA0132 work stall, Intel Tigerlake HDMI

- A few fixes for SOF: memory leak, sanity-check and build fixes

- A collection of device-specific fixes: firewire, rockchip, ASoC
HDMI, rsnd, ASoC HDA, stm32, TI, kirkwood, msm, max98373"

* tag 'sound-5.4-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ALSA: timer: Fix incorrectly assigned timer instance
ASoC: SOF: topology: Fix bytes control size checks
ALSA: hda: hdmi - add Tigerlake support
ASoC: max98373: replace gpio_request with devm_gpio_request
ASoC: stm32: sai: add restriction on mmap support
ALSA: hda/ca0132 - Fix possible workqueue stall
ASoC: hdac_hda: fix race in device removal
ALSA: bebob: fix to detect configured source of sampling clock for Focusrite Saffire Pro i/o series
ASoC: rockchip: rockchip_max98090: Enable SHDN to fix headset detection
ASoC: ti: sdma-pcm: Add back the flags parameter for non standard dma names
ASoC: SOF: ipc: Fix memory leak in sof_set_get_large_ctrl_data
ASoC: SOF: Fix memory leak in sof_dfsentry_write
ASoC: SOF: Intel: hda-stream: fix the CONFIG_ prefix missing
ASoC: kirkwood: fix device remove ordering
ASoC: rsnd: dma: fix SSI9 4/5/6/7 busif dma address
ASoC: hdmi-codec: drop mutex locking again
ASoC: kirkwood: fix external clock probe defer
ASoC: compress: fix unsigned integer overflow check
ASoC: msm8916-wcd-analog: Fix RX1 selection in RDAC2 MUX

+72 -39
+1 -1
sound/core/compress_offload.c
··· 528 528 { 529 529 /* first let's check the buffer parameter's */ 530 530 if (params->buffer.fragment_size == 0 || 531 - params->buffer.fragments > INT_MAX / params->buffer.fragment_size || 531 + params->buffer.fragments > U32_MAX / params->buffer.fragment_size || 532 532 params->buffer.fragments == 0) 533 533 return -EINVAL; 534 534
+3 -3
sound/core/timer.c
··· 284 284 goto unlock; 285 285 } 286 286 if (!list_empty(&timer->open_list_head)) { 287 - timeri = list_entry(timer->open_list_head.next, 287 + struct snd_timer_instance *t = 288 + list_entry(timer->open_list_head.next, 288 289 struct snd_timer_instance, open_list); 289 - if (timeri->flags & SNDRV_TIMER_IFLG_EXCLUSIVE) { 290 + if (t->flags & SNDRV_TIMER_IFLG_EXCLUSIVE) { 290 291 err = -EBUSY; 291 - timeri = NULL; 292 292 goto unlock; 293 293 } 294 294 }
+3
sound/firewire/bebob/bebob_focusrite.c
··· 27 27 #define SAFFIRE_CLOCK_SOURCE_SPDIF 1 28 28 29 29 /* clock sources as returned from register of Saffire Pro 10 and 26 */ 30 + #define SAFFIREPRO_CLOCK_SOURCE_SELECT_MASK 0x000000ff 31 + #define SAFFIREPRO_CLOCK_SOURCE_DETECT_MASK 0x0000ff00 30 32 #define SAFFIREPRO_CLOCK_SOURCE_INTERNAL 0 31 33 #define SAFFIREPRO_CLOCK_SOURCE_SKIP 1 /* never used on hardware */ 32 34 #define SAFFIREPRO_CLOCK_SOURCE_SPDIF 2 ··· 191 189 map = saffirepro_clk_maps[1]; 192 190 193 191 /* In a case that this driver cannot handle the value of register. */ 192 + value &= SAFFIREPRO_CLOCK_SOURCE_SELECT_MASK; 194 193 if (value >= SAFFIREPRO_CLOCK_SOURCE_COUNT || map[value] < 0) { 195 194 err = -EIO; 196 195 goto end;
+1 -1
sound/pci/hda/patch_ca0132.c
··· 7604 7604 /* Delay enabling the HP amp, to let the mic-detection 7605 7605 * state machine run. 7606 7606 */ 7607 - cancel_delayed_work_sync(&spec->unsol_hp_work); 7607 + cancel_delayed_work(&spec->unsol_hp_work); 7608 7608 schedule_delayed_work(&spec->unsol_hp_work, msecs_to_jiffies(500)); 7609 7609 tbl = snd_hda_jack_tbl_get(codec, cb->nid); 7610 7610 if (tbl)
+13
sound/pci/hda/patch_hdmi.c
··· 2851 2851 return intel_hsw_common_init(codec, 0x02, map, ARRAY_SIZE(map)); 2852 2852 } 2853 2853 2854 + static int patch_i915_tgl_hdmi(struct hda_codec *codec) 2855 + { 2856 + /* 2857 + * pin to port mapping table where the value indicate the pin number and 2858 + * the index indicate the port number with 1 base. 2859 + */ 2860 + static const int map[] = {0x4, 0x6, 0x8, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf}; 2861 + 2862 + return intel_hsw_common_init(codec, 0x02, map, ARRAY_SIZE(map)); 2863 + } 2864 + 2865 + 2854 2866 /* Intel Baytrail and Braswell; with eld notifier */ 2855 2867 static int patch_i915_byt_hdmi(struct hda_codec *codec) 2856 2868 { ··· 4165 4153 HDA_CODEC_ENTRY(0x8086280c, "Cannonlake HDMI", patch_i915_glk_hdmi), 4166 4154 HDA_CODEC_ENTRY(0x8086280d, "Geminilake HDMI", patch_i915_glk_hdmi), 4167 4155 HDA_CODEC_ENTRY(0x8086280f, "Icelake HDMI", patch_i915_icl_hdmi), 4156 + HDA_CODEC_ENTRY(0x80862812, "Tigerlake HDMI", patch_i915_tgl_hdmi), 4168 4157 HDA_CODEC_ENTRY(0x80862880, "CedarTrail HDMI", patch_generic_hdmi), 4169 4158 HDA_CODEC_ENTRY(0x80862882, "Valleyview2 HDMI", patch_i915_byt_hdmi), 4170 4159 HDA_CODEC_ENTRY(0x80862883, "Braswell HDMI", patch_i915_byt_hdmi),
+1 -1
sound/soc/codecs/hdac_hda.c
··· 410 410 return; 411 411 } 412 412 413 - snd_hdac_ext_bus_link_put(hdev->bus, hlink); 414 413 pm_runtime_disable(&hdev->dev); 414 + snd_hdac_ext_bus_link_put(hdev->bus, hlink); 415 415 } 416 416 417 417 static const struct snd_soc_dapm_route hdac_hda_dapm_routes[] = {
+5 -7
sound/soc/codecs/hdmi-codec.c
··· 274 274 uint8_t eld[MAX_ELD_BYTES]; 275 275 struct snd_pcm_chmap *chmap_info; 276 276 unsigned int chmap_idx; 277 - struct mutex lock; 277 + unsigned long busy; 278 278 struct snd_soc_jack *jack; 279 279 unsigned int jack_status; 280 280 }; ··· 390 390 struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai); 391 391 int ret = 0; 392 392 393 - ret = mutex_trylock(&hcp->lock); 394 - if (!ret) { 393 + ret = test_and_set_bit(0, &hcp->busy); 394 + if (ret) { 395 395 dev_err(dai->dev, "Only one simultaneous stream supported!\n"); 396 396 return -EINVAL; 397 397 } ··· 419 419 420 420 err: 421 421 /* Release the exclusive lock on error */ 422 - mutex_unlock(&hcp->lock); 422 + clear_bit(0, &hcp->busy); 423 423 return ret; 424 424 } 425 425 ··· 431 431 hcp->chmap_idx = HDMI_CODEC_CHMAP_IDX_UNKNOWN; 432 432 hcp->hcd.ops->audio_shutdown(dai->dev->parent, hcp->hcd.data); 433 433 434 - mutex_unlock(&hcp->lock); 434 + clear_bit(0, &hcp->busy); 435 435 } 436 436 437 437 static int hdmi_codec_hw_params(struct snd_pcm_substream *substream, ··· 811 811 return -ENOMEM; 812 812 813 813 hcp->hcd = *hcd; 814 - mutex_init(&hcp->lock); 815 - 816 814 daidrv = devm_kcalloc(dev, dai_count, sizeof(*daidrv), GFP_KERNEL); 817 815 if (!daidrv) 818 816 return -ENOMEM;
+2 -2
sound/soc/codecs/max98373.c
··· 960 960 961 961 /* Power on device */ 962 962 if (gpio_is_valid(max98373->reset_gpio)) { 963 - ret = gpio_request(max98373->reset_gpio, "MAX98373_RESET"); 963 + ret = devm_gpio_request(&i2c->dev, max98373->reset_gpio, 964 + "MAX98373_RESET"); 964 965 if (ret) { 965 966 dev_err(&i2c->dev, "%s: Failed to request gpio %d\n", 966 967 __func__, max98373->reset_gpio); 967 - gpio_free(max98373->reset_gpio); 968 968 return -EINVAL; 969 969 } 970 970 gpio_direction_output(max98373->reset_gpio, 0);
+2 -2
sound/soc/codecs/msm8916-wcd-analog.c
··· 306 306 }; 307 307 308 308 static const char *const adc2_mux_text[] = { "ZERO", "INP2", "INP3" }; 309 - static const char *const rdac2_mux_text[] = { "ZERO", "RX2", "RX1" }; 309 + static const char *const rdac2_mux_text[] = { "RX1", "RX2" }; 310 310 static const char *const hph_text[] = { "ZERO", "Switch", }; 311 311 312 312 static const struct soc_enum hph_enum = SOC_ENUM_SINGLE_VIRT( ··· 321 321 322 322 /* RDAC2 MUX */ 323 323 static const struct soc_enum rdac2_mux_enum = SOC_ENUM_SINGLE( 324 - CDC_D_CDC_CONN_HPHR_DAC_CTL, 0, 3, rdac2_mux_text); 324 + CDC_D_CDC_CONN_HPHR_DAC_CTL, 0, 2, rdac2_mux_text); 325 325 326 326 static const struct snd_kcontrol_new spkr_switch[] = { 327 327 SOC_DAPM_SINGLE("Switch", CDC_A_SPKR_DAC_CTL, 7, 1, 0)
+6 -5
sound/soc/kirkwood/kirkwood-i2s.c
··· 555 555 return PTR_ERR(priv->clk); 556 556 } 557 557 558 - err = clk_prepare_enable(priv->clk); 559 - if (err < 0) 560 - return err; 561 - 562 558 priv->extclk = devm_clk_get(&pdev->dev, "extclk"); 563 559 if (IS_ERR(priv->extclk)) { 564 560 if (PTR_ERR(priv->extclk) == -EPROBE_DEFER) ··· 570 574 } 571 575 } 572 576 577 + err = clk_prepare_enable(priv->clk); 578 + if (err < 0) 579 + return err; 580 + 573 581 /* Some sensible defaults - this reflects the powerup values */ 574 582 priv->ctl_play = KIRKWOOD_PLAYCTL_SIZE_24; 575 583 priv->ctl_rec = KIRKWOOD_RECCTL_SIZE_24; ··· 587 587 priv->ctl_rec |= KIRKWOOD_RECCTL_BURST_128; 588 588 } 589 589 590 - err = devm_snd_soc_register_component(&pdev->dev, &kirkwood_soc_component, 590 + err = snd_soc_register_component(&pdev->dev, &kirkwood_soc_component, 591 591 soc_dai, 2); 592 592 if (err) { 593 593 dev_err(&pdev->dev, "snd_soc_register_component failed\n"); ··· 610 610 { 611 611 struct kirkwood_dma_data *priv = dev_get_drvdata(&pdev->dev); 612 612 613 + snd_soc_unregister_component(&pdev->dev); 613 614 if (!IS_ERR(priv->extclk)) 614 615 clk_disable_unprepare(priv->extclk); 615 616 clk_disable_unprepare(priv->clk);
+5 -2
sound/soc/rockchip/rockchip_max98090.c
··· 66 66 struct snd_soc_jack *jack = (struct snd_soc_jack *)data; 67 67 struct snd_soc_dapm_context *dapm = &jack->card->dapm; 68 68 69 - if (event & SND_JACK_MICROPHONE) 69 + if (event & SND_JACK_MICROPHONE) { 70 70 snd_soc_dapm_force_enable_pin(dapm, "MICBIAS"); 71 - else 71 + snd_soc_dapm_force_enable_pin(dapm, "SHDN"); 72 + } else { 72 73 snd_soc_dapm_disable_pin(dapm, "MICBIAS"); 74 + snd_soc_dapm_disable_pin(dapm, "SHDN"); 75 + } 73 76 74 77 snd_soc_dapm_sync(dapm); 75 78
+2 -2
sound/soc/sh/rcar/dma.c
··· 508 508 #define RDMA_SSI_I_N(addr, i) (addr ##_reg - 0x00300000 + (0x40 * i) + 0x8) 509 509 #define RDMA_SSI_O_N(addr, i) (addr ##_reg - 0x00300000 + (0x40 * i) + 0xc) 510 510 511 - #define RDMA_SSIU_I_N(addr, i, j) (addr ##_reg - 0x00441000 + (0x1000 * (i)) + (((j) / 4) * 0xA000) + (((j) % 4) * 0x400)) 511 + #define RDMA_SSIU_I_N(addr, i, j) (addr ##_reg - 0x00441000 + (0x1000 * (i)) + (((j) / 4) * 0xA000) + (((j) % 4) * 0x400) - (0x4000 * ((i) / 9) * ((j) / 4))) 512 512 #define RDMA_SSIU_O_N(addr, i, j) RDMA_SSIU_I_N(addr, i, j) 513 513 514 - #define RDMA_SSIU_I_P(addr, i, j) (addr ##_reg - 0x00141000 + (0x1000 * (i)) + (((j) / 4) * 0xA000) + (((j) % 4) * 0x400)) 514 + #define RDMA_SSIU_I_P(addr, i, j) (addr ##_reg - 0x00141000 + (0x1000 * (i)) + (((j) / 4) * 0xA000) + (((j) % 4) * 0x400) - (0x4000 * ((i) / 9) * ((j) / 4))) 515 515 #define RDMA_SSIU_O_P(addr, i, j) RDMA_SSIU_I_P(addr, i, j) 516 516 517 517 #define RDMA_SRC_I_N(addr, i) (addr ##_reg - 0x00500000 + (0x400 * i))
+4 -2
sound/soc/sof/debug.c
··· 152 152 */ 153 153 dentry = file->f_path.dentry; 154 154 if (strcmp(dentry->d_name.name, "ipc_flood_count") && 155 - strcmp(dentry->d_name.name, "ipc_flood_duration_ms")) 156 - return -EINVAL; 155 + strcmp(dentry->d_name.name, "ipc_flood_duration_ms")) { 156 + ret = -EINVAL; 157 + goto out; 158 + } 157 159 158 160 if (!strcmp(dentry->d_name.name, "ipc_flood_duration_ms")) 159 161 flood_duration_test = true;
+2 -2
sound/soc/sof/intel/hda-stream.c
··· 190 190 * Workaround to address a known issue with host DMA that results 191 191 * in xruns during pause/release in capture scenarios. 192 192 */ 193 - if (!IS_ENABLED(SND_SOC_SOF_HDA_ALWAYS_ENABLE_DMI_L1)) 193 + if (!IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_ALWAYS_ENABLE_DMI_L1)) 194 194 if (stream && direction == SNDRV_PCM_STREAM_CAPTURE) 195 195 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, 196 196 HDA_VS_INTEL_EM2, ··· 228 228 spin_unlock_irq(&bus->reg_lock); 229 229 230 230 /* Enable DMI L1 entry if there are no capture streams open */ 231 - if (!IS_ENABLED(SND_SOC_SOF_HDA_ALWAYS_ENABLE_DMI_L1)) 231 + if (!IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_ALWAYS_ENABLE_DMI_L1)) 232 232 if (!active_capture_stream) 233 233 snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, 234 234 HDA_VS_INTEL_EM2,
+3 -1
sound/soc/sof/ipc.c
··· 572 572 else 573 573 err = sof_get_ctrl_copy_params(cdata->type, partdata, cdata, 574 574 sparams); 575 - if (err < 0) 575 + if (err < 0) { 576 + kfree(partdata); 576 577 return err; 578 + } 577 579 578 580 msg_bytes = sparams->msg_bytes; 579 581 pl_size = sparams->pl_size;
+7 -6
sound/soc/sof/topology.c
··· 543 543 struct soc_bytes_ext *sbe = (struct soc_bytes_ext *)kc->private_value; 544 544 int max_size = sbe->max; 545 545 546 - if (le32_to_cpu(control->priv.size) > max_size) { 547 - dev_err(sdev->dev, "err: bytes data size %d exceeds max %d.\n", 548 - control->priv.size, max_size); 549 - return -EINVAL; 550 - } 551 - 552 546 /* init the get/put bytes data */ 553 547 scontrol->size = sizeof(struct sof_ipc_ctrl_data) + 554 548 le32_to_cpu(control->priv.size); 549 + 550 + if (scontrol->size > max_size) { 551 + dev_err(sdev->dev, "err: bytes data size %d exceeds max %d.\n", 552 + scontrol->size, max_size); 553 + return -EINVAL; 554 + } 555 + 555 556 scontrol->control_data = kzalloc(max_size, GFP_KERNEL); 556 557 cdata = scontrol->control_data; 557 558 if (!scontrol->control_data)
+11 -1
sound/soc/stm/stm32_sai_sub.c
··· 1218 1218 return 0; 1219 1219 } 1220 1220 1221 + /* No support of mmap in S/PDIF mode */ 1222 + static const struct snd_pcm_hardware stm32_sai_pcm_hw_spdif = { 1223 + .info = SNDRV_PCM_INFO_INTERLEAVED, 1224 + .buffer_bytes_max = 8 * PAGE_SIZE, 1225 + .period_bytes_min = 1024, 1226 + .period_bytes_max = PAGE_SIZE, 1227 + .periods_min = 2, 1228 + .periods_max = 8, 1229 + }; 1230 + 1221 1231 static const struct snd_pcm_hardware stm32_sai_pcm_hw = { 1222 1232 .info = SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_MMAP, 1223 1233 .buffer_bytes_max = 8 * PAGE_SIZE, ··· 1280 1270 }; 1281 1271 1282 1272 static const struct snd_dmaengine_pcm_config stm32_sai_pcm_config_spdif = { 1283 - .pcm_hardware = &stm32_sai_pcm_hw, 1273 + .pcm_hardware = &stm32_sai_pcm_hw_spdif, 1284 1274 .prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config, 1285 1275 .process = stm32_sai_pcm_process_spdif, 1286 1276 };
+1 -1
sound/soc/ti/sdma-pcm.c
··· 62 62 config->chan_names[0] = txdmachan; 63 63 config->chan_names[1] = rxdmachan; 64 64 65 - return devm_snd_dmaengine_pcm_register(dev, config, 0); 65 + return devm_snd_dmaengine_pcm_register(dev, config, flags); 66 66 } 67 67 EXPORT_SYMBOL_GPL(sdma_pcm_platform_register); 68 68