Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3203057pxk; Mon, 21 Sep 2020 07:47:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwemvVRhUtVKu5HdvSU0YuY4rd7jaf+H3s/DQLSBGnY0U/dOXa1nepoVLBO+3TKiu6eh1/Z X-Received: by 2002:a50:fe0f:: with SMTP id f15mr51962118edt.235.1600699645553; Mon, 21 Sep 2020 07:47:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600699645; cv=none; d=google.com; s=arc-20160816; b=hupcggMn6QKwJcv5T91XDy6XyWfs9da5T812LeqbBLVbAqo2AtuZFPfzvLsCaUr2SF XIFoK7Z+ZjzdQMDzMoXdzJ8XAFZJ9i/68mlY8DyWn/ARVUZ4zqxKN/lfXTKcn5Jgwv1P k6oaooy00f4vnPEXtWhoNhl4N3iunn2abYlYWKhlVXHdXC0a/r2eQPVrNppnatmVWEQc PDuyDWWWNmDMD5OfNRmpP85ay0VBip63bFLM9FMaOaQQmRzUIg8F4UjgV/4MFmuuyDwD 7gMO17l2knn6GvMYIBO/338XZZZ8RAaJwOO3hMI93bWDeYhsq505a+wQWeKHPcXXlcXG dNNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ww4MmHD13ZDJuDUxNXpY1Patqxcs2SmYM1yYB1CP+v8=; b=0ahTdA/iEqBB4Gveg1uDggTnLzqC+CjwUS3I4hVgDS3grQWXVnoMMv101Fdd0BPNvj GBPpBYrdwNGPgHGHp7XPfAoN+xADPLdkd9WQ8sri6oEHvbdCTescLSIBm+6xzuTIURec heVtf0m/729MtH9uv3JxLxpLwJ+Hm39TcOMWPgWtuJnNXgLEIaW3fprpTfo4/PsBcziA cndNsm8izU+MkPA62jr98snUjLHHDv/h5yD352+1vMwaBotVc0AheE7IPBKnA9v8ZY0u SG77y2dzGRTBQuflssYb9wh5ovURLjNehU54XE1oe8LMzAcxZe6PI6t8/0YseyDSFk71 mL7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dDGU34LG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j16si10713609edj.408.2020.09.21.07.47.01; Mon, 21 Sep 2020 07:47:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dDGU34LG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728210AbgIUOnB (ORCPT + 99 others); Mon, 21 Sep 2020 10:43:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:49798 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727955AbgIUOk5 (ORCPT ); Mon, 21 Sep 2020 10:40:57 -0400 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 D2F372388E; Mon, 21 Sep 2020 14:40:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600699257; bh=Y/rU4Kl8mzIytkEa5q3OGx+tpP2TRJ7q1NdFMAg0QeQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dDGU34LGyePs9qNHVgXrh0IWle3mmW0gWoSvzOiHs1lGNNx9kOFnlK/oLBrZ8XJP3 trAOrjbiXPGHDbqPokr4RB3r0UqCR/0mlTJM/unKMaavQSBaX71Coq06/HvOTNeC9c O+7sUcYmQxF3+6XNBDIMAm803onDHQXDkSX3OfP4= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Kuninori Morimoto , Mark Brown , Sasha Levin , alsa-devel@alsa-project.org Subject: [PATCH AUTOSEL 5.4 02/15] ASoC: pcm3168a: ignore 0 Hz settings Date: Mon, 21 Sep 2020 10:40:41 -0400 Message-Id: <20200921144054.2135602-2-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200921144054.2135602-1-sashal@kernel.org> References: <20200921144054.2135602-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kuninori Morimoto [ Upstream commit 7ad26d6671db758c959d7e1d100b138a38483612 ] Some sound card try to set 0 Hz as reset, but it is impossible. This patch ignores it to avoid error return. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87a6yjy5sy.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/pcm3168a.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sound/soc/codecs/pcm3168a.c b/sound/soc/codecs/pcm3168a.c index 88b75695fbf7f..b37e5fbbd301a 100644 --- a/sound/soc/codecs/pcm3168a.c +++ b/sound/soc/codecs/pcm3168a.c @@ -302,6 +302,13 @@ static int pcm3168a_set_dai_sysclk(struct snd_soc_dai *dai, struct pcm3168a_priv *pcm3168a = snd_soc_component_get_drvdata(dai->component); int ret; + /* + * Some sound card sets 0 Hz as reset, + * but it is impossible to set. Ignore it here + */ + if (freq == 0) + return 0; + if (freq > PCM3168A_MAX_SYSCLK) return -EINVAL; -- 2.25.1