]> Pileus Git - ~andy/linux/blobdiff - drivers/gpu/drm/i915/intel_modes.c
drm/i915: remove duplicated include from intel_modes.c
[~andy/linux] / drivers / gpu / drm / i915 / intel_modes.c
index d67ec3a51e429cac9eace0a417cb70461ebead2a..1773fb871c2c33d0ec16e35d459d6753dafea38e 100644 (file)
 #include <linux/fb.h>
 #include <drm/drm_edid.h>
 #include "drmP.h"
-#include "drm_edid.h"
 #include "intel_drv.h"
 #include "i915_drv.h"
 
 /**
- * intel_ddc_probe
- *
+ * intel_connector_update_modes - update connector from edid
+ * @connector: DRM connector device to use
+ * @edid: previously read EDID information
  */
-bool intel_ddc_probe(struct intel_encoder *intel_encoder, int ddc_bus)
+int intel_connector_update_modes(struct drm_connector *connector,
+                               struct edid *edid)
 {
-       struct drm_i915_private *dev_priv = intel_encoder->base.dev->dev_private;
-       u8 out_buf[] = { 0x0, 0x0};
-       u8 buf[2];
-       struct i2c_msg msgs[] = {
-               {
-                       .addr = DDC_ADDR,
-                       .flags = 0,
-                       .len = 1,
-                       .buf = out_buf,
-               },
-               {
-                       .addr = DDC_ADDR,
-                       .flags = I2C_M_RD,
-                       .len = 1,
-                       .buf = buf,
-               }
-       };
-
-       return i2c_transfer(intel_gmbus_get_adapter(dev_priv, ddc_bus),
-                           msgs, 2) == 2;
+       int ret;
+
+       drm_mode_connector_update_edid_property(connector, edid);
+       ret = drm_add_edid_modes(connector, edid);
+       drm_edid_to_eld(connector, edid);
+       kfree(edid);
+
+       return ret;
 }
 
 /**
@@ -71,18 +60,12 @@ int intel_ddc_get_modes(struct drm_connector *connector,
                        struct i2c_adapter *adapter)
 {
        struct edid *edid;
-       int ret = 0;
 
        edid = drm_get_edid(connector, adapter);
-       if (edid) {
-               drm_mode_connector_update_edid_property(connector, edid);
-               ret = drm_add_edid_modes(connector, edid);
-               drm_edid_to_eld(connector, edid);
-               connector->display_info.raw_edid = NULL;
-               kfree(edid);
-       }
+       if (!edid)
+               return 0;
 
-       return ret;
+       return intel_connector_update_modes(connector, edid);
 }
 
 static const struct drm_prop_enum_list force_audio_names[] = {