diff options
author | Jie Yang <yang.jie@intel.com> | 2015-02-26 23:54:29 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-03-06 15:17:40 -0500 |
commit | 1a5ab21c2e0f3d6b25ee9f7ca3429fac57027f76 (patch) | |
tree | 20bb0e1024b258bda84e9f646db8f4441751647f | |
parent | 5bb400ce4a9b100a2dd3f5db17c4c76877cecade (diff) |
ASoC: Intel: Add suspend_pre and resume_post for Broadwell snd_soc_card
For broadwell machine, we need do some machine related setting before
suspend and after resume, e.g. disable/enable jack detection, here
adding snd_soc_card suspend_pre and resume_post for this task.
Signed-off-by: Jie Yang <yang.jie@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/intel/broadwell.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/sound/soc/intel/broadwell.c b/sound/soc/intel/broadwell.c index fba2ef5dac42..af5d73070f60 100644 --- a/sound/soc/intel/broadwell.c +++ b/sound/soc/intel/broadwell.c | |||
@@ -225,6 +225,32 @@ static struct snd_soc_dai_link broadwell_rt286_dais[] = { | |||
225 | }, | 225 | }, |
226 | }; | 226 | }; |
227 | 227 | ||
228 | static int broadwell_suspend(struct snd_soc_card *card){ | ||
229 | struct snd_soc_codec *codec; | ||
230 | |||
231 | list_for_each_entry(codec, &card->codec_dev_list, card_list) { | ||
232 | if (!strcmp(codec->component.name, "i2c-INT343A:00")) { | ||
233 | dev_dbg(codec->dev, "disabling jack detect before going to suspend.\n"); | ||
234 | rt286_mic_detect(codec, NULL); | ||
235 | break; | ||
236 | } | ||
237 | } | ||
238 | return 0; | ||
239 | } | ||
240 | |||
241 | static int broadwell_resume(struct snd_soc_card *card){ | ||
242 | struct snd_soc_codec *codec; | ||
243 | |||
244 | list_for_each_entry(codec, &card->codec_dev_list, card_list) { | ||
245 | if (!strcmp(codec->component.name, "i2c-INT343A:00")) { | ||
246 | dev_dbg(codec->dev, "enabling jack detect for resume.\n"); | ||
247 | rt286_mic_detect(codec, &broadwell_headset); | ||
248 | break; | ||
249 | } | ||
250 | } | ||
251 | return 0; | ||
252 | } | ||
253 | |||
228 | /* broadwell audio machine driver for WPT + RT286S */ | 254 | /* broadwell audio machine driver for WPT + RT286S */ |
229 | static struct snd_soc_card broadwell_rt286 = { | 255 | static struct snd_soc_card broadwell_rt286 = { |
230 | .name = "broadwell-rt286", | 256 | .name = "broadwell-rt286", |
@@ -238,6 +264,8 @@ static struct snd_soc_card broadwell_rt286 = { | |||
238 | .dapm_routes = broadwell_rt286_map, | 264 | .dapm_routes = broadwell_rt286_map, |
239 | .num_dapm_routes = ARRAY_SIZE(broadwell_rt286_map), | 265 | .num_dapm_routes = ARRAY_SIZE(broadwell_rt286_map), |
240 | .fully_routed = true, | 266 | .fully_routed = true, |
267 | .suspend_pre = broadwell_suspend, | ||
268 | .resume_post = broadwell_resume, | ||
241 | }; | 269 | }; |
242 | 270 | ||
243 | static int broadwell_audio_probe(struct platform_device *pdev) | 271 | static int broadwell_audio_probe(struct platform_device *pdev) |