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 5DCEBFA372C for ; Fri, 8 Nov 2019 11:51:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2A3AF21D7B for ; Fri, 8 Nov 2019 11:51:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573213890; bh=T1HMhi80T0r4Z48YLTNxWYaKRA822E5fSoTlYrs4cMo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=hxr25C7bWX2/h07GyE2aYyWRhPsjDrGpBRVK0qmK+W9JgiTBtDq5Jwtf8s4wM9K+a bKcCJ+aTACtZl/dk4ll/u+ducWuQ+rbYvu9PPiJk7QEjhEL3smaKspm/nAtmYEzLuw l+d8U9Fod0seWloINBvasmh09qjXo8XCxdqZIfoM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390797AbfKHLv3 (ORCPT ); Fri, 8 Nov 2019 06:51:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:36064 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391560AbfKHLrb (ORCPT ); Fri, 8 Nov 2019 06:47:31 -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 30043206A3; Fri, 8 Nov 2019 11:47:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573213650; bh=T1HMhi80T0r4Z48YLTNxWYaKRA822E5fSoTlYrs4cMo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gjj+i5T9+H29N8ZfgE5n2Jv1Je8BYzBnpiO9tasZHeld4bB4PmFelULd7ZsFFaFBW T7CzWOel629cbj+cLiOwGDOTOFjkg0jTbiTL4hw2zmjqH7zmEhlgaVccHqL/edEk2I Yzp3Un4FdONHOLg0MK1chNg+eFc6unj/x6SvV/6E= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Charles Keepax , Mark Brown , Sasha Levin Subject: [PATCH AUTOSEL 4.4 06/44] ASoC: dpcm: Properly initialise hw->rate_max Date: Fri, 8 Nov 2019 06:46:42 -0500 Message-Id: <20191108114721.15944-6-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191108114721.15944-1-sashal@kernel.org> References: <20191108114721.15944-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 1c0d44c86c018..78813057167d7 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -1541,7 +1541,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