From patchwork Mon Feb 12 22:03:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolin Chen X-Patchwork-Id: 10214591 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 76E2D6055C for ; Mon, 12 Feb 2018 22:04:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 51E0F26538 for ; Mon, 12 Feb 2018 22:04:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 46CD9289C9; Mon, 12 Feb 2018 22:04:25 +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 8A2CC289C2 for ; Mon, 12 Feb 2018 22:04:24 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 68AE626765F; Mon, 12 Feb 2018 23:02:55 +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 8E7BD26764B; Mon, 12 Feb 2018 23:02:53 +0100 (CET) Received: from mail-pl0-f65.google.com (mail-pl0-f65.google.com [209.85.160.65]) by alsa0.perex.cz (Postfix) with ESMTP id 6F21E26761B for ; Mon, 12 Feb 2018 23:02:49 +0100 (CET) Received: by mail-pl0-f65.google.com with SMTP id 31so116667ple.9 for ; Mon, 12 Feb 2018 14:02:49 -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=FMaDMBxcC273WYHQLMBx0JdRlw0jkYQhITGwUUxyVyM=; b=l7QpZsIftGTPPG5uDimcYllkooqIhZhlaBT7ve8PjAuXY7D+pp1xmq0IONaTL0YE5J IBlwvfCEpcVQsw1upQDw717EIKhg9Jyzx8U5X8QQi4sWzKyoCGt4iNBnZpFxfy9T9iOd 8pqj46wLIkBbIGgsNPwIu0eRAxiHsSTVkwE24JCW8UCxRjbeeAnFDLhsY5Fs/0wz3tCJ Xi+iWEK7ufTJ0O3Nhzy8RDJ0A5sP2RQ/+CRDgdNCT+xt9dTNSi1najU8qVy5qZ4SY1Zn 8XXPya6Sqt2Abt44pbOfSVui6wz3w2xz96IPrCtL1GvUf3WxBt9XY8kXoL3RvOvBDTvz hHzw== 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=FMaDMBxcC273WYHQLMBx0JdRlw0jkYQhITGwUUxyVyM=; b=eSbRSl6wuZYxSsBQVXTL8mxD+KM7dbbDpayfRSBavOFqiGPHc5KA/jiIRGjz//1AqY C4Zq4ilthSgflGkyIJJVthatheLibYmFoYUW21CffhWXY17SyFWmucmR3UL7UN3oGL4j wvLimo2RfTEuY4Oym3/zyp+nRn/hGxBtgldlUpPg+s1EsyGIVRMj/WDlk8dIyqC+lnsa Z9Ncj/OO9n4Wps7buz7slNxkJHEuRseClQNLM+0CYi7gMhI1p+byw8MswLphq2X15ntR bcApwrw6G5dexH6PXLGAnPrK8yJuBicmu2FEHj19+olDvxsxpPuXxIjH4MnMR/AB/BOq nKxw== X-Gm-Message-State: APf1xPDGUph8cvyvOXeOPZ0f8BY23BJFt9QYINnm4M1pfhZfg8zls6AX foPd7LuU884lpTmtVpv6Aeo= X-Google-Smtp-Source: AH8x224xOXEhvWkStnWzLn8lXB05uoL+xuu3dmWvPAbJROSXw5ybXWe8974jKv6KN8u9cCp3v405wg== X-Received: by 2002:a17:902:24a5:: with SMTP id w34-v6mr2813751pla.221.1518472968298; Mon, 12 Feb 2018 14:02:48 -0800 (PST) Received: from Asurada-Nvidia.nvidia.com (thunderhill.nvidia.com. [216.228.112.22]) by smtp.gmail.com with ESMTPSA id c8sm13386159pgn.72.2018.02.12.14.02.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Feb 2018 14:02:47 -0800 (PST) From: Nicolin Chen To: broonie@kernel.org, timur@tabi.org Date: Mon, 12 Feb 2018 14:03:16 -0800 Message-Id: <1518473005-14090-9-git-send-email-nicoleotsuka@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1518473005-14090-1-git-send-email-nicoleotsuka@gmail.com> References: <1518473005-14090-1-git-send-email-nicoleotsuka@gmail.com> Cc: mail@maciej.szmigiero.name, kernel@pengutronix.de, lgirdwood@gmail.com, alsa-devel@alsa-project.org, caleb@crome.org, linux-kernel@vger.kernel.org, arnaud.mouiche@invoxia.com, lukma@denx.de, fabio.estevam@nxp.com, linuxppc-dev@lists.ozlabs.org Subject: [alsa-devel] [PATCH v6 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 Tested-by: Maciej S. Szmigiero Reviewed-by: Maciej S. Szmigiero --- 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 9f024a9..fc5768d 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 */