From patchwork Mon Jan 15 04:21:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolin Chen X-Patchwork-Id: 10163007 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6EDEC601C0 for ; Mon, 15 Jan 2018 04:24:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7165228904 for ; Mon, 15 Jan 2018 04:24:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 64366289FD; Mon, 15 Jan 2018 04:24:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A500628904 for ; Mon, 15 Jan 2018 04:24:12 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id E83F82673A1; Mon, 15 Jan 2018 05:22:33 +0100 (CET) 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 4CD44267377; Mon, 15 Jan 2018 05:22:28 +0100 (CET) Received: from mail-pf0-f196.google.com (mail-pf0-f196.google.com [209.85.192.196]) by alsa0.perex.cz (Postfix) with ESMTP id 3D53C26734C for ; Mon, 15 Jan 2018 05:22:24 +0100 (CET) Received: by mail-pf0-f196.google.com with SMTP id b25so1187764pfd.9 for ; Sun, 14 Jan 2018 20:22:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=D++2MWE/6exk1FiG3KPk/mBu+gQC7bDIip9s73XeYSI=; b=Z42GBHMgk2dj52+/+GZ+KQxOh6YBplkL1Dxy/zo5Rs9zKhGxVHpDOylQW9SakeyfgI 54G71JSV6ubUixc9CdtfTZcMhEm07s3rtKrLfU66RYTqDF8vf95xztc7mGAZfEuNVMhZ kZumCBIiOk1TTF8ugIx34qAxmBVN7KgaPnWdfMnyQFTs3cBxbwZkm+7p5CWgdzafMrZX 4PXxghTP8Pl98MjjjLFj3Gb2QBkdk1TUUQKGO5sFsk0r56aXUIb6yJXjeTrWrUR1Sr9r GL6QCijhvccfbln20BudbBLlb8Kn7UOSRNfOV0JTZOFCDlsoOzvl1CsJ4A2x5O3IW9j6 /LnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=D++2MWE/6exk1FiG3KPk/mBu+gQC7bDIip9s73XeYSI=; b=Qo6bmT6xCfcwE5sYBI2uuIdHkCC7l03U8C/ODxSPeazvebAjMyGw6fp+aa87NnvMpY vzKEX59q9Xb6vZ5+da0zR/F8LpR9ssFKaRxZ8LrOV9bwQWLCu5nwfftENTLH0lnov9YP XmuqyLQqjhHCbbQMN+enIt5y8ykLla+CJcjZC4KepGXE7RAknsgukkr5bIzkwvF1tMfQ mSzgMWi9Iiz7UTmX7DGfn8csi12xRqVLpRtiYfg9ozV9KJ5f1PA4od/qq6R+uSOxQT23 ccbpE2RiXXONN6wQojN05MfWci0A1oIeViEnzOiqhfQxiT0FeDsx5EcgI+kHyhhgAg7Y 6+YQ== X-Gm-Message-State: AKGB3mIO3WKhMNAA6yHSk3U9tmKaiQhTF+EIOCUyvZrAq+jYR9mNhA/X k4/Wsu9zSBVEsxJnB4Erh9E= X-Google-Smtp-Source: ACJfBosRlaHMfL636mTwFQ+0nOFooA4DqKmuRE5oqh3KVeE9wl0FPsSyNAQznxK9aGdglIkqKsoNwQ== X-Received: by 10.99.114.23 with SMTP id n23mr19840500pgc.407.1515990143725; Sun, 14 Jan 2018 20:22:23 -0800 (PST) Received: from Asurada-CZ80.localdomain (c-73-231-2-134.hsd1.ca.comcast.net. [73.231.2.134]) by smtp.gmail.com with ESMTPSA id v7sm17011018pgs.83.2018.01.14.20.22.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 14 Jan 2018 20:22:23 -0800 (PST) From: Nicolin Chen To: timur@tabi.org, broonie@kernel.org, mail@maciej.szmigiero.name Date: Sun, 14 Jan 2018 20:21:18 -0800 Message-Id: <1515990087-11598-9-git-send-email-nicoleotsuka@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515990087-11598-1-git-send-email-nicoleotsuka@gmail.com> References: <1515990087-11598-1-git-send-email-nicoleotsuka@gmail.com> Cc: alsa-devel@alsa-project.org, kernel@pengutronix.de, linux-kernel@vger.kernel.org, caleb@crome.org, lgirdwood@gmail.com, arnaud.mouiche@invoxia.com, lukma@denx.de, fabio.estevam@nxp.com, linuxppc-dev@lists.ozlabs.org Subject: [alsa-devel] [PATCH v3 08/17] ASoC: fsl_ssi: Add DAIFMT define for AC97 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 The _fsl_ssi_set_dai_fmt() bypasses an undefined format for AC97 mode. However, it's not really necessary if AC97 has its complete format defined. So this patch adds a DAIFMT macro of complete format including a clock direction and polarity. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- sound/soc/fsl/fsl_ssi.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 7a6a32b..b76a517 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -90,6 +90,16 @@ SNDRV_PCM_FMTBIT_S24_LE) #endif +/* + * In AC97 mode, TXDIR bit is forced to 0 and TFDIR bit is forced to 1: + * - SSI inputs external bit clock and outputs frame sync clock -- CBM_CFS + * - Also have NB_NF to mark these two clocks will not be inverted + */ +#define FSLSSI_AC97_DAIFMT \ + (SND_SOC_DAIFMT_AC97 | \ + SND_SOC_DAIFMT_CBM_CFS | \ + SND_SOC_DAIFMT_NB_NF) + #define FSLSSI_SIER_DBG_RX_FLAGS \ (SSI_SIER_RFF0_EN | \ SSI_SIER_RLS_EN | \ @@ -964,8 +974,7 @@ static int _fsl_ssi_set_dai_fmt(struct device *dev, scr &= ~SSI_SCR_SYS_CLK_EN; break; default: - if (!fsl_ssi_is_ac97(ssi)) - return -EINVAL; + return -EINVAL; } stcr |= strcr; @@ -1372,7 +1381,7 @@ static int fsl_ssi_probe(struct platform_device *pdev) sprop = of_get_property(np, "fsl,mode", NULL); if (sprop) { if (!strcmp(sprop, "ac97-slave")) - ssi->dai_fmt = SND_SOC_DAIFMT_AC97; + ssi->dai_fmt = FSLSSI_AC97_DAIFMT; } /* Select DMA or FIQ */