From patchwork Mon Jan 15 23:16:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolin Chen X-Patchwork-Id: 10165467 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 1AF60602C2 for ; Mon, 15 Jan 2018 23:19:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B20226E3A for ; Mon, 15 Jan 2018 23:19:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F32FE27BFF; Mon, 15 Jan 2018 23:19:47 +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 A905926E3A for ; Mon, 15 Jan 2018 23:19:46 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id CB4E1267663; Tue, 16 Jan 2018 00:17:44 +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 8F048267645; Tue, 16 Jan 2018 00:17:36 +0100 (CET) Received: from mail-pg0-f67.google.com (mail-pg0-f67.google.com [74.125.83.67]) by alsa0.perex.cz (Postfix) with ESMTP id 21E41267630 for ; Tue, 16 Jan 2018 00:17:33 +0100 (CET) Received: by mail-pg0-f67.google.com with SMTP id g16so1979863pgn.7 for ; Mon, 15 Jan 2018 15:17:33 -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=XQHXqg7aobTdM3pV+vVMyid8mcT9AYRJQRbE4CTYaG3tHF6NkT4MVXLcVQCHVuiKlp U3qbWVdkZ56nNkDUHZEUSal7Ab2ZTkLfiJg6KbQPLOwT5bREEBpJxTITkHHStEzAwaPl nGlxIfJg+r18d0dFVXlK+whU+ajZND5RPFKL/MkdMgJmPMn0TkrmjBkzqSE3T4gEExeL svh94SxuTW8ecRptHDb0REO4ElogaKDlqqOukE6bwJr+6DQgpGfCqN2XvP/z79yMuZBB Xdjp7n0rhrlu40IUIWkJhjEsmliEBDcr6MYaNFgHi8iqoRNYf57V3kqjxvCB0T8w7j3Y /ocQ== 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=MQeot96+6S4JScUUmMl5wWpQONgklLtj6DMXyupb1JbB0GU4ESn5+i+CoOB85UhCVd ie5pkMeHP8e1DrKoF5X115t1GG3YoGvc5hYsVaxJsVJnwiYpi+CdZBCAvBLzb/gkPdZC Q7lFEYeUdRWO+ON2jLS/RimLuUB475DIniLnAE39WBtQ3qPPAR6YsZMh3q4sUeRx3Qx7 Ie858nSIUOywfldbXxr1HGJrEf/744T+NBsdDTxesjIzia4U1hIjfsIIv1Aq4ppK5m0u EGDWP7cj5DxAnBUwZ53R3axkFdR7Mg1Qcm/vi/yEnY9DV+GnG+27RheqcCcwoZmOwnUu CDRA== X-Gm-Message-State: AKGB3mLycFW8ELj1C4ag04JIZO5T6mEMoV5mneBmQBTC18XEbNN3j6E5 TAlbWK8qMFhH3LW4tFbg2xI= X-Google-Smtp-Source: ACJfBovj9tVbXAa94XLGCSgmbgDZIvSM/P7RdbROeeqHH2ARdzJ/CweYGKzfCsytMkqnCfhyQe8uEA== X-Received: by 10.98.182.4 with SMTP id j4mr32753904pff.220.1516058250561; Mon, 15 Jan 2018 15:17:30 -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 b6sm776442pfe.85.2018.01.15.15.17.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 15 Jan 2018 15:17:29 -0800 (PST) From: Nicolin Chen To: timur@tabi.org, broonie@kernel.org, mail@maciej.szmigiero.name Date: Mon, 15 Jan 2018 15:16:23 -0800 Message-Id: <1516058192-65519-9-git-send-email-nicoleotsuka@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516058192-65519-1-git-send-email-nicoleotsuka@gmail.com> References: <1516058192-65519-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 v4 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 */