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: 872430 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zgL0J1Gmqz9s7h for ; Tue, 13 Feb 2018 09:28:00 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="l7QpZsIf"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3zgL0H73S8zF0lH for ; Tue, 13 Feb 2018 09:27:59 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="l7QpZsIf"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400e:c01::242; helo=mail-pl0-x242.google.com; envelope-from=nicoleotsuka@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="l7QpZsIf"; dkim-atps=neutral Received: from mail-pl0-x242.google.com (mail-pl0-x242.google.com [IPv6:2607:f8b0:400e:c01::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3zgKRG1c9MzF0pv for ; Tue, 13 Feb 2018 09:02:50 +1100 (AEDT) Received: by mail-pl0-x242.google.com with SMTP id s13so2039693plq.6 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=TsES8iLT8RnECbmN0X9Rk+y9PACJ4Npv8nuz4zS8Jvt5ke6UW3l0CUok9Gc+GTOyFz kRKXYhlF7deW2JsH0jlbozuk6NhuPLvchVisa/ORSt8ZWgZu8hhMvRQyHQkX2NF+uB+K NYamiHytD/zwZvHUt7IGxk5HkDTL6A4h4XFHAQWC/hRp7GKD/0JGT9sTRQ32cjRAGId6 KpA3vj8Nrp5YZqAzypmMrlhp0NiuilWgy/rcoh4bDtnt9u7e0H8Q2NO+IQD2+OGm4mRv UcZ5fNkX2+tLiqT9s4jhoh7twyuFaIupAPqVUDe/0cnmWB9RmjSzp779n2i2T9C77dxy NbFg== X-Gm-Message-State: APf1xPD0oqY4eeO7rmTe1s1P1dPwyUVv/iVk8+njk3sK/00k5sENcECg WKw0U6xyq5h6Cda+bbSPKGE= 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 Subject: [PATCH v6 08/17] ASoC: fsl_ssi: Add DAIFMT define for AC97 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> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 */