aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSubhransu S. Prusty <subhransu.s.prusty@intel.com>2016-02-17 11:04:02 -0500
committerMark Brown <broonie@kernel.org>2016-02-19 10:56:53 -0500
commitab85f5b36ea3474622303a36293e63cf78f4a797 (patch)
treea6977a23a5865f094f56ff0228d99e4880543b2f
parentaeaccef0bc0d364792ecc9455cb13d007fd7a371 (diff)
ASoC: hdac_hdmi: Fix to reconfigure registers in runtime resume
The register are reset during the D3 to D0 transition. So reconfigure them. Also as all DAIs are now supported, remove the dai id check in prepare. Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/hdac_hdmi.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c
index 57ab212b279b..2445b4351efb 100644
--- a/sound/soc/codecs/hdac_hdmi.c
+++ b/sound/soc/codecs/hdac_hdmi.c
@@ -374,11 +374,6 @@ static int hdac_hdmi_playback_prepare(struct snd_pcm_substream *substream,
374 struct hdac_ext_dma_params *dd; 374 struct hdac_ext_dma_params *dd;
375 int ret; 375 int ret;
376 376
377 if (dai->id > 0) {
378 dev_err(&hdac->hdac.dev, "Only one dai supported as of now\n");
379 return -ENODEV;
380 }
381
382 dai_map = &hdmi->dai_map[dai->id]; 377 dai_map = &hdmi->dai_map[dai->id];
383 378
384 dd = (struct hdac_ext_dma_params *)snd_soc_dai_get_dma_data(dai, substream); 379 dd = (struct hdac_ext_dma_params *)snd_soc_dai_get_dma_data(dai, substream);
@@ -451,6 +446,18 @@ static int hdac_hdmi_playback_cleanup(struct snd_pcm_substream *substream,
451 return 0; 446 return 0;
452} 447}
453 448
449static void hdac_hdmi_enable_cvt(struct hdac_ext_device *edev,
450 struct hdac_hdmi_dai_pin_map *dai_map)
451{
452 /* Enable transmission */
453 snd_hdac_codec_write(&edev->hdac, dai_map->cvt->nid, 0,
454 AC_VERB_SET_DIGI_CONVERT_1, 1);
455
456 /* Category Code (CC) to zero */
457 snd_hdac_codec_write(&edev->hdac, dai_map->cvt->nid, 0,
458 AC_VERB_SET_DIGI_CONVERT_2, 0);
459}
460
454static int hdac_hdmi_enable_pin(struct hdac_ext_device *hdac, 461static int hdac_hdmi_enable_pin(struct hdac_ext_device *hdac,
455 struct hdac_hdmi_dai_pin_map *dai_map) 462 struct hdac_hdmi_dai_pin_map *dai_map)
456{ 463{
@@ -580,6 +587,7 @@ static int hdac_hdmi_pcm_open(struct snd_pcm_substream *substream,
580 587
581 dai_map->pin = pin; 588 dai_map->pin = pin;
582 589
590 hdac_hdmi_enable_cvt(hdac, dai_map);
583 ret = hdac_hdmi_enable_pin(hdac, dai_map); 591 ret = hdac_hdmi_enable_pin(hdac, dai_map);
584 if (ret < 0) 592 if (ret < 0)
585 return ret; 593 return ret;
@@ -949,14 +957,6 @@ static int hdac_hdmi_init_dai_map(struct hdac_ext_device *edev)
949 dai_map->dai_id = dai_id; 957 dai_map->dai_id = dai_id;
950 dai_map->cvt = cvt; 958 dai_map->cvt = cvt;
951 959
952 /* Enable transmission */
953 snd_hdac_codec_write(&edev->hdac, cvt->nid, 0,
954 AC_VERB_SET_DIGI_CONVERT_1, 1);
955
956 /* Category Code (CC) to zero */
957 snd_hdac_codec_write(&edev->hdac, cvt->nid, 0,
958 AC_VERB_SET_DIGI_CONVERT_2, 0);
959
960 dai_id++; 960 dai_id++;
961 961
962 if (dai_id == HDA_MAX_CVTS) { 962 if (dai_id == HDA_MAX_CVTS) {
@@ -1527,6 +1527,9 @@ static int hdac_hdmi_runtime_resume(struct device *dev)
1527 return err; 1527 return err;
1528 } 1528 }
1529 1529
1530 hdac_hdmi_skl_enable_all_pins(&edev->hdac);
1531 hdac_hdmi_skl_enable_dp12(&edev->hdac);
1532
1530 /* Power up afg */ 1533 /* Power up afg */
1531 if (!snd_hdac_check_power_state(hdac, hdac->afg, AC_PWRST_D0)) 1534 if (!snd_hdac_check_power_state(hdac, hdac->afg, AC_PWRST_D0))
1532 snd_hdac_codec_write(hdac, hdac->afg, 0, 1535 snd_hdac_codec_write(hdac, hdac->afg, 0,