From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC0A0C5DF60 for ; Fri, 8 Nov 2019 12:08:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B05BB21924 for ; Fri, 8 Nov 2019 12:08:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573214906; bh=ZQk8HUJVVWdkb6PKw7UQGNwXF9TB19ZXHOw1EDZu7as=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=SjUo2JsizzNhaxZN/JTJyHBOFIO8ogIJgfjLQbfBBvZerTi5GMZgSHbJaRKDFByQ1 C0Iq59zL+CpH2jK4Wbd+xrF1+m0wTzHje11TVcMyEr3bEJy9blSjnLXH6jC7XnhIOc vAJNiRWbloeWobYaN94iwth1YC0WweVSrJ9O5iYI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391895AbfKHMIZ (ORCPT ); Fri, 8 Nov 2019 07:08:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:53476 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388712AbfKHLkd (ORCPT ); Fri, 8 Nov 2019 06:40:33 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 865E021D7E; Fri, 8 Nov 2019 11:40:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573213233; bh=ZQk8HUJVVWdkb6PKw7UQGNwXF9TB19ZXHOw1EDZu7as=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K+57rJxBPYuSY5pplj8VlUPB2IcBScUdppmgJz3uB52Fsn/YPMsJq3l3HAI0DGScI n5Dkl+MXnlZfbpfs4L+BUbkYGRJecUfYFjGhvYyOl2npzuw85lM+1feqUZ/n3oQWD6 eb8axDipyZx8OUJKG5V2WwwNW9OsxM5LZyYNI+R0= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Yong Zhi , Pierre-Louis Bossart , Takashi Iwai , Mark Brown , Sasha Levin Subject: [PATCH AUTOSEL 4.19 103/205] ASoC: Intel: hdac_hdmi: Limit sampling rates at dai creation Date: Fri, 8 Nov 2019 06:36:10 -0500 Message-Id: <20191108113752.12502-103-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191108113752.12502-1-sashal@kernel.org> References: <20191108113752.12502-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yong Zhi [ Upstream commit 3b857472f34faa7d11001afa5e158833812c98d7 ] 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 Signed-off-by: Sasha Levin --- sound/soc/codecs/hdac_hdmi.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c index 098196610542a..be2473166bfaf 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); -- 2.20.1