From patchwork Fri Sep 8 05:27:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolin Chen X-Patchwork-Id: 9943183 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 093A8600CB for ; Fri, 8 Sep 2017 05:28:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E7DAC28458 for ; Fri, 8 Sep 2017 05:28:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DCACC28459; Fri, 8 Sep 2017 05:28:34 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM, 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 2A95528448 for ; Fri, 8 Sep 2017 05:28:34 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 68B1C267548; Fri, 8 Sep 2017 07:28:32 +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 58869267549; Fri, 8 Sep 2017 07:28:31 +0200 (CEST) Received: from mail-pg0-f68.google.com (mail-pg0-f68.google.com [74.125.83.68]) by alsa0.perex.cz (Postfix) with ESMTP id 4DC74267400 for ; Fri, 8 Sep 2017 07:28:28 +0200 (CEST) Received: by mail-pg0-f68.google.com with SMTP id v5so879055pgn.4 for ; Thu, 07 Sep 2017 22:28:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=sQDmCRtCkmoIQsKNRiOqTyWmzpBEJJsTS45OaXC71Xw=; b=fPFmAEz7imKRS2WnCQCPFZb7ku/n8+LjVI1NukiLDSlHxqfdWtPtZedWV/68qkng/E eyxs00uauY97FL2KKn2RvMQuyG8NNj2HdhytExhO2KO28BlRGbi0CTv0xjn2RTnreGTu u45gH1X57QvvMnyaUAiKNs0fXMAdMUBe2a+XY0dPuO3YU3iV6QVGTc3xitCj1l0IBIVg 7JiOpGGmfuwksa5pZ6AXCgFasM2k+5VCJ2gZHapOvz0TY2ecjs/UOFDma5VJWCe4pwMa Zr5u2bq62IOzl0DY1jNkye5zIaWeF3fRRsbPPPOUYshBinRCGrzPkCBU+TjSGXC37ELe ZI6g== 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; bh=sQDmCRtCkmoIQsKNRiOqTyWmzpBEJJsTS45OaXC71Xw=; b=rsKidmGN/cjfPo3zq3gcr9gkiHPU6hWi6y2hGkGtT1F5KnpWbaI5rEl44CSs5trfRA 19wM2v/G49ykVwA7ghovWWaAFxjqhEUSBWDVk8mAdsI/Eh2TRANSOc3gTVEVpvArhCkC 2cUBtHWFyudD6yur986w67nAhw0lJyw2UfQA/wVd28luSJRe8gQBMjkJfXKee2Yn/0QW l73goO5+RcVet5zL2Z0L3ElK9cSMl6+rn9meMWwIYvSDSwugK5MQ50t3B1OdiljH7eYN On+itREGMW/FUtJ8lrsoE5BK6xdIWB1Go02sUxN5srEBTXUjsqm1Z6FuNg3txh6QDSrt +Ggg== X-Gm-Message-State: AHPjjUjDnpKLEs0T2C+Egkdb8ePcxqVrTdvbx7iGbHTpA97JxasifXrk T/YpdPBhxNd5pg== X-Google-Smtp-Source: ADKCNb61VT2C+CJ0ynkcZQUJrasUDPxNMbvQPzu1QapYI3WXNO5E1wZtdbjmoKg5k4cNKstNLpfx4g== X-Received: by 10.98.204.69 with SMTP id a66mr1947424pfg.132.1504848507682; Thu, 07 Sep 2017 22:28:27 -0700 (PDT) Received: from Asurada-CZ80.localdomain (thunderhill.nvidia.com. [216.228.112.22]) by smtp.gmail.com with ESMTPSA id d196sm1703222pfd.102.2017.09.07.22.28.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Sep 2017 22:28:27 -0700 (PDT) From: Nicolin Chen To: broonie@kernel.org Date: Thu, 7 Sep 2017 22:27:33 -0700 Message-Id: <1504848453-9524-1-git-send-email-nicoleotsuka@gmail.com> X-Mailer: git-send-email 2.7.4 Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, tiwai@suse.com, lgirdwood@gmail.com, fabio.estevam@nxp.com, linuxppc-dev@lists.ozlabs.org Subject: [alsa-devel] [PATCH] ASoC: fsl-asoc-card: Don't error out if ENOTSUPP 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 snd_soc_component_set_sysclk() and snd_soc_dai_set_tdm_slot() in the soc-core.c will return -ENOTSUPP if there is no function implementation for them in the dai and component drivers. So this patch tries to ignore this errno. Signed-off-by: Nicolin Chen --- sound/soc/fsl/fsl-asoc-card.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c index 2db4d0c..3772abb 100644 --- a/sound/soc/fsl/fsl-asoc-card.c +++ b/sound/soc/fsl/fsl-asoc-card.c @@ -166,7 +166,7 @@ static int fsl_asoc_card_hw_params(struct snd_pcm_substream *substream, ret = snd_soc_dai_set_sysclk(rtd->cpu_dai, cpu_priv->sysclk_id[tx], cpu_priv->sysclk_freq[tx], cpu_priv->sysclk_dir[tx]); - if (ret) { + if (ret && ret != -ENOTSUPP) { dev_err(dev, "failed to set sysclk for cpu dai\n"); return ret; } @@ -174,7 +174,7 @@ static int fsl_asoc_card_hw_params(struct snd_pcm_substream *substream, if (cpu_priv->slot_width) { ret = snd_soc_dai_set_tdm_slot(rtd->cpu_dai, 0x3, 0x3, 2, cpu_priv->slot_width); - if (ret) { + if (ret && ret != -ENOTSUPP) { dev_err(dev, "failed to set TDM slot for cpu dai\n"); return ret; } @@ -270,7 +270,7 @@ static int fsl_asoc_card_set_bias_level(struct snd_soc_card *card, ret = snd_soc_dai_set_sysclk(codec_dai, codec_priv->fll_id, pll_out, SND_SOC_CLOCK_IN); - if (ret) { + if (ret && ret != -ENOTSUPP) { dev_err(dev, "failed to set SYSCLK: %d\n", ret); return ret; } @@ -283,7 +283,7 @@ static int fsl_asoc_card_set_bias_level(struct snd_soc_card *card, ret = snd_soc_dai_set_sysclk(codec_dai, codec_priv->mclk_id, codec_priv->mclk_freq, SND_SOC_CLOCK_IN); - if (ret) { + if (ret && ret != -ENOTSUPP) { dev_err(dev, "failed to switch away from FLL: %d\n", ret); return ret; } @@ -459,7 +459,7 @@ static int fsl_asoc_card_late_probe(struct snd_soc_card *card) ret = snd_soc_dai_set_sysclk(codec_dai, codec_priv->mclk_id, codec_priv->mclk_freq, SND_SOC_CLOCK_IN); - if (ret) { + if (ret && ret != -ENOTSUPP) { dev_err(dev, "failed to set sysclk in %s\n", __func__); return ret; }