From patchwork Thu Oct 1 18:09:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatol Pomozov X-Patchwork-Id: 7310471 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 DF740BEEA4 for ; Thu, 1 Oct 2015 18:09:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 14F0D2078A for ; Thu, 1 Oct 2015 18:09:58 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id CD56820781 for ; Thu, 1 Oct 2015 18:09:56 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 1B8CC2667F8; Thu, 1 Oct 2015 20:09:54 +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, NO_DNS_FOR_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 851D42667EE; Thu, 1 Oct 2015 20:09:51 +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 B0C0A2667F0; Thu, 1 Oct 2015 20:09:50 +0200 (CEST) Received: from mail-pa0-f41.google.com (mail-pa0-f41.google.com [209.85.220.41]) by alsa0.perex.cz (Postfix) with ESMTP id AAE532667EE for ; Thu, 1 Oct 2015 20:09:43 +0200 (CEST) Received: by padhy16 with SMTP id hy16so81362207pad.1 for ; Thu, 01 Oct 2015 11:09:42 -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=CYhIB0lCD45CMu1fPf7X00t9ClVa6jDno2LKOo9hl/Y=; b=jIIT3d+wwly2W0IUTyZ7RgK1SZ3YUvsOGkZP47C2q9PCK2ifWtTwxHgeMb0Bpn+5wF YUjxbQFJODVtP6V1a133e+qIuo8VA5CMTpMVi+LAI7PD23En1jROamGARhjymAcKclQH LSk+FjQJ0FhERe5OQeOiQaHJXZarhQ54wV0rJmF/bpjwxlKj85qj9lDGS1JvOxVGdIOU gTvcQwZbR92FVaRBnlOb5r2aLlfnhk9c+m0Xi6vNazlA6zrR5kvB+seFFZJJ9ugvoipU tSPELM3DQNT85DLso/nCb8GNBsnrJJMJkMXP/tUJLWu7F6oQneACPPDILB7S9sVjS6n2 J2MQ== X-Received: by 10.66.235.42 with SMTP id uj10mr13971762pac.32.1443722981946; Thu, 01 Oct 2015 11:09:41 -0700 (PDT) Received: from anatol.mtv.corp.google.com ([172.22.64.197]) by smtp.gmail.com with ESMTPSA id tz1sm7938402pbc.50.2015.10.01.11.09.40 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Oct 2015 11:09:41 -0700 (PDT) From: Anatol Pomozov To: alsa-devel@alsa-project.org Date: Thu, 1 Oct 2015 11:09:19 -0700 Message-Id: <1443722959-5094-1-git-send-email-anatol.pomozov@gmail.com> X-Mailer: git-send-email 2.6.0.rc2.230.g3dd15c0 Cc: albertchen@realtek.com, broonie@kernel.org, Anatol Pomozov , lars@metafoo.de, benoit.thebaudeau.dev@gmail.com 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 is FSYNC polarity. 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 "negative" polarity, while RT5677 assumes it is "positive" polarity. Explicitly specify meaning of BCLK/FSYNC polarity to avoid future compatibility problems. Signed-off-by: Anatol Pomozov --- include/sound/soc-dai.h | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 2df96b1..45198db 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h @@ -48,10 +48,22 @@ 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. + * - I2S right/left 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 */