From patchwork Mon Aug 31 17:24:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Thomson X-Patchwork-Id: 7100561 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B0ED49F1D5 for ; Mon, 31 Aug 2015 17:24:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E343E206E5 for ; Mon, 31 Aug 2015 17:24:33 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id AD708206E9 for ; Mon, 31 Aug 2015 17:24:32 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 5EC48261643; Mon, 31 Aug 2015 19:24:31 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id ECD5C260527; Mon, 31 Aug 2015 19:24:22 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 542B3260533; Mon, 31 Aug 2015 19:24:22 +0200 (CEST) Received: from mail1.bemta5.messagelabs.com (mail1.bemta5.messagelabs.com [195.245.231.138]) by alsa0.perex.cz (Postfix) with ESMTP id 0DC662604F8 for ; Mon, 31 Aug 2015 19:24:14 +0200 (CEST) Received: from [85.158.139.35] by server-2.bemta-5.messagelabs.com id DC/E0-31450-DBD84E55; Mon, 31 Aug 2015 17:24:13 +0000 X-Env-Sender: Adam.Thomson.Opensource@diasemi.com X-Msg-Ref: server-3.tower-179.messagelabs.com!1441041853!40891442!1 X-Originating-IP: [82.210.246.133] X-StarScan-Received: X-StarScan-Version: 6.13.16; banners=-,-,- X-VirusChecked: Checked Received: (qmail 15502 invoked from network); 31 Aug 2015 17:24:13 -0000 Received: from mailrelay1.diasemi.com (HELO NB-EX-CASHUB01.diasemi.com) (82.210.246.133) by server-3.tower-179.messagelabs.com with AES128-SHA encrypted SMTP; 31 Aug 2015 17:24:13 -0000 Received: from mailrelay1.diasemi.com (10.1.17.243) by NB-EX-CASHUB01.diasemi.com (10.1.16.140) with Microsoft SMTP Server id 14.3.248.2; Mon, 31 Aug 2015 19:24:12 +0200 Received: from swsrvapps-01.diasemi.com (Not Verified[10.20.28.141]) by mailrelay1.diasemi.com with ESMTP Gateway id ; Mon, 31 Aug 2015 19:24:12 +0200 Received: (from athomson@localhost) by swsrvapps-01.diasemi.com (8.14.3/8.14.3/Submit/Dlg) id t7VHO9Ra024184; Mon, 31 Aug 2015 18:24:09 +0100 X-Authentication-Warning: swsrvapps-01.diasemi.com: athomson set sender to Adam.Thomson.Opensource@diasemi.com using -f Message-ID: <9f62b701350bbb1857b56ba22bb832d7550b676e.1441041757.git.Adam.Thomson.Opensource@diasemi.com> From: Adam Thomson Date: Mon, 31 Aug 2015 18:24:09 +0100 To: Mark Brown MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: 8d172408-bd6a-42b1-8e53-daaedf35a5af Cc: alsa-devel@alsa-project.org, Timur Tabi , support.opensource@diasemi.com, Xiubo Li , linux-kernel@vger.kernel.org, Liam Girdwood , Takashi Iwai , Nicolin Chen , linuxppc-dev@lists.ozlabs.org Subject: [alsa-devel] [PATCH] ASoC: fsl_ssi: Fix checking of dai format for AC97 mode X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Current code incorrectly treats dai format for AC97 as bit mask whereas it's actually an integer value. This causes DAI formats other than AC97 (e.g. DSP_B) to trigger AC97 related code, which is incorrect and breaks functionality. This patch fixes the code to correctly compare values to determine AC97 or not. Signed-off-by: Adam Thomson --- sound/soc/fsl/fsl_ssi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index c0b940e..ee47041 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -249,7 +249,8 @@ MODULE_DEVICE_TABLE(of, fsl_ssi_ids); static bool fsl_ssi_is_ac97(struct fsl_ssi_private *ssi_private) { - return !!(ssi_private->dai_fmt & SND_SOC_DAIFMT_AC97); + return (ssi_private->dai_fmt & SND_SOC_DAIFMT_FORMAT_MASK) == + SND_SOC_DAIFMT_AC97; } static bool fsl_ssi_is_i2s_master(struct fsl_ssi_private *ssi_private) @@ -945,7 +946,7 @@ static int _fsl_ssi_set_dai_fmt(struct device *dev, CCSR_SSI_SCR_TCH_EN); } - if (fmt & SND_SOC_DAIFMT_AC97) + if ((fmt & SND_SOC_DAIFMT_FORMAT_MASK) == SND_SOC_DAIFMT_AC97) fsl_ssi_setup_ac97(ssi_private); return 0;