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=ham 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 E3BB2FA372C for ; Fri, 8 Nov 2019 11:55:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A5DE1207FA for ; Fri, 8 Nov 2019 11:55:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573214116; bh=UcVJUPglSscPWgOYcHOUcXLNRDwLqyUnDRJRi2uan6A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=rXnOv4oVdHh+qqwUmK4qwnBahaILewKhS7KxN3JsU9QsAdzyHGVPze+pCMDZ6ybzq GJWPZ2zKDKTGqakYLdf2dj/G9lnQtQwQXFdcZmj7CcUc3gYmQhYBVZ8mqBUISq8t/d veobYLklARjQL9X89sRbkbjzmNuD61kWutNWC9M0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391477AbfKHLzP (ORCPT ); Fri, 8 Nov 2019 06:55:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:33514 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391239AbfKHLqC (ORCPT ); Fri, 8 Nov 2019 06:46:02 -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 E0F74222D4; Fri, 8 Nov 2019 11:46:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573213561; bh=UcVJUPglSscPWgOYcHOUcXLNRDwLqyUnDRJRi2uan6A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KNQSCeeKEX6dKP5nWSQzIADxL2WA5IDNpD4DRYPKL+oBiz33ByGhVhQDWVabTNPTy bvP8hVYk0tpktPInpZ0wdjgv+QUEs3n9YFv/YpUgbkdm+sRF6c4Y+H5/6CJPMyTGnp G3Zhov5mp7nPwiTbB/hy+94NKZAFhYm9FzqkXi5s= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Charles Keepax , Mark Brown , Sasha Levin Subject: [PATCH AUTOSEL 4.9 10/64] ASoC: dpcm: Properly initialise hw->rate_max Date: Fri, 8 Nov 2019 06:44:51 -0500 Message-Id: <20191108114545.15351-10-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191108114545.15351-1-sashal@kernel.org> References: <20191108114545.15351-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: Charles Keepax [ Upstream commit e33ffbd9cd39da09831ce62c11025d830bf78d9e ] If the CPU DAI does not initialise rate_max, say if using using KNOT or CONTINUOUS, then the rate_max field will be initialised to 0. A value of zero in the rate_max field of the hardware runtime will cause the sound card to support no sample rates at all. Obviously this is not desired, just a different mechanism is being used to apply the constraints. As such update the setting of rate_max in dpcm_init_runtime_hw to be consistent with the non-DPCM cases and set rate_max to UINT_MAX if nothing is defined on the CPU DAI. Signed-off-by: Charles Keepax Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/soc-pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 1d00f6e894ef4..d69559e458725 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -1592,7 +1592,7 @@ static void dpcm_init_runtime_hw(struct snd_pcm_runtime *runtime, u64 formats) { runtime->hw.rate_min = stream->rate_min; - runtime->hw.rate_max = stream->rate_max; + runtime->hw.rate_max = min_not_zero(stream->rate_max, UINT_MAX); runtime->hw.channels_min = stream->channels_min; runtime->hw.channels_max = stream->channels_max; if (runtime->hw.formats) -- 2.20.1