* [PATCH] ASoC: Intel: Add pre & post suspend calls in bxt machine
@ 2016-12-02 10:03 Vinod Koul
2016-12-05 11:44 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Vinod Koul @ 2016-12-02 10:03 UTC (permalink / raw)
To: alsa-devel
Cc: liam.r.girdwood, patches.audio, broonie, Vinod Koul,
Senthilnathan Veppur
We need to disable jack detection before entering suspend and
enable it after resume.
This was essential as headphone jack widget will always
remain ON if a jack is inserted and this results in no audio
after system resumes from a suspend.
Signed-off-by: Senthilnathan Veppur <senthilnathanx.veppur@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
sound/soc/intel/boards/bxt_rt298.c | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/sound/soc/intel/boards/bxt_rt298.c b/sound/soc/intel/boards/bxt_rt298.c
index 1309405b3808..b272b72e6a77 100644
--- a/sound/soc/intel/boards/bxt_rt298.c
+++ b/sound/soc/intel/boards/bxt_rt298.c
@@ -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)
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ASoC: Intel: Add pre & post suspend calls in bxt machine
2016-12-02 10:03 [PATCH] ASoC: Intel: Add pre & post suspend calls in bxt machine Vinod Koul
@ 2016-12-05 11:44 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2016-12-05 11:44 UTC (permalink / raw)
To: Vinod Koul
Cc: liam.r.girdwood, patches.audio, alsa-devel, Senthilnathan Veppur
[-- Attachment #1.1: Type: text/plain, Size: 628 bytes --]
On Fri, Dec 02, 2016 at 03:33:44PM +0530, Vinod Koul wrote:
> We need to disable jack detection before entering suspend and
> enable it after resume.
> This was essential as headphone jack widget will always
> remain ON if a jack is inserted and this results in no audio
> after system resumes from a suspend.
This needs clarification - a lot of systems do keep jack detection
active during suspend and use it as a wake source in order to have
things like play/pause functionality via headset available. This sounds
like there's some limitation with one of the drivers in the system that
is being worked around here instead.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-12-05 11:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-02 10:03 [PATCH] ASoC: Intel: Add pre & post suspend calls in bxt machine Vinod Koul
2016-12-05 11:44 ` Mark Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.