From patchwork Fri Oct 2 15:33:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anatol Pomozov X-Patchwork-Id: 7317291 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 00D619F1D5 for ; Fri, 2 Oct 2015 15:33:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2B38420762 for ; Fri, 2 Oct 2015 15:33:34 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id E82C420734 for ; Fri, 2 Oct 2015 15:33:32 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id D295F261481; Fri, 2 Oct 2015 17:33:26 +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 BDBD02612BD; Fri, 2 Oct 2015 17:33:18 +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 E28DA2612C6; Fri, 2 Oct 2015 17:33:17 +0200 (CEST) Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com [209.85.220.43]) by alsa0.perex.cz (Postfix) with ESMTP id BE4E92612AF for ; Fri, 2 Oct 2015 17:33:10 +0200 (CEST) Received: by pacex6 with SMTP id ex6so109588175pac.0 for ; Fri, 02 Oct 2015 08:33:09 -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=JSky0aEG3DAvTb2YZtOG3VXmoyNMbBY9jcHH5c6t81j5XB5S6Z4o6E7EH7UJcbLYXR yf0YGJ5yrUVBfKkbVpZGZQN7/4++isdaSnjGjuzV6sEwOhGvJUxKZpCXmNqh8InxC70U gznbr+pcbbSEQqBJZtfux+rWCCmR4Bhj1XAZc8ZJuA8zQAYUmZ3VwYtJWQQlPCizPICA HA67IAXi+RnpToK738PT88UOeBmJASE345R3WLTrW8yCYeB4OQQkMq3nlAgPOblcOk68 gDXSoBMmP30t4ywROrTDk05RCGf0Rq4zVp2hI1dV+Q8/K/aQBWF1DAInVeZtf4CszGPv q63w== X-Received: by 10.66.229.67 with SMTP id so3mr21234777pac.66.1443799989706; Fri, 02 Oct 2015 08:33:09 -0700 (PDT) Received: from anatol.mtv.corp.google.com ([172.22.64.197]) by smtp.gmail.com with ESMTPSA id ux7sm12666840pac.10.2015.10.02.08.33.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 02 Oct 2015 08:33:09 -0700 (PDT) From: Anatol Pomozov To: alsa-devel@alsa-project.org Date: Fri, 2 Oct 2015 08:33:04 -0700 Message-Id: <1443799984-26679-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 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 Reviewed-by: Benoît Thébaudeau --- 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 */