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

ASoC: Intel: bytcr_rt5640: fixup DAI codec_name with HID

Codec name is hard-coded in machine driver, pass information
from actual ACPI HID to help support BIOS variations
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 2bd5bd15
...@@ -247,16 +247,23 @@ static int sst_acpi_probe(struct platform_device *pdev) ...@@ -247,16 +247,23 @@ static int sst_acpi_probe(struct platform_device *pdev)
dev_dbg(dev, "ACPI device id: %x\n", dev_id); dev_dbg(dev, "ACPI device id: %x\n", dev_id);
plat_dev = platform_device_register_data(dev, pdata->platform, -1, NULL, 0); plat_dev = platform_device_register_data(dev, pdata->platform, -1,
NULL, 0);
if (IS_ERR(plat_dev)) { if (IS_ERR(plat_dev)) {
dev_err(dev, "Failed to create machine device: %s\n", pdata->platform); dev_err(dev, "Failed to create machine device: %s\n",
pdata->platform);
return PTR_ERR(plat_dev); return PTR_ERR(plat_dev);
} }
/* Create platform device for sst machine driver */ /*
mdev = platform_device_register_data(dev, mach->drv_name, -1, NULL, 0); * Create platform device for sst machine driver,
* pass machine info as pdata
*/
mdev = platform_device_register_data(dev, mach->drv_name, -1,
(const void *)mach, sizeof(*mach));
if (IS_ERR(mdev)) { if (IS_ERR(mdev)) {
dev_err(dev, "Failed to create machine device: %s\n", mach->drv_name); dev_err(dev, "Failed to create machine device: %s\n",
mach->drv_name);
return PTR_ERR(mdev); return PTR_ERR(mdev);
} }
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <sound/jack.h> #include <sound/jack.h>
#include "../../codecs/rt5640.h" #include "../../codecs/rt5640.h"
#include "../atom/sst-atom-controls.h" #include "../atom/sst-atom-controls.h"
#include "../common/sst-acpi.h"
static const struct snd_soc_dapm_widget byt_rt5640_widgets[] = { static const struct snd_soc_dapm_widget byt_rt5640_widgets[] = {
SND_SOC_DAPM_HP("Headphone", NULL), SND_SOC_DAPM_HP("Headphone", NULL),
...@@ -326,12 +327,21 @@ static struct snd_soc_card byt_rt5640_card = { ...@@ -326,12 +327,21 @@ static struct snd_soc_card byt_rt5640_card = {
.fully_routed = true, .fully_routed = true,
}; };
static char byt_rt5640_codec_name[16]; /* i2c-<HID>:00 with HID being 8 chars */
static int snd_byt_rt5640_mc_probe(struct platform_device *pdev) static int snd_byt_rt5640_mc_probe(struct platform_device *pdev)
{ {
int ret_val = 0; int ret_val = 0;
struct sst_acpi_mach *mach;
/* register the soc card */ /* register the soc card */
byt_rt5640_card.dev = &pdev->dev; byt_rt5640_card.dev = &pdev->dev;
mach = byt_rt5640_card.dev->platform_data;
/* fixup codec name based on HID */
snprintf(byt_rt5640_codec_name, sizeof(byt_rt5640_codec_name),
"%s%s%s", "i2c-", mach->id, ":00");
byt_rt5640_dais[MERR_DPCM_COMPR+1].codec_name = byt_rt5640_codec_name;
ret_val = devm_snd_soc_register_card(&pdev->dev, &byt_rt5640_card); ret_val = devm_snd_soc_register_card(&pdev->dev, &byt_rt5640_card);
......
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