From patchwork Mon Jul 28 12:46:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Nazzareno Trimarchi X-Patchwork-Id: 4634211 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E060C9F36A for ; Mon, 28 Jul 2014 12:47:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 221C9201B4 for ; Mon, 28 Jul 2014 12:47:08 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id DBE082018B for ; Mon, 28 Jul 2014 12:47:06 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 47AB82650F5; Mon, 28 Jul 2014 14:47:05 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 427C72619FE; Mon, 28 Jul 2014 14:46:54 +0200 (CEST) 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 D23CB261B1B; Mon, 28 Jul 2014 14:46:52 +0200 (CEST) Received: from mail-wg0-f46.google.com (mail-wg0-f46.google.com [74.125.82.46]) by alsa0.perex.cz (Postfix) with ESMTP id D85432619FE for ; Mon, 28 Jul 2014 14:46:44 +0200 (CEST) Received: by mail-wg0-f46.google.com with SMTP id m15so7263605wgh.5 for ; Mon, 28 Jul 2014 05:46:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=o+TLk0yFeBRWRf++1af4+B3/ZouqBkIpBRCDDPtlER8=; b=PyaIZsWT9jFzpyO3zQqvKh8/IVVXovJZ4hDzaOOCBBciN4EUKWXIwmlW/V2G4Q+h3m o7hWD3v0teo+mre4JSP51C1uogtdIfjdA77hR8jMxpU3GWrQPj3R90kAQRoDO/Av4dps pPCukIjal2pR/EZdsN2RPf1R0Dd658HKx8DqfKaikm8+ZQLQ+UcR2skVTSppJp9iq2c4 0K46f/iINni8ulp1rTAefzRFWC45Hj8H9izmq9AKfXuoWGgmC/QQLSRHlPXUTeK89L+U wkC8cj7dcu6/ZYZG91FWO1Lv1DhecBdl/rARrEMmiUzOMviMgzh4fEa58S0I6PVddt9f iiQg== X-Gm-Message-State: ALoCoQn+hRW2uGEoP9dO8E4BVNCoSTzFoXrjFrx3/CbG/R6OeltZ4gSc75t/b9In3rSTabe2fKu7 X-Received: by 10.180.210.172 with SMTP id mv12mr30466657wic.14.1406551600388; Mon, 28 Jul 2014 05:46:40 -0700 (PDT) Received: from localhost.localdomain (nat-cataldo.sssup.it. [193.205.81.5]) by mx.google.com with ESMTPSA id de6sm49302176wjc.16.2014.07.28.05.46.39 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 28 Jul 2014 05:46:39 -0700 (PDT) From: Michael Trimarchi To: Timur Tabi Date: Mon, 28 Jul 2014 14:46:38 +0200 Message-Id: <1406551598-14740-1-git-send-email-michael@amarulasolutions.com> X-Mailer: git-send-email 1.8.1.2 Cc: Markus Pargmann , alsa-devel@alsa-project.org, Mark Brown , Liam Girdwood Subject: [alsa-devel] [RFC PATCH] ASoC: fsl-ssi: Add support for CBM_CFS 16/24 bit 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 Signed-off-by: Michael Trimarchi --- sound/soc/fsl/fsl_ssi.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 9bfef55..743e50d 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -724,10 +724,19 @@ static int fsl_ssi_hw_params(struct snd_pcm_substream *substream, regmap_update_bits(regs, CCSR_SSI_SRCCR, CCSR_SSI_SxCCR_WL_MASK, wl); - if (!fsl_ssi_is_ac97(ssi_private)) + if (!fsl_ssi_is_ac97(ssi_private)) { + u8 i2smode; + + if (ssi_private->i2s_mode == (CCSR_SSI_SCR_I2S_MODE_NORMAL | + CCSR_SSI_SCR_NET) && sample_size >= 24) + i2smode = CCSR_SSI_SCR_I2S_MODE_MASTER; + else + i2smode = ssi_private->i2s_mode; + regmap_update_bits(regs, CCSR_SSI_SCR, CCSR_SSI_SCR_NET | CCSR_SSI_SCR_I2S_MODE_MASK, - channels == 1 ? 0 : ssi_private->i2s_mode); + channels == 1 ? 0 : i2smode); + } return 0; } @@ -789,6 +798,15 @@ static int _fsl_ssi_set_dai_fmt(struct fsl_ssi_private *ssi_private, CCSR_SSI_SxCCR_DC_MASK, CCSR_SSI_SxCCR_DC(2)); break; + case SND_SOC_DAIFMT_CBM_CFS: + ssi_private->i2s_mode |= CCSR_SSI_SCR_I2S_MODE_NORMAL; + regmap_update_bits(regs, CCSR_SSI_STCCR, + CCSR_SSI_SxCCR_DC_MASK, + CCSR_SSI_SxCCR_DC(2)); + regmap_update_bits(regs, CCSR_SSI_SRCCR, + CCSR_SSI_SxCCR_DC_MASK, + CCSR_SSI_SxCCR_DC(2)); + break; case SND_SOC_DAIFMT_CBM_CFM: ssi_private->i2s_mode |= CCSR_SSI_SCR_I2S_MODE_SLAVE; break; @@ -853,6 +871,11 @@ static int _fsl_ssi_set_dai_fmt(struct fsl_ssi_private *ssi_private, case SND_SOC_DAIFMT_CBM_CFM: scr &= ~CCSR_SSI_SCR_SYS_CLK_EN; break; + case SND_SOC_DAIFMT_CBM_CFS: + strcr &= ~CCSR_SSI_STCR_TXDIR; + strcr |= CCSR_SSI_STCR_TFDIR; + scr &= ~CCSR_SSI_SCR_SYS_CLK_EN; + break; default: return -EINVAL; }