From patchwork Sat Apr 26 14:49:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Shiyan X-Patchwork-Id: 4068681 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 777B89F271 for ; Sat, 26 Apr 2014 14:49:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A5E7C20274 for ; Sat, 26 Apr 2014 14:49:47 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 43C5C20263 for ; Sat, 26 Apr 2014 14:49:46 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 49B272616B9; Sat, 26 Apr 2014 16:49:44 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM, NO_DNS_FOR_FROM, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 2286D2610D6; Sat, 26 Apr 2014 16:49:34 +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 877652615EC; Sat, 26 Apr 2014 16:49:32 +0200 (CEST) Received: from smtp30.i.mail.ru (smtp30.i.mail.ru [94.100.177.90]) by alsa0.perex.cz (Postfix) with ESMTP id 566F22610D4 for ; Sat, 26 Apr 2014 16:49:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail2; h=Message-Id:Date:Subject:Cc:To:From; bh=M/m5LzfoPs1fVu7L5rbyxqRHgv2ZXeq2AnSU97dZbHo=; b=CsWw3FkMAA92hTPPDLq+oUyUEoEj/2aKD6Zp68Vc0rC81Vpey1y4zSIqx3eW8Axb4ZijqqBxD8aanBsfZy+0Odq13PWZ0G6JZN1l1pR8YRYtL3eW4aCKY15GRJBVIpyi2NnuZn4epb6Zh0hLf1HmjTZB+rYvKBMl5yvtOJ3uO1Q=; Received: from [5.18.98.0] (port=43653 helo=shc.zet) by smtp30.i.mail.ru with esmtpa (envelope-from ) id 1We3us-0007mi-ET; Sat, 26 Apr 2014 18:49:22 +0400 From: Alexander Shiyan To: alsa-devel@alsa-project.org Date: Sat, 26 Apr 2014 18:49:16 +0400 Message-Id: <1398523756-9740-1-git-send-email-shc_work@mail.ru> X-Mailer: git-send-email 1.8.3.2 X-Spam: Not detected X-Mras: Ok Cc: Alexander Shiyan , Liam Girdwood , Takashi Iwai , Timur Tabi , Mark Brown Subject: [alsa-devel] [PATCH] ASoC: fsl-ssi: Allow to use driver with generic audio card 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 Generic sound card checks return value of functions for setup format, clock and slot for -ENOTSUPP error. Add this compatibility to fsl-ssi driver. --- I'm really not sure that's a good solution, please correct me if I'm wrong. Signed-off-by: Alexander Shiyan --- sound/soc/fsl/fsl_ssi.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 25865d8f..6891b8c 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -764,7 +764,7 @@ static int fsl_ssi_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt) ssi_private->i2s_mode |= CCSR_SSI_SCR_I2S_MODE_SLAVE; break; default: - return -EINVAL; + return -ENOTSUPP; } /* Data on rising edge of bclk, frame low, 1clk before data */ @@ -789,7 +789,7 @@ static int fsl_ssi_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt) ssi_private->i2s_mode |= CCSR_SSI_SCR_I2S_MODE_NORMAL; break; default: - return -EINVAL; + return -ENOTSUPP; } scr |= ssi_private->i2s_mode; @@ -812,7 +812,7 @@ static int fsl_ssi_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt) strcr ^= CCSR_SSI_STCR_TFSI; break; default: - return -EINVAL; + return -ENOTSUPP; } /* DAI clock master masks */ @@ -825,7 +825,7 @@ static int fsl_ssi_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt) scr &= ~CCSR_SSI_SCR_SYS_CLK_EN; break; default: - return -EINVAL; + return -ENOTSUPP; } stcr |= strcr; @@ -897,7 +897,7 @@ static int fsl_ssi_set_dai_sysclk(struct snd_soc_dai *cpu_dai, /* Don't apply it to any non-baudclk circumstance */ if (IS_ERR(ssi_private->baudclk)) - return -EINVAL; + return -ENOTSUPP; /* It should be already enough to divide clock by setting pm alone */ psr = 0; @@ -986,7 +986,7 @@ static int fsl_ssi_set_dai_tdm_slot(struct snd_soc_dai *cpu_dai, u32 tx_mask, val = read_ssi(&ssi->scr) & (CCSR_SSI_SCR_I2S_MODE_MASK | CCSR_SSI_SCR_NET); if (val && slots < 2) { dev_err(cpu_dai->dev, "slot number should be >= 2 in I2S or NET\n"); - return -EINVAL; + return -ENOTSUPP; } write_ssi_mask(&ssi->stccr, CCSR_SSI_SxCCR_DC_MASK,