Commit 4506db80 authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Mark Brown

ASoC: Intel: cht_bsw_nau8824: platform name fixup support

Add helper to override dailink platform name, if passed as parameter
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 7e7e24d7
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <sound/pcm.h> #include <sound/pcm.h>
#include <sound/pcm_params.h> #include <sound/pcm_params.h>
#include <sound/soc.h> #include <sound/soc.h>
#include <sound/soc-acpi.h>
#include <sound/jack.h> #include <sound/jack.h>
#include <linux/input.h> #include <linux/input.h>
#include "../atom/sst-atom-controls.h" #include "../atom/sst-atom-controls.h"
...@@ -246,6 +247,8 @@ static struct snd_soc_card snd_soc_card_cht = { ...@@ -246,6 +247,8 @@ static struct snd_soc_card snd_soc_card_cht = {
static int snd_cht_mc_probe(struct platform_device *pdev) static int snd_cht_mc_probe(struct platform_device *pdev)
{ {
struct cht_mc_private *drv; struct cht_mc_private *drv;
struct snd_soc_acpi_mach *mach;
const char *platform_name;
int ret_val; int ret_val;
drv = devm_kzalloc(&pdev->dev, sizeof(*drv), GFP_KERNEL); drv = devm_kzalloc(&pdev->dev, sizeof(*drv), GFP_KERNEL);
...@@ -253,6 +256,15 @@ static int snd_cht_mc_probe(struct platform_device *pdev) ...@@ -253,6 +256,15 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
snd_soc_card_set_drvdata(&snd_soc_card_cht, drv); snd_soc_card_set_drvdata(&snd_soc_card_cht, drv);
/* override plaform name, if required */
mach = (&pdev->dev)->platform_data;
platform_name = mach->mach_params.platform;
ret_val = snd_soc_fixup_dai_links_platform_name(&snd_soc_card_cht,
platform_name);
if (ret_val)
return ret_val;
/* register the soc card */ /* register the soc card */
snd_soc_card_cht.dev = &pdev->dev; snd_soc_card_cht.dev = &pdev->dev;
ret_val = devm_snd_soc_register_card(&pdev->dev, &snd_soc_card_cht); ret_val = devm_snd_soc_register_card(&pdev->dev, &snd_soc_card_cht);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment