From patchwork Thu Jan 11 06:43:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolin Chen X-Patchwork-Id: 10157311 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 6161D601A1 for ; Thu, 11 Jan 2018 06:46:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53D5D286AE for ; Thu, 11 Jan 2018 06:46:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 48733286B5; Thu, 11 Jan 2018 06:46:19 +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 8180E286AE for ; Thu, 11 Jan 2018 06:46:18 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 932FC2678AC; Thu, 11 Jan 2018 07:44:23 +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 B750B267862; Thu, 11 Jan 2018 07:44:14 +0100 (CET) Received: from mail-pf0-f195.google.com (mail-pf0-f195.google.com [209.85.192.195]) by alsa0.perex.cz (Postfix) with ESMTP id 96325266F67 for ; Thu, 11 Jan 2018 07:44:12 +0100 (CET) Received: by mail-pf0-f195.google.com with SMTP id u19so875522pfa.12 for ; Wed, 10 Jan 2018 22:44:12 -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=m7/UYaNeUpNLz217hMGKggDIlnUEDtHFRw6g1hSFHxM=; b=ZmC+fPsN0uDv+3FR580a64GQhcaqpiNhtTpDvKmC/RXElSYcigfkESpu77QzJlwti2 J8YojMkKvqAIvGdQn4LRyCG5IW0s19nobE/I7MRp9zw+8xvkVSRQhJBb0XTmR3LgDZRi OF14xyrqRik5eyDrJXAC9DP+ipJU/0N22yJzksVnI9fH/Q+dQwIX6f2auwSqHiopFJ1L FSgUTbBP9AOcBkAaQcP62ZA5k2m/S4/LYxbdjiDxKV0xOGbXftXnHM5Be5NiVisbHips EXgKcNNklEzo2VNjr+xG+jJnFGvbJLc7H8XpBCOTFUGr/5Kut0LhgWxAfu+N/hfqAWsy OrwA== 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=m7/UYaNeUpNLz217hMGKggDIlnUEDtHFRw6g1hSFHxM=; b=NxXKhm4CEpPD6k79KEIC49HQPLf16+xFtBYKknfLhkFFCAzRsi81qO5He4ycr3Y1iG xKXuV1XEBjJbMofU3UBdxuYwyP6nS6uUCrHSewodoDsbhwWItHEYlS3yljt2XHUnBQeL izGExVDwzU8Yx/vVOmCHZfRutGK/xaLw4QzIC+SVtZKc75nvPGXrCpuenrrqaG2kOtWC eyqaqyoaq8Vt7hZJz3OV0oWFP28ecG6p208RwLeIynW/AzLHZ8O/I4YxHEdMEg49mo2q CzZtTCLuQWpZoF5f7TjKdmRMxDk4ISopsCo0C6Vn4bk4NmRkW3J2ViyHFCTeNF1uAKvw eyQQ== X-Gm-Message-State: AKwxytd6OaYDyWlhcV3qAFf8Wyy7J+2A6xdcPjedharCN30B6VGEKIox S+huENGCcPqBPGsQEq9t8w8= X-Google-Smtp-Source: ACJfBosBn0OlfZc1ao5+yTCobqQV+XWsnnHgA/0pr8xolqqhu6F9v2eQw+zgs2BnaVCWTL5NTbIyNQ== X-Received: by 10.159.233.193 with SMTP id b1mr1682088plr.428.1515653051388; Wed, 10 Jan 2018 22:44:11 -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 b69sm27959666pfk.128.2018.01.10.22.44.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 10 Jan 2018 22:44:10 -0800 (PST) From: Nicolin Chen To: timur@tabi.org, broonie@kernel.org, mail@maciej.szmigiero.name Date: Wed, 10 Jan 2018 22:43:06 -0800 Message-Id: <1515652995-15996-8-git-send-email-nicoleotsuka@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515652995-15996-1-git-send-email-nicoleotsuka@gmail.com> References: <1515652995-15996-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 v2 07/16] 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 09a571a..b449b8b 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -86,6 +86,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 | \ @@ -959,8 +969,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; @@ -1367,7 +1376,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 */