Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 7ebf2528 authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Mark Brown
Browse files

ASoC: Intel: bxt_da7219_max98357a: 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 f403906d
Loading
Loading
Loading
Loading
+13 −0
Original line number Original line Diff line number Diff line
@@ -23,6 +23,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 "../../codecs/hdac_hdmi.h"
#include "../../codecs/hdac_hdmi.h"
#include "../../codecs/da7219.h"
#include "../../codecs/da7219.h"
#include "../../codecs/da7219-aad.h"
#include "../../codecs/da7219-aad.h"
@@ -584,6 +585,9 @@ static struct snd_soc_card broxton_audio_card = {
static int broxton_audio_probe(struct platform_device *pdev)
static int broxton_audio_probe(struct platform_device *pdev)
{
{
	struct bxt_card_private *ctx;
	struct bxt_card_private *ctx;
	struct snd_soc_acpi_mach *mach;
	const char *platform_name;
	int ret;


	ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
	ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
	if (!ctx)
	if (!ctx)
@@ -594,6 +598,15 @@ static int broxton_audio_probe(struct platform_device *pdev)
	broxton_audio_card.dev = &pdev->dev;
	broxton_audio_card.dev = &pdev->dev;
	snd_soc_card_set_drvdata(&broxton_audio_card, ctx);
	snd_soc_card_set_drvdata(&broxton_audio_card, ctx);


	/* override plaform name, if required */
	mach = (&pdev->dev)->platform_data;
	platform_name = mach->mach_params.platform;

	ret = snd_soc_fixup_dai_links_platform_name(&broxton_audio_card,
						    platform_name);
	if (ret)
		return ret;

	return devm_snd_soc_register_card(&pdev->dev, &broxton_audio_card);
	return devm_snd_soc_register_card(&pdev->dev, &broxton_audio_card);
}
}