From patchwork Sat Jun 17 14:25:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 105766 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp117815qgd; Sat, 17 Jun 2017 07:26:35 -0700 (PDT) X-Received: by 10.28.127.67 with SMTP id a64mr3311922wmd.112.1497709594982; Sat, 17 Jun 2017 07:26:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497709594; cv=none; d=google.com; s=arc-20160816; b=oM+Ixc0bqHuTVLRZVpqmnMb0bVDS5q+Y0zD+i1/9+Vm+Q4ZTZS9bl+OzRvYCVxnh8j 39+LjGRDFeYo/6nNsTuo4PefwLFwDf9rLCOgnE4xDRMrE1dAtg94aR6yU7LALbDR2lxk dZj1chhH9QC38UoqGqYsS2SaHWwHiOyhTml61An5FJXkZ7tnP51Bk7gNVuqALwJugRkt BUThIy8LpqPqxIG0gkAd1LMnu92x6KUMoBWrXHv2cIFwHY0S8mHBKpqRaVrr87TXF/9u J9sTa02uNB74dXYktGuRweRXgYW3vGEbsgLzyIgibhRn+bu1Ar48xHG2ZGW4KgUk+wUY /FZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:message-id:date:to:from:dmarc-filter :delivered-to:arc-authentication-results; bh=a0eyPXjJNGfKK4QvPFG8bjqeY8nMrLS8cQHGsJGL5k8=; b=g/o+LL0n9F1RAZQTzrZaZsKak5tVVGX8jbTKyybbNhltaGce205q15TdBt2wJ/1G5o eCM0+cyZFpPtb5E8ioVWxut6iA9adIeloMBeDnZum+cZ+pmdqCthBsuh4bsaAnu2fgSd dVNmc4PquXqWd+Vc/Vfe8Fh9xcXnRLKyS9WdyaUOUyr2/zNKgiMa2FBNHvN+VFWa3cU6 O8yJshzkIkFPZNTClepIy7gZMOXotmxzqYcQiNIjZa9ZuKfw/nxPvQbKQUpbtqXTbjcq S08WVDhuTPY0zMKKq6IYBcsPn5sj6mZAJ+9asAPzvitGQaZUTSso13uQO/O96rhbTGzb 77TA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id 3si5058597wro.336.2017.06.17.07.26.34; Sat, 17 Jun 2017 07:26:34 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 352AE266D83; Sat, 17 Jun 2017 16:26:33 +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 9ABA8266DA5; Sat, 17 Jun 2017 16:26:31 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=T_RP_MATCHES_RCVD, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by alsa0.perex.cz (Postfix) with ESMTP id CE942266D6A for ; Sat, 17 Jun 2017 16:26:28 +0200 (CEST) Received: from localhost.localdomain (li411-102.members.linode.com [106.187.91.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3A7E2239CF; Sat, 17 Jun 2017 14:26:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3A7E2239CF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=shawnguo@kernel.org From: Shawn Guo To: Mark Brown Date: Sat, 17 Jun 2017 22:25:28 +0800 Message-Id: <1497709528-23036-1-git-send-email-shawnguo@kernel.org> X-Mailer: git-send-email 1.9.1 Cc: alsa-devel@alsa-project.org, Baoyou Xie , Xin Zhou , Jun Nie , Shawn Guo , linux-arm-kernel@lists.infradead.org Subject: [alsa-devel] [PATCH] ASoC: zx-i2s: flip I2S master/slave 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org From: Shawn Guo The SND_SOC_DAIFMT_MASTER bits are defined to specify the master/slave mode for Codec, not I2S. So the I2S master/slave mode should be flipped according to SND_SOC_DAIFMT_MASTER bits. Signed-off-by: Shawn Guo --- sound/soc/zte/zx-i2s.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) -- 1.9.1 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/zte/zx-i2s.c b/sound/soc/zte/zx-i2s.c index dd124d5acf01..16195ee776e5 100644 --- a/sound/soc/zte/zx-i2s.c +++ b/sound/soc/zte/zx-i2s.c @@ -203,13 +203,15 @@ static int zx_i2s_set_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt) switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { case SND_SOC_DAIFMT_CBM_CFM: - i2s->master = 1; - val |= ZX_I2S_TIMING_MAST; - break; - case SND_SOC_DAIFMT_CBS_CFS: + /* Codec is master, and I2S is slave. */ i2s->master = 0; val |= ZX_I2S_TIMING_SLAVE; break; + case SND_SOC_DAIFMT_CBS_CFS: + /* Codec is slave, and I2S is master. */ + i2s->master = 1; + val |= ZX_I2S_TIMING_MAST; + break; default: dev_err(cpu_dai->dev, "Unknown master/slave format\n"); return -EINVAL;