aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/sof/intel/hda-codec.c
diff options
context:
space:
mode:
authorKai Vehmanen <kai.vehmanen@linux.intel.com>2020-02-20 19:10:28 +0200
committerMark Brown <broonie@kernel.org>2020-02-20 20:28:45 +0000
commit71cc8abb6ec705ce4efbb54e401004687d40a641 (patch)
tree489370ded80dcd8ca2a0553c02be2384de89618a /sound/soc/sof/intel/hda-codec.c
parentASoC: intel/skl/hda - add no-HDMI cases to generic HDA driver (diff)
downloadlinux-dev-71cc8abb6ec705ce4efbb54e401004687d40a641.tar.xz
linux-dev-71cc8abb6ec705ce4efbb54e401004687d40a641.zip
ASoC: SOF: Intel: hda: allow operation without i915 gfx
Add support to configure the HDA controller with an external HDA codec even if iDisp codec in i915 is not available. This can happen for multiple reasons: - internal graphics is disabled on the system - i915 driver is not enabled in kernel or it fails to init - i915 codec reports error in HDA codec probe - HDA codec driver probe fails Address all these scenarios, but keep using the existing topology. In case failures occur, HDMI PCM nodes are created, but they will report error if application tries to use them. No ALSA mixer controls are created. If the external HDA codec init fails as well, SOF probe will return error as before. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=206085 BugLink: https://bugzilla.opensuse.org/show_bug.cgi?id=1163677 BugLink: https://github.com/thesofproject/linux/issues/1658 Link: https://lore.kernel.org/r/20200220171028.22023-3-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/intel/hda-codec.c')
-rw-r--r--sound/soc/sof/intel/hda-codec.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sound/soc/sof/intel/hda-codec.c b/sound/soc/sof/intel/hda-codec.c
index ff45075ef720..3041fbbb010a 100644
--- a/sound/soc/sof/intel/hda-codec.c
+++ b/sound/soc/sof/intel/hda-codec.c
@@ -113,8 +113,14 @@ static int hda_codec_probe(struct snd_sof_dev *sdev, int address,
if (ret < 0)
return ret;
- if ((resp & 0xFFFF0000) == IDISP_VID_INTEL)
+ if ((resp & 0xFFFF0000) == IDISP_VID_INTEL) {
+ if (!hdev->bus->audio_component) {
+ dev_dbg(sdev->dev,
+ "iDisp hw present but no driver\n");
+ return -ENOENT;
+ }
hda_priv->need_display_power = true;
+ }
/*
* if common HDMI codec driver is not used, codec load
@@ -203,6 +209,9 @@ int hda_codec_i915_exit(struct snd_sof_dev *sdev)
struct hdac_bus *bus = sof_to_bus(sdev);
int ret;
+ if (!bus->audio_component)
+ return 0;
+
/* power down unconditionally */
snd_hdac_display_power(bus, HDA_CODEC_IDX_CONTROLLER, false);