From patchwork Tue Sep 29 11:00:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 263182 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=-13.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 E0119C4727F for ; Tue, 29 Sep 2020 11:56:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 915E320756 for ; Tue, 29 Sep 2020 11:56:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601380573; bh=Y/rU4Kl8mzIytkEa5q3OGx+tpP2TRJ7q1NdFMAg0QeQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=y0VbnwYVJ2zXNZ8Y6MG3BuULRRcT1AR9gZs5c3luFL8D8jUNeCfLHGob+MB7j414h JB+7UKpfIV33qeWl5wIsbAFMSxwC5j7CaRgjLJtQtDgm0Y3IvJVT85ekcr3l51uyfK T7t5nV/+fV5nsjp9Y+pvEHrRkSUnvi+ld8AxlJ+w= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730872AbgI2Lob (ORCPT ); Tue, 29 Sep 2020 07:44:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:43572 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730513AbgI2Lo3 (ORCPT ); Tue, 29 Sep 2020 07:44:29 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 F02B520848; Tue, 29 Sep 2020 11:44:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601379869; bh=Y/rU4Kl8mzIytkEa5q3OGx+tpP2TRJ7q1NdFMAg0QeQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WB0475+XmD4iHeGc3kh+4Awle6jcttogERySSmn5YjpL/wKgI1uC2YBr0Qz3mtxVE xHCjJQaqYY/aXD4tJsZsjJDStwqFFzQX1KlXTXyJzvSGYdrU6gqw6OPUJZ/YZjAdbF 6G2rhgJoo3QnD8Zs/I5v/3ZEaBEbyFjqxTZMUapk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kuninori Morimoto , Mark Brown , Sasha Levin Subject: [PATCH 5.4 323/388] ASoC: pcm3168a: ignore 0 Hz settings Date: Tue, 29 Sep 2020 13:00:54 +0200 Message-Id: <20200929110026.105700593@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200929110010.467764689@linuxfoundation.org> References: <20200929110010.467764689@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@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;