Repository navigation
ASoC: SOF: Intel: hda: allow operation without i915 #1731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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; | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One thing I wondered about is should the device be unregistered here immediately in the error case. But I ended up not doing that. snd_hdac_ext_bus_device_remove() will clean up this device as well. |
||
| } | ||
| 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); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -520,10 +520,8 @@ static int hda_init(struct snd_sof_dev *sdev) | |
|
|
||
| /* init i915 and HDMI codecs */ | ||
| ret = hda_codec_i915_init(sdev); | ||
| if (ret < 0) { | ||
| dev_err(sdev->dev, "error: init i915 and HDMI codec failed\n"); | ||
| return ret; | ||
| } | ||
| if (ret < 0) | ||
| dev_warn(sdev->dev, "init of i915 and HDMI codec failed\n"); | ||
|
|
||
| /* get controller capabilities */ | ||
| ret = hda_dsp_ctrl_get_caps(sdev); | ||
|
|
@@ -600,9 +598,6 @@ static int hda_init_caps(struct snd_sof_dev *sdev) | |
| if (ret < 0) { | ||
| dev_err(bus->dev, "error: init chip failed with ret: %d\n", | ||
| ret); | ||
| #if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA) | ||
| hda_codec_i915_exit(sdev); | ||
| #endif | ||
| return ret; | ||
| } | ||
|
|
||
|
|
@@ -642,7 +637,7 @@ static int hda_init_caps(struct snd_sof_dev *sdev) | |
| hda_codec_probe_bus(sdev, hda_codec_use_common_hdmi); | ||
|
|
||
| if (!HDA_IDISP_CODEC(bus->codec_mask)) | ||
| hda_codec_i915_exit(sdev); | ||
| hda_codec_i915_display_power(sdev, false); | ||
|
|
||
| /* | ||
| * we are done probing so decrement link counts | ||
|
|
@@ -971,12 +966,11 @@ static int hda_generic_machine_select(struct snd_sof_dev *sdev) | |
| /* | ||
| * If no machine driver is found, then: | ||
| * | ||
| * hda machine driver is used if : | ||
| * 1. there is one HDMI codec and one external HDAudio codec | ||
| * 2. only HDMI codec | ||
| * generic hda machine driver can handle: | ||
| * - one HDMI codec, and/or | ||
| * - one external HDAudio codec | ||
| */ | ||
| if (!pdata->machine && codec_num <= 2 && | ||
| HDA_IDISP_CODEC(bus->codec_mask)) { | ||
| if (!pdata->machine && codec_num <= 2) { | ||
| hda_mach = snd_soc_acpi_intel_hda_machines; | ||
|
|
||
| /* topology: use the info from hda_machines */ | ||
|
|
@@ -986,7 +980,7 @@ static int hda_generic_machine_select(struct snd_sof_dev *sdev) | |
| dev_info(bus->dev, "using HDA machine driver %s now\n", | ||
| hda_mach->drv_name); | ||
|
|
||
| if (codec_num == 1) | ||
| if (codec_num == 1 && HDA_IDISP_CODEC(bus->codec_mask)) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. minor again, not following here why codec count is important. previous author should have commented this. |
||
| idisp_str = "-idisp"; | ||
| else | ||
| idisp_str = ""; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.