From patchwork Fri Oct 24 23:48:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolin Chen X-Patchwork-Id: 402974 X-Patchwork-Delegate: scottwood@freescale.com 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 AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4859E1400B7 for ; Sat, 25 Oct 2014 10:49:56 +1100 (AEDT) Received: from ozlabs.org (ozlabs.org [103.22.144.67]) by lists.ozlabs.org (Postfix) with ESMTP id 310B61A1AF6 for ; Sat, 25 Oct 2014 10:49:56 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-pa0-x234.google.com (mail-pa0-x234.google.com [IPv6:2607:f8b0:400e:c03::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id BCE191A0053 for ; Sat, 25 Oct 2014 10:48:26 +1100 (AEDT) Received: by mail-pa0-f52.google.com with SMTP id fa1so295363pad.25 for ; Fri, 24 Oct 2014 16:48:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=CdjyU3/OFI8duxxvkTY53naEkReA2gIdPBcR9NoOd08=; b=Y440iqAtJ5squIzMquqUOOotDZJsFyDHiWgT/t+FRgSAcH2F6aPVkxfaQulocJKFfi K7AaxsTu7UKyYvx117NLRFWk12SFeTHW7ZlL6qAbBsZToOMvRkhiK16tIth+zuCFvZ0J 7q4exanchq1pVVktPJxDVcKglEWRSACi7W3LdZNJBgaYVfwNmbGKN7nbsDx2Rcdzi60T /CyAcrYYrQAo4yGK99utUbRBkYgdGjpsajweIXVe5oqDe1DDhaVIFQSX6xblPbQXriQG EupS4Ub4Bn0CvRoocAd3gXCLD++cVGOXQpXuGf49JK6qg6FBgLYlC6wnhW0m3YUqi7EM yydg== X-Received: by 10.70.95.198 with SMTP id dm6mr7923416pdb.58.1414194504490; Fri, 24 Oct 2014 16:48:24 -0700 (PDT) Received: from Alpha.attlocal.net (99-189-113-45.lightspeed.sntcca.sbcglobal.net. [99.189.113.45]) by mx.google.com with ESMTPSA id pc8sm4790799pbc.10.2014.10.24.16.48.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Oct 2014 16:48:24 -0700 (PDT) From: Nicolin Chen To: broonie@kernel.org, b02247@freescale.com Subject: [PATCH] ASoC: fsl-asoc-card: Don't bypass settings if cpu-dai is Master Date: Fri, 24 Oct 2014 16:48:11 -0700 Message-Id: <1414194502-14052-1-git-send-email-nicoleotsuka@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: Cc: alsa-devel@alsa-project.org, timur@tabi.org, lgirdwood@gmail.com, linux-kernel@vger.kernel.org, Li.Xiubo@freescale.com, linuxppc-dev@lists.ozlabs.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" When cpu-dai is the DAI Master (CBM_CFx), it may need some configurations, set_sysclk() call for eample, for cpu-dai side in the hw_params(), even if the set_bias_level() has already taken care of the codec-dai side. So this patch just simply adds an additional condition. Signed-off-by: Nicolin Chen --- sound/soc/fsl/fsl-asoc-card.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c index 007c772..14572e6 100644 --- a/sound/soc/fsl/fsl-asoc-card.c +++ b/sound/soc/fsl/fsl-asoc-card.c @@ -125,7 +125,12 @@ static int fsl_asoc_card_hw_params(struct snd_pcm_substream *substream, priv->sample_rate = params_rate(params); priv->sample_format = params_format(params); - if (priv->card.set_bias_level) + /* + * If codec-dai is DAI Master and all configurations are already in the + * set_bias_level(), bypass the remaining settings in hw_params(). + * Note: (dai_fmt & CBM_CFM) includes CBM_CFM and CBM_CFS. + */ + if (priv->card.set_bias_level && priv->dai_fmt & SND_SOC_DAIFMT_CBM_CFM) return 0; /* Specific configurations of DAIs starts from here */