From: Yong Zhi Date: Tue, 7 Aug 2018 17:19:16 +0000 (-0500) Subject: ASoC: Intel: hdac_hdmi: Limit sampling rates at dai creation X-Git-Tag: v4.20-rc1~126^2~1^2^2~119 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3b857472f34faa7d11001afa5e158833812c98d7;p=thirdparty%2Fkernel%2Flinux.git ASoC: Intel: hdac_hdmi: Limit sampling rates at dai creation Playback of 44.1Khz contents with HDMI plugged returns "Invalid pipe config" because HDMI paths in the FW topology are configured to operate at 48Khz. This patch filters out sampling rates not supported at hdac_hdmi_create_dais() to let user space SRC to do the converting. Signed-off-by: Yong Zhi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Takashi Iwai Signed-off-by: Mark Brown --- diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c index dc6a0dfea0502..41d90dc6ebf70 100644 --- a/sound/soc/codecs/hdac_hdmi.c +++ b/sound/soc/codecs/hdac_hdmi.c @@ -1410,6 +1410,12 @@ static int hdac_hdmi_create_dais(struct hdac_device *hdev, if (ret) return ret; + /* Filter out 44.1, 88.2 and 176.4Khz */ + rates &= ~(SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_88200 | + SNDRV_PCM_RATE_176400); + if (!rates) + return -EINVAL; + sprintf(dai_name, "intel-hdmi-hifi%d", i+1); hdmi_dais[i].name = devm_kstrdup(&hdev->dev, dai_name, GFP_KERNEL);