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

ASoC: Intel: cht_bsw_rt5672: use actual HID in suspend/resume

The code scans all components looking for the default name
i2c-10EC5670:00, which of course doesn't work in platforms
where the BIOS uses a different HID such as Dell 5585

Since we already have the correct information available, just
use the actual codec name and length.
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-By: default avatarVinod Koul <vinod.koul@intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 89db6f96
...@@ -347,9 +347,11 @@ static struct snd_soc_dai_link cht_dailink[] = { ...@@ -347,9 +347,11 @@ static struct snd_soc_dai_link cht_dailink[] = {
static int cht_suspend_pre(struct snd_soc_card *card) static int cht_suspend_pre(struct snd_soc_card *card)
{ {
struct snd_soc_component *component; struct snd_soc_component *component;
struct cht_mc_private *ctx = snd_soc_card_get_drvdata(card);
list_for_each_entry(component, &card->component_dev_list, card_list) { list_for_each_entry(component, &card->component_dev_list, card_list) {
if (!strcmp(component->name, "i2c-10EC5670:00")) { if (!strncmp(component->name,
ctx->codec_name, sizeof(ctx->codec_name))) {
struct snd_soc_codec *codec = snd_soc_component_to_codec(component); struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
dev_dbg(codec->dev, "disabling jack detect before going to suspend.\n"); dev_dbg(codec->dev, "disabling jack detect before going to suspend.\n");
...@@ -363,9 +365,11 @@ static int cht_suspend_pre(struct snd_soc_card *card) ...@@ -363,9 +365,11 @@ static int cht_suspend_pre(struct snd_soc_card *card)
static int cht_resume_post(struct snd_soc_card *card) static int cht_resume_post(struct snd_soc_card *card)
{ {
struct snd_soc_component *component; struct snd_soc_component *component;
struct cht_mc_private *ctx = snd_soc_card_get_drvdata(card);
list_for_each_entry(component, &card->component_dev_list, card_list) { list_for_each_entry(component, &card->component_dev_list, card_list) {
if (!strcmp(component->name, "i2c-10EC5670:00")) { if (!strncmp(component->name,
ctx->codec_name, sizeof(ctx->codec_name))) {
struct snd_soc_codec *codec = snd_soc_component_to_codec(component); struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
dev_dbg(codec->dev, "enabling jack detect for resume.\n"); dev_dbg(codec->dev, "enabling jack detect for resume.\n");
......
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