From patchwork Thu Oct 8 16:37:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatol Pomozov X-Patchwork-Id: 7354171 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B06B7BEEA4 for ; Thu, 8 Oct 2015 16:38:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D3F522063C for ; Thu, 8 Oct 2015 16:38:18 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 9C262207E4 for ; Thu, 8 Oct 2015 16:38:17 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 61BE7264F74; Thu, 8 Oct 2015 18:38:16 +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.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 5EB31264F23; Thu, 8 Oct 2015 18:38:08 +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 8F26F264F30; Thu, 8 Oct 2015 18:38:07 +0200 (CEST) Received: from mail-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) by alsa0.perex.cz (Postfix) with ESMTP id 8F9A1264F03 for ; Thu, 8 Oct 2015 18:38:00 +0200 (CEST) Received: by pabve7 with SMTP id ve7so773831pab.2 for ; Thu, 08 Oct 2015 09:37:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=VKsWrU+inGI1QiwyAOz7okMy40d2JHfP/PSRv2Ml07k=; b=HpgH9Jf5t6kyLR94GLgQIb7Q+b97IVSa/u1G60fhA/vHW5NtyX+JlqclA1Kh6cl+Lw iJsToEY7lzkDknGwQsLaffCwtr+Q1YURIbrtZpdXv4a7oD4NBMfXmvOigjUhZ3WTin0n Cqbm5Rk2dBqn45DZo/8S0j4c6Ox8k7yj+oXQ0/flHkjplfH5NN7PEvFmIJacl3wtm3Y5 1mIp4ZFlYKWbINdPc4n0Q+5sMrS9jKx4eEV1EGp9kgVUdlGaZ2afc0DTBPufbWcrbJIq Wy5Bh0bpPgouFlyRbeoDV9D1ALtoz3pvTRg5KMNEZ1HXSoZwuFEfsMjOQJK/wxBKhyBt xPKw== X-Received: by 10.68.143.4 with SMTP id sa4mr9055314pbb.111.1444322279383; Thu, 08 Oct 2015 09:37:59 -0700 (PDT) Received: from anatol.mtv.corp.google.com ([172.22.64.197]) by smtp.gmail.com with ESMTPSA id l16sm46437041pbq.22.2015.10.08.09.37.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 08 Oct 2015 09:37:58 -0700 (PDT) From: Anatol Pomozov To: alsa-devel@alsa-project.org Date: Thu, 8 Oct 2015 09:37:51 -0700 Message-Id: <1444322271-2819-1-git-send-email-anatol.pomozov@gmail.com> X-Mailer: git-send-email 2.6.0.rc2.230.g3dd15c0 Cc: broonie@kernel.org, Anatol Pomozov Subject: [alsa-devel] [PATCH] ASoC: Document DAI signal polarity 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 X-Virus-Scanned: ClamAV using ClamSMTP Currently there is no clear definition of what FSYNC polarity is. Different drivers use its own definition of what is "normal" and what is "inverted" fsync. This leads to compatibility problems between drivers. For example TegraX1 driver assumes that DSP-A format with frames starting at rising FSYNC edge has "inverted" polarity, while RT5677 assumes it is "normal" polarity. Explicitly specify meaning of BCLK/FSYNC polarity to avoid future compatibility problems. Signed-off-by: Anatol Pomozov --- include/sound/soc-dai.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 2df96b1..91e2e61 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h @@ -48,10 +48,25 @@ struct snd_compr_stream; #define SND_SOC_DAIFMT_GATED (0 << 4) /* clock is gated */ /* - * DAI hardware signal inversions. + * DAI hardware signal polarity. * * Specifies whether the DAI can also support inverted clocks for the specified * format. + * + * BCLK: + * - "normal" polarity means signal is available at rising edge of BCLK + * - "inverted" polarity means signal is available at falling edge of BCLK + * + * FSYNC "normal" polarity depends on the frame format: + * - I2S: frame consists of left then right channel data. Left channel starts + * with falling FSYNC edge, right channel starts with rising FSYNC edge. + * - Left/Right Justified: frame consists of left then right channel data. + * Left channel starts with rising FSYNC edge, right channel starts with + * falling FSYNC edge. + * - DSP A/B: Frame starts with rising FSYNC edge. + * - AC97: Frame starts with rising FSYNC edge. + * + * "Negative" FSYNC polarity is the one opposite of "normal" polarity. */ #define SND_SOC_DAIFMT_NB_NF (0 << 8) /* normal bit clock + frame */ #define SND_SOC_DAIFMT_NB_IF (2 << 8) /* normal BCLK + inv FRM */