diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-09-23 20:15:02 -0400 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-09-24 09:22:11 -0400 |
commit | 270eea0fd71ae95654606ff7448f195fa22d12c5 (patch) | |
tree | 64f6674094c1720c8b87f095800d1cde0a9bb5bc | |
parent | e6c3a2a6d358a726c2c52cb0132c9ad8f6f37486 (diff) |
drm/i915/lvds: Use the GMBUS pin if specified in VBT
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | drivers/gpu/drm/i915/intel_lvds.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index 1317731bc8ed..95e035a6009e 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c | |||
@@ -771,7 +771,8 @@ static void intel_find_lvds_downclock(struct drm_device *dev, | |||
771 | * If it is not present, return false. | 771 | * If it is not present, return false. |
772 | * If no child dev is parsed from VBT, it assumes that the LVDS is present. | 772 | * If no child dev is parsed from VBT, it assumes that the LVDS is present. |
773 | */ | 773 | */ |
774 | static bool lvds_is_present_in_vbt(struct drm_device *dev) | 774 | static bool lvds_is_present_in_vbt(struct drm_device *dev, |
775 | u8 *i2c_pin) | ||
775 | { | 776 | { |
776 | struct drm_i915_private *dev_priv = dev->dev_private; | 777 | struct drm_i915_private *dev_priv = dev->dev_private; |
777 | int i; | 778 | int i; |
@@ -790,6 +791,9 @@ static bool lvds_is_present_in_vbt(struct drm_device *dev) | |||
790 | child->device_type != DEVICE_TYPE_LFP) | 791 | child->device_type != DEVICE_TYPE_LFP) |
791 | continue; | 792 | continue; |
792 | 793 | ||
794 | if (child->i2c_pin) | ||
795 | *i2c_pin = child->i2c_pin; | ||
796 | |||
793 | /* However, we cannot trust the BIOS writers to populate | 797 | /* However, we cannot trust the BIOS writers to populate |
794 | * the VBT correctly. Since LVDS requires additional | 798 | * the VBT correctly. Since LVDS requires additional |
795 | * information from AIM blocks, a non-zero addin offset is | 799 | * information from AIM blocks, a non-zero addin offset is |
@@ -810,7 +814,7 @@ static bool lvds_is_present_in_vbt(struct drm_device *dev) | |||
810 | return false; | 814 | return false; |
811 | } | 815 | } |
812 | 816 | ||
813 | static bool intel_lvds_ddc_probe(struct drm_device *dev) | 817 | static bool intel_lvds_ddc_probe(struct drm_device *dev, u8 pin) |
814 | { | 818 | { |
815 | struct drm_i915_private *dev_priv = dev->dev_private; | 819 | struct drm_i915_private *dev_priv = dev->dev_private; |
816 | u8 buf = 0; | 820 | u8 buf = 0; |
@@ -822,7 +826,7 @@ static bool intel_lvds_ddc_probe(struct drm_device *dev) | |||
822 | .buf = &buf, | 826 | .buf = &buf, |
823 | }, | 827 | }, |
824 | }; | 828 | }; |
825 | struct i2c_adapter *i2c = &dev_priv->gmbus[GMBUS_PORT_PANEL].adapter; | 829 | struct i2c_adapter *i2c = &dev_priv->gmbus[pin].adapter; |
826 | return i2c_transfer(i2c, msgs, 1) == 1; | 830 | return i2c_transfer(i2c, msgs, 1) == 1; |
827 | } | 831 | } |
828 | 832 | ||
@@ -844,13 +848,15 @@ void intel_lvds_init(struct drm_device *dev) | |||
844 | struct drm_display_mode *scan; /* *modes, *bios_mode; */ | 848 | struct drm_display_mode *scan; /* *modes, *bios_mode; */ |
845 | struct drm_crtc *crtc; | 849 | struct drm_crtc *crtc; |
846 | u32 lvds; | 850 | u32 lvds; |
847 | int pipe, gpio = GPIOC; | 851 | int pipe; |
852 | u8 pin; | ||
848 | 853 | ||
849 | /* Skip init on machines we know falsely report LVDS */ | 854 | /* Skip init on machines we know falsely report LVDS */ |
850 | if (dmi_check_system(intel_no_lvds)) | 855 | if (dmi_check_system(intel_no_lvds)) |
851 | return; | 856 | return; |
852 | 857 | ||
853 | if (!lvds_is_present_in_vbt(dev)) { | 858 | pin = GMBUS_PORT_PANEL; |
859 | if (!lvds_is_present_in_vbt(dev, &pin)) { | ||
854 | DRM_DEBUG_KMS("LVDS is not present in VBT\n"); | 860 | DRM_DEBUG_KMS("LVDS is not present in VBT\n"); |
855 | return; | 861 | return; |
856 | } | 862 | } |
@@ -862,10 +868,9 @@ void intel_lvds_init(struct drm_device *dev) | |||
862 | DRM_DEBUG_KMS("disable LVDS for eDP support\n"); | 868 | DRM_DEBUG_KMS("disable LVDS for eDP support\n"); |
863 | return; | 869 | return; |
864 | } | 870 | } |
865 | gpio = PCH_GPIOC; | ||
866 | } | 871 | } |
867 | 872 | ||
868 | if (!intel_lvds_ddc_probe(dev)) { | 873 | if (!intel_lvds_ddc_probe(dev, pin)) { |
869 | DRM_DEBUG_KMS("LVDS did not respond to DDC probe\n"); | 874 | DRM_DEBUG_KMS("LVDS did not respond to DDC probe\n"); |
870 | return; | 875 | return; |
871 | } | 876 | } |
@@ -930,7 +935,7 @@ void intel_lvds_init(struct drm_device *dev) | |||
930 | * preferred mode is the right one. | 935 | * preferred mode is the right one. |
931 | */ | 936 | */ |
932 | intel_lvds->edid = drm_get_edid(connector, | 937 | intel_lvds->edid = drm_get_edid(connector, |
933 | &dev_priv->gmbus[GMBUS_PORT_PANEL].adapter); | 938 | &dev_priv->gmbus[pin].adapter); |
934 | 939 | ||
935 | if (!intel_lvds->edid) { | 940 | if (!intel_lvds->edid) { |
936 | /* Didn't get an EDID, so | 941 | /* Didn't get an EDID, so |