From: Mark Brown Date: Fri, 5 Feb 2021 15:01:21 +0000 (+0000) Subject: Merge branch 'asoc-5.11' into asoc-5.12 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=2927e6d398d0fca52d8f011a89dcfcabb2b1abfd;p=linux.git Merge branch 'asoc-5.11' into asoc-5.12 --- 2927e6d398d0fca52d8f011a89dcfcabb2b1abfd diff --cc sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c index f4b09672af8f7,ae2c748eb19c4..a606133951b70 --- a/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c +++ b/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c @@@ -402,10 -397,57 +402,57 @@@ mt8192_mt6359_cap1_startup(struct snd_p return 0; } -static const struct snd_soc_ops mt8192_mt6359_rt1015_rt5682_capture1_ops = { - .startup = mt8192_mt6359_rt1015_rt5682_cap1_startup, +static const struct snd_soc_ops mt8192_mt6359_capture1_ops = { + .startup = mt8192_mt6359_cap1_startup, }; + static int + mt8192_mt6359_rt5682_startup(struct snd_pcm_substream *substream) + { + static const unsigned int channels[] = { + 1, 2 + }; + static const struct snd_pcm_hw_constraint_list constraints_channels = { + .count = ARRAY_SIZE(channels), + .list = channels, + .mask = 0, + }; + static const unsigned int rates[] = { + 48000 + }; + static const struct snd_pcm_hw_constraint_list constraints_rates = { + .count = ARRAY_SIZE(rates), + .list = rates, + .mask = 0, + }; + + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); + struct snd_pcm_runtime *runtime = substream->runtime; + int ret; + + ret = snd_pcm_hw_constraint_list(runtime, 0, + SNDRV_PCM_HW_PARAM_CHANNELS, + &constraints_channels); + if (ret < 0) { + dev_err(rtd->dev, "hw_constraint_list channels failed\n"); + return ret; + } + + ret = snd_pcm_hw_constraint_list(runtime, 0, + SNDRV_PCM_HW_PARAM_RATE, + &constraints_rates); + if (ret < 0) { + dev_err(rtd->dev, "hw_constraint_list rate failed\n"); + return ret; + } + + return 0; + } + + static const struct snd_soc_ops mt8192_mt6359_rt5682_ops = { + .startup = mt8192_mt6359_rt5682_startup, + }; + /* FE */ SND_SOC_DAILINK_DEFS(playback1, DAILINK_COMP_ARRAY(COMP_CPU("DL1")), diff --cc sound/soc/qcom/lpass-cpu.c index af539e0d7e565,8e5415c9234f1..c642e5f8f28c4 --- a/sound/soc/qcom/lpass-cpu.c +++ b/sound/soc/qcom/lpass-cpu.c @@@ -791,11 -810,14 +808,11 @@@ int asoc_qcom_lpass_cpu_platform_probe( res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "lpass-hdmiif"); drvdata->hdmiif = devm_ioremap_resource(dev, res); - if (IS_ERR((void const __force *)drvdata->hdmiif)) { - dev_err(dev, "error mapping reg resource: %ld\n", - PTR_ERR((void const __force *)drvdata->hdmiif)); - return PTR_ERR((void const __force *)drvdata->hdmiif); - } + if (IS_ERR(drvdata->hdmiif)) + return PTR_ERR(drvdata->hdmiif); lpass_hdmi_regmap_config.max_register = LPAIF_HDMI_RDMAPER_REG(variant, - variant->hdmi_rdma_channels); + variant->hdmi_rdma_channels - 1); drvdata->hdmiif_map = devm_regmap_init_mmio(dev, drvdata->hdmiif, &lpass_hdmi_regmap_config); if (IS_ERR(drvdata->hdmiif_map)) {