Merge drm/drm-next into drm-misc-next
[sfrench/cifs-2.6.git] / sound / soc / codecs / hdmi-codec.c
index 09eef6042aad6d53ad91fcef1cfe365f91c768be..a7bd1796aed685a7b170ea2734c2d5f339eef8ea 100644 (file)
@@ -17,6 +17,7 @@
 #include <sound/pcm_iec958.h>
 
 #include <drm/drm_crtc.h> /* This is only to get MAX_ELD_BYTES */
+#include <drm/drm_eld.h>
 
 #define HDMI_CODEC_CHMAP_IDX_UNKNOWN  -1
 
@@ -877,18 +878,13 @@ static int hdmi_codec_set_jack(struct snd_soc_component *component,
                               void *data)
 {
        struct hdmi_codec_priv *hcp = snd_soc_component_get_drvdata(component);
-       int ret = -ENOTSUPP;
 
        if (hcp->hcd.ops->hook_plugged_cb) {
                hcp->jack = jack;
-               ret = hcp->hcd.ops->hook_plugged_cb(component->dev->parent,
-                                                   hcp->hcd.data,
-                                                   plugged_cb,
-                                                   component->dev);
-               if (ret)
-                       hcp->jack = NULL;
+               return 0;
        }
-       return ret;
+
+       return -ENOTSUPP;
 }
 
 static int hdmi_dai_spdif_probe(struct snd_soc_dai *dai)
@@ -982,6 +978,21 @@ static int hdmi_of_xlate_dai_id(struct snd_soc_component *component,
        return ret;
 }
 
+static int hdmi_probe(struct snd_soc_component *component)
+{
+       struct hdmi_codec_priv *hcp = snd_soc_component_get_drvdata(component);
+       int ret = 0;
+
+       if (hcp->hcd.ops->hook_plugged_cb) {
+               ret = hcp->hcd.ops->hook_plugged_cb(component->dev->parent,
+                                                   hcp->hcd.data,
+                                                   plugged_cb,
+                                                   component->dev);
+       }
+
+       return ret;
+}
+
 static void hdmi_remove(struct snd_soc_component *component)
 {
        struct hdmi_codec_priv *hcp = snd_soc_component_get_drvdata(component);
@@ -992,6 +1003,7 @@ static void hdmi_remove(struct snd_soc_component *component)
 }
 
 static const struct snd_soc_component_driver hdmi_driver = {
+       .probe                  = hdmi_probe,
        .remove                 = hdmi_remove,
        .dapm_widgets           = hdmi_widgets,
        .num_dapm_widgets       = ARRAY_SIZE(hdmi_widgets),