aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolin Chen <nicoleotsuka@gmail.com>2015-08-12 16:06:12 -0400
committerMark Brown <broonie@kernel.org>2015-08-13 07:47:37 -0400
commit114bb13968162451f5e1d7fe793f9eb7e0083d9a (patch)
treebbaf4c381594df4628bfba5c78b5cc591895044a
parentbc0195aad0daa2ad5b0d76cce22b167bc3435590 (diff)
ASoC: fsl-asoc-card: Specify codec_dai_name for DAI links
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 <nicoleotsuka@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/fsl/fsl-asoc-card.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c
index de438871040b..040362fa1124 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)
407 struct fsl_asoc_card_priv *priv; 407 struct fsl_asoc_card_priv *priv;
408 struct i2c_client *codec_dev; 408 struct i2c_client *codec_dev;
409 struct clk *codec_clk; 409 struct clk *codec_clk;
410 const char *codec_dai_name;
410 u32 width; 411 u32 width;
411 int ret; 412 int ret;
412 413
@@ -459,6 +460,7 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
459 460
460 /* Diversify the card configurations */ 461 /* Diversify the card configurations */
461 if (of_device_is_compatible(np, "fsl,imx-audio-cs42888")) { 462 if (of_device_is_compatible(np, "fsl,imx-audio-cs42888")) {
463 codec_dai_name = "cs42888";
462 priv->card.set_bias_level = NULL; 464 priv->card.set_bias_level = NULL;
463 priv->cpu_priv.sysclk_freq[TX] = priv->codec_priv.mclk_freq; 465 priv->cpu_priv.sysclk_freq[TX] = priv->codec_priv.mclk_freq;
464 priv->cpu_priv.sysclk_freq[RX] = priv->codec_priv.mclk_freq; 466 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)
467 priv->cpu_priv.slot_width = 32; 469 priv->cpu_priv.slot_width = 32;
468 priv->dai_fmt |= SND_SOC_DAIFMT_CBS_CFS; 470 priv->dai_fmt |= SND_SOC_DAIFMT_CBS_CFS;
469 } else if (of_device_is_compatible(np, "fsl,imx-audio-sgtl5000")) { 471 } else if (of_device_is_compatible(np, "fsl,imx-audio-sgtl5000")) {
472 codec_dai_name = "sgtl5000";
470 priv->codec_priv.mclk_id = SGTL5000_SYSCLK; 473 priv->codec_priv.mclk_id = SGTL5000_SYSCLK;
471 priv->dai_fmt |= SND_SOC_DAIFMT_CBM_CFM; 474 priv->dai_fmt |= SND_SOC_DAIFMT_CBM_CFM;
472 } else if (of_device_is_compatible(np, "fsl,imx-audio-wm8962")) { 475 } else if (of_device_is_compatible(np, "fsl,imx-audio-wm8962")) {
476 codec_dai_name = "wm8962";
473 priv->card.set_bias_level = fsl_asoc_card_set_bias_level; 477 priv->card.set_bias_level = fsl_asoc_card_set_bias_level;
474 priv->codec_priv.mclk_id = WM8962_SYSCLK_MCLK; 478 priv->codec_priv.mclk_id = WM8962_SYSCLK_MCLK;
475 priv->codec_priv.fll_id = WM8962_SYSCLK_FLL; 479 priv->codec_priv.fll_id = WM8962_SYSCLK_FLL;
@@ -521,7 +525,7 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
521 /* Normal DAI Link */ 525 /* Normal DAI Link */
522 priv->dai_link[0].cpu_of_node = cpu_np; 526 priv->dai_link[0].cpu_of_node = cpu_np;
523 priv->dai_link[0].codec_of_node = codec_np; 527 priv->dai_link[0].codec_of_node = codec_np;
524 priv->dai_link[0].codec_dai_name = codec_dev->name; 528 priv->dai_link[0].codec_dai_name = codec_dai_name;
525 priv->dai_link[0].platform_of_node = cpu_np; 529 priv->dai_link[0].platform_of_node = cpu_np;
526 priv->dai_link[0].dai_fmt = priv->dai_fmt; 530 priv->dai_link[0].dai_fmt = priv->dai_fmt;
527 priv->card.num_links = 1; 531 priv->card.num_links = 1;
@@ -530,7 +534,7 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
530 /* DPCM DAI Links only if ASRC exsits */ 534 /* DPCM DAI Links only if ASRC exsits */
531 priv->dai_link[1].cpu_of_node = asrc_np; 535 priv->dai_link[1].cpu_of_node = asrc_np;
532 priv->dai_link[1].platform_of_node = asrc_np; 536 priv->dai_link[1].platform_of_node = asrc_np;
533 priv->dai_link[2].codec_dai_name = codec_dev->name; 537 priv->dai_link[2].codec_dai_name = codec_dai_name;
534 priv->dai_link[2].codec_of_node = codec_np; 538 priv->dai_link[2].codec_of_node = codec_np;
535 priv->dai_link[2].cpu_of_node = cpu_np; 539 priv->dai_link[2].cpu_of_node = cpu_np;
536 priv->dai_link[2].dai_fmt = priv->dai_fmt; 540 priv->dai_link[2].dai_fmt = priv->dai_fmt;