drm/i915/tgl: Add vbt value mapping for DDC Bus pin
authorMahesh Kumar <mahesh1.kumar@intel.com>
Thu, 11 Jul 2019 17:31:13 +0000 (10:31 -0700)
committerLucas De Marchi <lucas.demarchi@intel.com>
Thu, 11 Jul 2019 23:31:24 +0000 (16:31 -0700)
Add VBT-value to DDC bus pin mapping for the same.

Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190711173115.28296-20-lucas.demarchi@intel.com
drivers/gpu/drm/i915/display/intel_bios.c
drivers/gpu/drm/i915/display/intel_vbt_defs.h

index 4fdbb5c35d876610a1ede15150f026ed802f2ae0..2fe68f72b88f2d057e3e0c01a1adf57f41a85d0c 100644 (file)
@@ -1355,12 +1355,27 @@ static const u8 mcc_ddc_pin_map[] = {
        [MCC_DDC_BUS_DDI_C] = GMBUS_PIN_9_TC1_ICP,
 };
 
+static const u8 tgp_ddc_pin_map[] = {
+       [ICL_DDC_BUS_DDI_A] = GMBUS_PIN_1_BXT,
+       [ICL_DDC_BUS_DDI_B] = GMBUS_PIN_2_BXT,
+       [TGL_DDC_BUS_DDI_C] = GMBUS_PIN_3_BXT,
+       [ICL_DDC_BUS_PORT_1] = GMBUS_PIN_9_TC1_ICP,
+       [ICL_DDC_BUS_PORT_2] = GMBUS_PIN_10_TC2_ICP,
+       [ICL_DDC_BUS_PORT_3] = GMBUS_PIN_11_TC3_ICP,
+       [ICL_DDC_BUS_PORT_4] = GMBUS_PIN_12_TC4_ICP,
+       [TGL_DDC_BUS_PORT_5] = GMBUS_PIN_13_TC5_TGP,
+       [TGL_DDC_BUS_PORT_6] = GMBUS_PIN_14_TC6_TGP,
+};
+
 static u8 map_ddc_pin(struct drm_i915_private *dev_priv, u8 vbt_pin)
 {
        const u8 *ddc_pin_map;
        int n_entries;
 
-       if (HAS_PCH_MCC(dev_priv)) {
+       if (HAS_PCH_TGP(dev_priv)) {
+               ddc_pin_map = tgp_ddc_pin_map;
+               n_entries = ARRAY_SIZE(tgp_ddc_pin_map);
+       } else if (HAS_PCH_MCC(dev_priv)) {
                ddc_pin_map = mcc_ddc_pin_map;
                n_entries = ARRAY_SIZE(mcc_ddc_pin_map);
        } else if (HAS_PCH_ICP(dev_priv)) {
index 2f4894e9a03df336a903f24ca13b63d06ba66e97..93f5c9d204d64e43275f06ad283e9011c1566308 100644 (file)
@@ -310,10 +310,13 @@ enum vbt_gmbus_ddi {
        DDC_BUS_DDI_F,
        ICL_DDC_BUS_DDI_A = 0x1,
        ICL_DDC_BUS_DDI_B,
+       TGL_DDC_BUS_DDI_C,
        ICL_DDC_BUS_PORT_1 = 0x4,
        ICL_DDC_BUS_PORT_2,
        ICL_DDC_BUS_PORT_3,
        ICL_DDC_BUS_PORT_4,
+       TGL_DDC_BUS_PORT_5,
+       TGL_DDC_BUS_PORT_6,
        MCC_DDC_BUS_DDI_A = 0x1,
        MCC_DDC_BUS_DDI_B,
        MCC_DDC_BUS_DDI_C = 0x4,