From patchwork Wed Aug 12 20:06:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolin Chen X-Patchwork-Id: 7003781 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 963DAC05AC for ; Wed, 12 Aug 2015 20:06:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B9204205AA for ; Wed, 12 Aug 2015 20:06:40 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 6384C20636 for ; Wed, 12 Aug 2015 20:06:39 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 16FE22614D1; Wed, 12 Aug 2015 22:06:38 +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=-2.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id A0B9E2608ED; Wed, 12 Aug 2015 22:06:29 +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 B821F2612AD; Wed, 12 Aug 2015 22:06:27 +0200 (CEST) Received: from mail-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) by alsa0.perex.cz (Postfix) with ESMTP id 8863D260462 for ; Wed, 12 Aug 2015 22:06:20 +0200 (CEST) Received: by pacgr6 with SMTP id gr6so21148416pac.2 for ; Wed, 12 Aug 2015 13:06:19 -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; bh=tqe9rOE516e2YwBqrBSASo7k+WhTHr0uTW2gwkmqXM4=; b=o9vyGr/JRny9o4H8+MVfwN0tZLiyB8CeNVxc4TM1Rxm3NVTQuMZcqYVkz4orfHuT0c iF29vG8weABUbfh6wa4YpM7VB5DpY3e7d9lPCt/wRwt5krWfAG649XYr2oprEmu9pp02 H96NzAOIoAZJNqjqkGelVblY1cSpYtYkyOQzXl2XMlSpM+WgA24H4Ygku+GN5inYJUP4 ah/QrLyIRCcsOdh9dLw+xCaVFI3BjJjEl0EuFUMPyvGeRQw893beiF345zeKetIiGwXU YWIme7M+jQE8nsD4RKUHUIoyrQiMIbXcAHp1hdQmmpjFBFund8W7Ylkt1o8QjeTgRVUa cICQ== X-Received: by 10.68.192.9 with SMTP id hc9mr53222344pbc.57.1439409979402; Wed, 12 Aug 2015 13:06:19 -0700 (PDT) Received: from Asurada-CZ80.hsd1.ca.comcast.net (c-73-189-64-245.hsd1.ca.comcast.net. [73.189.64.245]) by smtp.gmail.com with ESMTPSA id hi1sm7421119pbc.47.2015.08.12.13.06.18 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 12 Aug 2015 13:06:18 -0700 (PDT) From: Nicolin Chen To: broonie@kernel.org Date: Wed, 12 Aug 2015 13:06:12 -0700 Message-Id: <1439409972-56973-1-git-send-email-nicoleotsuka@gmail.com> X-Mailer: git-send-email 1.9.1 Cc: fabio.estevam@freescale.com, alsa-devel@alsa-project.org, zidan.wang@freescale.com, lgirdwood@gmail.com, tiwai@suse.de, linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH] ASoC: fsl-asoc-card: Specify codec_dai_name for DAI links 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 dev->name of CODEC might not be identical to its codec_dai_name, so using dev->name to probe the CODEC dai is not a correct approach. This patch specifies each supporting codec_dai_name instead of using dev->name any more. Signed-off-by: Nicolin Chen --- sound/soc/fsl/fsl-asoc-card.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c index de43887..040362f 100644 --- a/sound/soc/fsl/fsl-asoc-card.c +++ b/sound/soc/fsl/fsl-asoc-card.c @@ -407,6 +407,7 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) struct fsl_asoc_card_priv *priv; struct i2c_client *codec_dev; struct clk *codec_clk; + const char *codec_dai_name; u32 width; int ret; @@ -459,6 +460,7 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) /* Diversify the card configurations */ if (of_device_is_compatible(np, "fsl,imx-audio-cs42888")) { + codec_dai_name = "cs42888"; priv->card.set_bias_level = NULL; priv->cpu_priv.sysclk_freq[TX] = priv->codec_priv.mclk_freq; priv->cpu_priv.sysclk_freq[RX] = priv->codec_priv.mclk_freq; @@ -467,9 +469,11 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) priv->cpu_priv.slot_width = 32; priv->dai_fmt |= SND_SOC_DAIFMT_CBS_CFS; } else if (of_device_is_compatible(np, "fsl,imx-audio-sgtl5000")) { + codec_dai_name = "sgtl5000"; priv->codec_priv.mclk_id = SGTL5000_SYSCLK; priv->dai_fmt |= SND_SOC_DAIFMT_CBM_CFM; } else if (of_device_is_compatible(np, "fsl,imx-audio-wm8962")) { + codec_dai_name = "wm8962"; priv->card.set_bias_level = fsl_asoc_card_set_bias_level; priv->codec_priv.mclk_id = WM8962_SYSCLK_MCLK; priv->codec_priv.fll_id = WM8962_SYSCLK_FLL; @@ -521,7 +525,7 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) /* Normal DAI Link */ priv->dai_link[0].cpu_of_node = cpu_np; priv->dai_link[0].codec_of_node = codec_np; - priv->dai_link[0].codec_dai_name = codec_dev->name; + priv->dai_link[0].codec_dai_name = codec_dai_name; priv->dai_link[0].platform_of_node = cpu_np; priv->dai_link[0].dai_fmt = priv->dai_fmt; priv->card.num_links = 1; @@ -530,7 +534,7 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) /* DPCM DAI Links only if ASRC exsits */ priv->dai_link[1].cpu_of_node = asrc_np; priv->dai_link[1].platform_of_node = asrc_np; - priv->dai_link[2].codec_dai_name = codec_dev->name; + priv->dai_link[2].codec_dai_name = codec_dai_name; priv->dai_link[2].codec_of_node = codec_np; priv->dai_link[2].cpu_of_node = cpu_np; priv->dai_link[2].dai_fmt = priv->dai_fmt;