@@ -432,6 +432,33 @@ static int bxt_fe_startup(struct snd_pcm_substream *substream)
},
};
+static int bxt_suspend_pre(struct snd_soc_card *card)
+{
+ struct snd_soc_codec *codec;
+
+ list_for_each_entry(codec, &card->codec_dev_list, card_list) {
+ if (!strcmp(codec->component.name, "i2c-INT343A:00")) {
+ rt298_mic_detect(codec, NULL);
+ break;
+ }
+ }
+ return 0;
+}
+
+static int bxt_resume_post(struct snd_soc_card *card)
+{
+ struct snd_soc_codec *codec;
+
+ list_for_each_entry(codec, &card->codec_dev_list, card_list) {
+ if (!strcmp(codec->component.name, "i2c-INT343A:00")) {
+ rt298_mic_detect(codec, &broxton_headset);
+ break;
+ }
+ }
+ return 0;
+}
+
+
/* broxton audio machine driver for SPT + RT298S */
static struct snd_soc_card broxton_rt298 = {
.name = "broxton-rt298",
@@ -445,6 +472,9 @@ static int bxt_fe_startup(struct snd_pcm_substream *substream)
.dapm_routes = broxton_rt298_map,
.num_dapm_routes = ARRAY_SIZE(broxton_rt298_map),
.fully_routed = true,
+ .suspend_pre = bxt_suspend_pre,
+ .resume_post = bxt_resume_post,
+
};
static int broxton_audio_probe(struct platform_device *pdev)