Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3005047ybi; Mon, 17 Jun 2019 14:30:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqzXizBCThG07IzC51T70KW8KRKIjkrzmpES++pXvprBJzqzK/o56O78pNG/KgTCHSICDuSa X-Received: by 2002:a17:902:25ab:: with SMTP id y40mr54285842pla.268.1560807021520; Mon, 17 Jun 2019 14:30:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560807021; cv=none; d=google.com; s=arc-20160816; b=F4aSAfZfnsoc4cyyyLMFHeYzk7Ct+0G7LFHpFFXNEcLcNymDwvYapE8/7o2KZGlQ+8 txAgMEdL0Nr4KeMtNXY7cPIHlQc5aPfsu8Q05sCg7ONOjwhBxSCsMbWtaNwF6I3Hgopp DEUeZqyb/InqbYk7UgB4Fjuw0rfbHjNtnVfOc4pRVco2OerdLZ3JFr+zhkH6D1Iuu1tW AwlxNX6ZAGbton9MQU3Uq+2V2vDD4ZDJ6ZRS4OFZdlXFHiJ0CnEK6J6Tp6BElVsiHbSa +v227594FlpeezyZsqtEDVko+hC1p2p750D3fMx6TDZ3t+leenous4ceSGFRwnqIiKvg 0lZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0UdDHpn9St2WJXx2nW/2De8c0qxhhjISq4S6s+bzIVE=; b=sMWjT3p8Z9GgZsbj/7+AnmcYMpP8x+iv012rkEkzI+lJJpr4r3ilnyJyb3l02pyRnZ QbsAFg400ISOjZRt1HBzGSOzPRG5ebyQkHjzMM2oJ6FGfl/MtFm7MYJnWnXHvJK7H/TS 9AN7OkqMuLTDhRCQHequ/lSZADUyKGkdLQE8rTfjLDxSn8uoHUWAM/CTD8z53KcbG2A6 vxF6+B8Tj/NFwarjJSlJVY1NPrBViMFEl3f19xAfAzv1h+LFA5L6iOrpRrRxXSaHR56P bTbx+SUQNs/iI8gKl4BqFq8JW6jqIWRZsDUd9grZt4/R20rmmi1tyJz3Pr0Y2fBXETNV 8Pxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LiSNWizu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g10si11786164pgh.472.2019.06.17.14.30.06; Mon, 17 Jun 2019 14:30:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LiSNWizu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730016AbfFQV2W (ORCPT + 99 others); Mon, 17 Jun 2019 17:28:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:55414 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730528AbfFQV2U (ORCPT ); Mon, 17 Jun 2019 17:28:20 -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 49AC920673; Mon, 17 Jun 2019 21:28:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560806899; bh=V6tQn4HFIztHAZOLl7a11pHzVOa2UdR1sZyTUKsSDcU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LiSNWizuqHdn218X0HgfJ1UzBNTml12PdeHfLSaSUtPV58zKXYUI0cvc6jHqWBy7I id576XgCYJFu4a1uMJZdlFwZyjvj/VOAAkY9YyzZvxo4sC+w9j2fdJr8IOC9J4tBf8 gyaPhz6Fl047+2osrqzyXCvVzq4ajjzuNWwo5FrQ= 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.14 20/53] ASoC: fsl_asrc: Fix the issue about unsupported rate Date: Mon, 17 Jun 2019 23:10:03 +0200 Message-Id: <20190617210749.359319700@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190617210745.104187490@linuxfoundation.org> References: <20190617210745.104187490@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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;