Skip to content

Commit af7aae1

Browse files
kv2019ibroonie
authored andcommitted
ASoC: SOF: Intel: hda: move i915 init earlier
To be compliant with i915 display driver requirements, i915 power-up must be done before any HDA communication takes place, including parsing the bus capabilities. Otherwise the initial codec probe may fail. Move i915 initialization earlier in the SOF HDA sequence. This sequence is now aligned with the snd-hda-intel driver where the display_power() call is before snd_hdac_bus_parse_capabilities() and rest of the capability parsing. Also remove unnecessary ifdef around hda_codec_i915_init(). There's a dummy implementation provided if CONFIG_SND_SOC_SOF_HDA is not enabled. Signed-off-by: Kai Vehmanen <[email protected]> Reviewed-by: Ranjani Sridharan <[email protected]> Reviewed-by: Pierre-Louis Bossart <[email protected]> Reviewed-by: Takashi Iwai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 816938b commit af7aae1

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

sound/soc/sof/intel/hda.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,13 @@ static int hda_init(struct snd_sof_dev *sdev)
286286
/* HDA base */
287287
sdev->bar[HDA_DSP_HDA_BAR] = bus->remap_addr;
288288

289+
/* init i915 and HDMI codecs */
290+
ret = hda_codec_i915_init(sdev);
291+
if (ret < 0) {
292+
dev_err(sdev->dev, "error: init i915 and HDMI codec failed\n");
293+
return ret;
294+
}
295+
289296
/* get controller capabilities */
290297
ret = hda_dsp_ctrl_get_caps(sdev);
291298
if (ret < 0)
@@ -353,15 +360,6 @@ static int hda_init_caps(struct snd_sof_dev *sdev)
353360
if (bus->ppcap)
354361
dev_dbg(sdev->dev, "PP capability, will probe DSP later.\n");
355362

356-
#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA)
357-
/* init i915 and HDMI codecs */
358-
ret = hda_codec_i915_init(sdev);
359-
if (ret < 0) {
360-
dev_err(sdev->dev, "error: init i915 and HDMI codec failed\n");
361-
return ret;
362-
}
363-
#endif
364-
365363
/* Init HDA controller after i915 init */
366364
ret = hda_dsp_ctrl_init_chip(sdev, true);
367365
if (ret < 0) {
@@ -611,6 +609,7 @@ int hda_dsp_probe(struct snd_sof_dev *sdev)
611609
iounmap(sdev->bar[HDA_DSP_BAR]);
612610
hdac_bus_unmap:
613611
iounmap(bus->remap_addr);
612+
hda_codec_i915_exit(sdev);
614613
err:
615614
return ret;
616615
}

0 commit comments

Comments
 (0)