ASoC: Intel: glk_rt5682_max98357a: platform name fixup support
Add helper to override dailink platform name, if passed as parameter Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
fbe2c2736e
commit
5b14aa718f
1 changed files with 17 additions and 4 deletions
|
@ -16,6 +16,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 "../skylake/skl.h"
|
#include "../skylake/skl.h"
|
||||||
#include "../../codecs/rt5682.h"
|
#include "../../codecs/rt5682.h"
|
||||||
#include "../../codecs/hdac_hdmi.h"
|
#include "../../codecs/hdac_hdmi.h"
|
||||||
|
@ -571,6 +572,10 @@ static struct snd_soc_card glk_audio_card_rt5682_m98357a = {
|
||||||
static int geminilake_audio_probe(struct platform_device *pdev)
|
static int geminilake_audio_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct glk_card_private *ctx;
|
struct glk_card_private *ctx;
|
||||||
|
struct snd_soc_acpi_mach *mach;
|
||||||
|
const char *platform_name;
|
||||||
|
struct snd_soc_card *card;
|
||||||
|
int ret;
|
||||||
|
|
||||||
ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
|
ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
|
||||||
if (!ctx)
|
if (!ctx)
|
||||||
|
@ -578,11 +583,19 @@ static int geminilake_audio_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
INIT_LIST_HEAD(&ctx->hdmi_pcm_list);
|
INIT_LIST_HEAD(&ctx->hdmi_pcm_list);
|
||||||
|
|
||||||
glk_audio_card_rt5682_m98357a.dev = &pdev->dev;
|
card = &glk_audio_card_rt5682_m98357a;
|
||||||
snd_soc_card_set_drvdata(&glk_audio_card_rt5682_m98357a, ctx);
|
card->dev = &pdev->dev;
|
||||||
|
snd_soc_card_set_drvdata(card, ctx);
|
||||||
|
|
||||||
return devm_snd_soc_register_card(&pdev->dev,
|
/* override plaform name, if required */
|
||||||
&glk_audio_card_rt5682_m98357a);
|
mach = (&pdev->dev)->platform_data;
|
||||||
|
platform_name = mach->mach_params.platform;
|
||||||
|
|
||||||
|
ret = snd_soc_fixup_dai_links_platform_name(card, platform_name);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
return devm_snd_soc_register_card(&pdev->dev, card);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct platform_device_id glk_board_ids[] = {
|
static const struct platform_device_id glk_board_ids[] = {
|
||||||
|
|
Loading…
Reference in a new issue