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=-5.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 0F931C43613 for ; Thu, 20 Jun 2019 18:05:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D83F921530 for ; Thu, 20 Jun 2019 18:05:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561053909; bh=V6tQn4HFIztHAZOLl7a11pHzVOa2UdR1sZyTUKsSDcU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=JLnA7qhYmqdi9PzO3/2aKqCD3OlFSeobT/3RFQ2OZ6pHCK+1ZWmkyMApwgeR2+Bmt G1pMyUUHzlzHh++s0uivUTTJ6j6KPzt+Oc51oRnMlR6RX2QQbFzclBV2Fnw+y+3GXS yazpVThNP8wl76L/axLx/N3T340UENgwJ/2wuWMc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727984AbfFTSFI (ORCPT ); Thu, 20 Jun 2019 14:05:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:58216 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727981AbfFTSFH (ORCPT ); Thu, 20 Jun 2019 14:05:07 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id ED57921479; Thu, 20 Jun 2019 18:05:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561053906; bh=V6tQn4HFIztHAZOLl7a11pHzVOa2UdR1sZyTUKsSDcU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M5qXja69WDH4EdtASbXUFW9975RYUAgcvrt/ZP5EvdF6UW/Ky06hgQawNtVtjc7gM haGz3rdKHC33qVvD+ggHsw7mIzHvC7+XUJchuuKze9SeDbh/C3S9EQpGtPN7kp58G2 ijGKMc3zXXH/YgBg7Eih8eRKUh4xOKyufgN1oUNo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shengjiu Wang , Nicolin Chen , Mark Brown Subject: [PATCH 4.9 068/117] ASoC: fsl_asrc: Fix the issue about unsupported rate Date: Thu, 20 Jun 2019 19:56:42 +0200 Message-Id: <20190620174356.814269492@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190620174351.964339809@linuxfoundation.org> References: <20190620174351.964339809@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: S.j. Wang commit b06c58c2a1eed571ea2a6640fdb85b7b00196b1e upstream. When the output sample rate is [8kHz, 30kHz], the limitation of the supported ratio range is [1/24, 8]. In the driver we use (8kHz, 30kHz) instead of [8kHz, 30kHz]. So this patch is to fix this issue and the potential rounding issue with divider. Fixes: fff6e03c7b65 ("ASoC: fsl_asrc: add support for 8-30kHz output sample rate") Cc: Signed-off-by: Shengjiu Wang Acked-by: Nicolin Chen Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- sound/soc/fsl/fsl_asrc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/sound/soc/fsl/fsl_asrc.c +++ b/sound/soc/fsl/fsl_asrc.c @@ -286,8 +286,8 @@ static int fsl_asrc_config_pair(struct f return -EINVAL; } - if ((outrate > 8000 && outrate < 30000) && - (outrate/inrate > 24 || inrate/outrate > 8)) { + if ((outrate >= 8000 && outrate <= 30000) && + (outrate > 24 * inrate || inrate > 8 * outrate)) { pair_err("exceed supported ratio range [1/24, 8] for \ inrate/outrate: %d/%d\n", inrate, outrate); return -EINVAL;