Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3202418pxk; Mon, 21 Sep 2020 07:46:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDmvL/r6tubAzdt3lbI50pI8DO7y3WVfxZmUd2YbiFI6C+PgptGYSx/M/MhtG5JWShfFN9 X-Received: by 2002:a17:906:82d1:: with SMTP id a17mr49704266ejy.385.1600699589115; Mon, 21 Sep 2020 07:46:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600699589; cv=none; d=google.com; s=arc-20160816; b=fw6b4bb92hgk5C6UsSVvbGKRmM4oDvcHFgPXLSs0Ti/ELV9kC/h0E8bljtXKrRYcbE kb0vqPjaLzORyQjS7hLCMyxkPwFejbIwl0HbBZaQ2hh+fu4+26FY78clgynBJGTjS6yI 0xAzU1Opp7ev+xiO3jHbuxe3etPixLfVYtim/tx2Sgn1mpnh8w4pPteiSvwapvLIZYyt SF/VUDqbgTzLXWwDMVY9GjFafItH3uHsKJn21AFmI5oaKJLAIwRQFQuY+lo68hWviSF1 /tCHwmUZ1UcTgTM+egksDGPKo7cvQFcn9P3zho55aVp5lsGu92Wx9wPH+++8uJqJwhPg qUqA== 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=a1GbvB7gWxiaivekq+HBQOPJpSL0CQoHzVcjp/3uMS8=; b=l6b6WSDIRFPb1Ou7OXX0DfwpiGFhM3TOKPfvJpgs90nbMj7z3Xo6v+1fyNQ5isG8E+ MTgHKkXLam+K+jbxe6Pm9VyWGTrXYgbSbPaCi9pB4JLRbQvQUt3cPSvgBVVhODsPyQxv +Ps3mpHM3wDka44NsWqhv8Xm7seU0PtBPiUySiCBUUNk/hNdI61FSdzrnortue/RWGgp zrGcTOoZIzlh2bhDdBJG7ZTjbh0e+luK4zq839hrHIJbK49sSs6AUXnjo5cP+lH205Ba j4w0b/nD4iEzIx/Qj+XiigU+Ch7/Ag0ruDvOaUjB/qh6KiV27ul7G+szVe/d8udMEO2D pl1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="v/xpoinf"; 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 bt16si8408786ejb.314.2020.09.21.07.46.05; Mon, 21 Sep 2020 07:46:29 -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="v/xpoinf"; 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 S1727810AbgIUOkh (ORCPT + 99 others); Mon, 21 Sep 2020 10:40:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:49054 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727785AbgIUOka (ORCPT ); Mon, 21 Sep 2020 10:40:30 -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 A36B82311D; Mon, 21 Sep 2020 14:40:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600699230; bh=ddpaCm8p5ORQV5vg1PVb89chVnV7o2HOUgXpkZ1SUy4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v/xpoinfrUbahm5pVR44/vvDXOLCDsd1jjQlSTUpN1uWYU7nVy3ccV1ZTys9dzCS0 Yk6GFfYNv9QQidB5vwCS1nnWgaP5NcjOA2NrxVQFOUpZUopmqUayTGaLnvp5iUFoEI YJjt0+LfpGK9XaMTnY/vL/wX6tWJN2QvkBYnoUno= 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.8 02/20] ASoC: pcm3168a: ignore 0 Hz settings Date: Mon, 21 Sep 2020 10:40:09 -0400 Message-Id: <20200921144027.2135390-2-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200921144027.2135390-1-sashal@kernel.org> References: <20200921144027.2135390-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 9711fab296ebc..045c6f8b26bef 100644 --- a/sound/soc/codecs/pcm3168a.c +++ b/sound/soc/codecs/pcm3168a.c @@ -306,6 +306,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