Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10120820ybi; Wed, 24 Jul 2019 16:28:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqybJ5mD62sl1aQPwecMu+HXWfvpHCcyyHPcg3DKGfvKZjS09epvv/GTwhB8aW2fJHX6f6Gc X-Received: by 2002:a62:e315:: with SMTP id g21mr14104597pfh.225.1564010912316; Wed, 24 Jul 2019 16:28:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564010912; cv=none; d=google.com; s=arc-20160816; b=gBsnG3aWZjW8de6VYb0wIoi2iDr88YOiJiKmzx8wnt36eA80g4GL+puAMXZPv4t9jt EmXBUf1bnobZGfqB0qtg3pHFofxBAh5rXvOH5i/N2Q6q/j/X3J9yxB2vQsj9+oBvWvxR PmK0CJTIztoab+/DoWPJmZyK1PpnR2O4hY3/d6uiFXtIfXQbifscb4ZnoZ+z2nCd+LGA 3h91FnJM9XTO33RK5bQj6ee5etrFc20sVpsLWyDmVs8yK8UiUHPTu15nqbj4NmO9vucU IadmHrcKYgQkn+42a/QEcNSFy50cZjtEGTp+A45WJTdMRI1ixLb3So1IaEjz/1ggyW5g ZLQQ== 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=GiGbiqUQU37kT6GKXxitH0RUlC4/fjqeNs+jWXGw0ME=; b=ncrsdLEXLUdscHr7XqRGBzkIPKyV9xxNt0FshEH8ZJvgotZQ+7ZbHbTB2/iGer9gdN BYr41CXquUcAn0M+dHMZGxeeCDAnEv3Nva69RGpfP3xG+sd0WKyJMNH5ky+7jelRaIAp 1ncvhxbAoYeRjaSwIQbYcVSDXbxV7dhN7uQGhZziZ8HIomHFJylZ1nFZBB1ZYGNgc54E FnbQ8GZnYl+12n8Uj8jsYEHH+sept+xgvsfLfzTFppkiZlOUFjBxxenCefmshkvlIX2q 1CMwro0iyJOSww3A1BhtOfk9RTV1GNGudW1ctKa6U09dgu+qwV0HXF768JAOCqZKRuX5 gtow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sreKQY1k; 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 l64si13480697pjb.93.2019.07.24.16.28.17; Wed, 24 Jul 2019 16:28:32 -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=sreKQY1k; 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 S2388106AbfGXT1X (ORCPT + 99 others); Wed, 24 Jul 2019 15:27:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:44956 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728748AbfGXT1U (ORCPT ); Wed, 24 Jul 2019 15:27: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 D333121951; Wed, 24 Jul 2019 19:27:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563996440; bh=1d6+62kb1Pf/ZAwkeN74tfLs5AAmRHl8t/OHbwtkFGU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sreKQY1k6tZ1ZA9ZM/HG1pWBM4id2VxYDQTkEif0jIGhI2MYrCVz6IG8mB1zIYbaD WundTms21QHkV8l6KcGQHR6L2W1LOIDlDuRWE1q+QXLdu9OOqkGBSCMaGdyLlOniyi 2katpCCJKal8rHJB21pXvtOfsn/SZSF6VmxND7uw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jerome Brunet , Mark Brown , Sasha Levin Subject: [PATCH 5.2 097/413] ASoC: meson: axg-tdm: fix sample clock inversion Date: Wed, 24 Jul 2019 21:16:28 +0200 Message-Id: <20190724191742.031707900@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@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 [ Upstream commit cb36ff785e868992e96e8b9e5a0c2822b680a9e2 ] The content of SND_SOC_DAIFMT_FORMAT_MASK is a number, not a bitfield, so the test to check if the format is i2s is wrong. Because of this the clock setting may be wrong. For example, the sample clock gets inverted in DSP B mode, when it should not. Fix the lrclk invert helper function Fixes: 1a11d88f499c ("ASoC: meson: add tdm formatter base driver") Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/meson/axg-tdm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/meson/axg-tdm.h b/sound/soc/meson/axg-tdm.h index e578b6f40a07..5774ce0916d4 100644 --- a/sound/soc/meson/axg-tdm.h +++ b/sound/soc/meson/axg-tdm.h @@ -40,7 +40,7 @@ struct axg_tdm_iface { static inline bool axg_tdm_lrclk_invert(unsigned int fmt) { - return (fmt & SND_SOC_DAIFMT_I2S) ^ + return ((fmt & SND_SOC_DAIFMT_FORMAT_MASK) == SND_SOC_DAIFMT_I2S) ^ !!(fmt & (SND_SOC_DAIFMT_IB_IF | SND_SOC_DAIFMT_NB_IF)); } -- 2.20.1