]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
drm/i915: use ACPI LID status for LVDS ->detect hook
authorJesse Barnes <jbarnes@virtuousgeek.org>
Thu, 10 Sep 2009 22:28:04 +0000 (15:28 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 10 Sep 2009 23:10:21 +0000 (16:10 -0700)
We can't load or hotplug detect LVDS like we can other outputs, but if
there's a lid device present we can use it as a proxy.  This allows the
LFP state to be determined at ->detect time, making configurations
requiring manual intervention today "just work" assuming the lid device
status is correct.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
drivers/gpu/drm/i915/intel_lvds.c

index e190ff792bf0ed676dfb333d99abe7f9cbeffdc1..90f69d4717e96a85efa62c75ac7d15e8c82b3151 100644 (file)
@@ -589,12 +589,18 @@ static void intel_lvds_mode_set(struct drm_encoder *encoder,
 /**
  * Detect the LVDS connection.
  *
- * This always returns CONNECTOR_STATUS_CONNECTED.  This connector should only have
- * been set up if the LVDS was actually connected anyway.
+ * Since LVDS doesn't have hotlug, we use the lid as a proxy.  Open means
+ * connected and closed means disconnected.  We also send hotplug events as
+ * needed, using lid status notification from the input layer.
  */
 static enum drm_connector_status intel_lvds_detect(struct drm_connector *connector)
 {
-       return connector_status_connected;
+       enum drm_connector_status status = connector_status_connected;
+
+       if (!acpi_lid_open())
+               status = connector_status_disconnected;
+
+       return status;
 }
 
 /**