Merge tag 'asoc-fix-v5.5-rc6' into asoc-5.6
[platform/kernel/linux-rpi.git] / sound / soc / sof / intel / hda-codec.c
index fbfa225..78dfd5f 100644 (file)
@@ -75,16 +75,15 @@ void hda_codec_jack_check(struct snd_sof_dev *sdev)
 void hda_codec_jack_wake_enable(struct snd_sof_dev *sdev) {}
 void hda_codec_jack_check(struct snd_sof_dev *sdev) {}
 #endif /* CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC */
-EXPORT_SYMBOL(hda_codec_jack_wake_enable);
-EXPORT_SYMBOL(hda_codec_jack_check);
+EXPORT_SYMBOL_NS(hda_codec_jack_wake_enable, SND_SOC_SOF_HDA_AUDIO_CODEC);
+EXPORT_SYMBOL_NS(hda_codec_jack_check, SND_SOC_SOF_HDA_AUDIO_CODEC);
 
 /* probe individual codec */
-static int hda_codec_probe(struct snd_sof_dev *sdev, int address)
+static int hda_codec_probe(struct snd_sof_dev *sdev, int address,
+                          bool hda_codec_use_common_hdmi)
 {
 #if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC)
        struct hdac_hda_priv *hda_priv;
-       struct snd_soc_acpi_mach_params *mach_params = NULL;
-       struct snd_sof_pdata *pdata = sdev->pdata;
 #endif
        struct hda_bus *hbus = sof_to_hbus(sdev);
        struct hdac_device *hdev;
@@ -114,10 +113,6 @@ static int hda_codec_probe(struct snd_sof_dev *sdev, int address)
        if (ret < 0)
                return ret;
 
-       if (pdata->machine)
-               mach_params = (struct snd_soc_acpi_mach_params *)
-                       &pdata->machine->mach_params;
-
        if ((resp & 0xFFFF0000) == IDISP_VID_INTEL)
                hda_priv->need_display_power = true;
 
@@ -125,7 +120,7 @@ static int hda_codec_probe(struct snd_sof_dev *sdev, int address)
         * if common HDMI codec driver is not used, codec load
         * is skipped here and hdac_hdmi is used instead
         */
-       if ((mach_params && mach_params->common_hdmi_codec_drv) ||
+       if (hda_codec_use_common_hdmi ||
            (resp & 0xFFFF0000) != IDISP_VID_INTEL) {
                hdev->type = HDA_DEV_LEGACY;
                ret = hda_codec_load_module(&hda_priv->codec);
@@ -150,7 +145,8 @@ static int hda_codec_probe(struct snd_sof_dev *sdev, int address)
 }
 
 /* Codec initialization */
-int hda_codec_probe_bus(struct snd_sof_dev *sdev)
+void hda_codec_probe_bus(struct snd_sof_dev *sdev,
+                        bool hda_codec_use_common_hdmi)
 {
        struct hdac_bus *bus = sof_to_bus(sdev);
        int i, ret;
@@ -161,17 +157,15 @@ int hda_codec_probe_bus(struct snd_sof_dev *sdev)
                if (!(bus->codec_mask & (1 << i)))
                        continue;
 
-               ret = hda_codec_probe(sdev, i);
+               ret = hda_codec_probe(sdev, i, hda_codec_use_common_hdmi);
                if (ret < 0) {
-                       dev_err(bus->dev, "error: codec #%d probe error, ret: %d\n",
-                               i, ret);
-                       return ret;
+                       dev_warn(bus->dev, "codec #%d probe error, ret: %d\n",
+                                i, ret);
+                       bus->codec_mask &= ~BIT(i);
                }
        }
-
-       return 0;
 }
-EXPORT_SYMBOL(hda_codec_probe_bus);
+EXPORT_SYMBOL_NS(hda_codec_probe_bus, SND_SOC_SOF_HDA_AUDIO_CODEC);
 
 #if IS_ENABLED(CONFIG_SND_HDA_CODEC_HDMI) || \
        IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI)
@@ -183,7 +177,7 @@ void hda_codec_i915_get(struct snd_sof_dev *sdev)
        dev_dbg(bus->dev, "Turning i915 HDAC power on\n");
        snd_hdac_display_power(bus, HDA_CODEC_IDX_CONTROLLER, true);
 }
-EXPORT_SYMBOL(hda_codec_i915_get);
+EXPORT_SYMBOL_NS(hda_codec_i915_get, SND_SOC_SOF_HDA_AUDIO_CODEC_I915);
 
 void hda_codec_i915_put(struct snd_sof_dev *sdev)
 {
@@ -192,7 +186,7 @@ void hda_codec_i915_put(struct snd_sof_dev *sdev)
        dev_dbg(bus->dev, "Turning i915 HDAC power off\n");
        snd_hdac_display_power(bus, HDA_CODEC_IDX_CONTROLLER, false);
 }
-EXPORT_SYMBOL(hda_codec_i915_put);
+EXPORT_SYMBOL_NS(hda_codec_i915_put, SND_SOC_SOF_HDA_AUDIO_CODEC_I915);
 
 int hda_codec_i915_init(struct snd_sof_dev *sdev)
 {
@@ -208,7 +202,7 @@ int hda_codec_i915_init(struct snd_sof_dev *sdev)
 
        return 0;
 }
-EXPORT_SYMBOL(hda_codec_i915_init);
+EXPORT_SYMBOL_NS(hda_codec_i915_init, SND_SOC_SOF_HDA_AUDIO_CODEC_I915);
 
 int hda_codec_i915_exit(struct snd_sof_dev *sdev)
 {
@@ -221,7 +215,7 @@ int hda_codec_i915_exit(struct snd_sof_dev *sdev)
 
        return ret;
 }
-EXPORT_SYMBOL(hda_codec_i915_exit);
+EXPORT_SYMBOL_NS(hda_codec_i915_exit, SND_SOC_SOF_HDA_AUDIO_CODEC_I915);
 
 #endif