diff mbox series

drm/i915/gen11: Allow usage of all GPIO pins

Message ID 20190815163524.12304-1-matthew.d.roper@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915/gen11: Allow usage of all GPIO pins | expand

Commit Message

Matt Roper Aug. 15, 2019, 4:35 p.m. UTC
Our pin mapping tables for ICP and MCC currently only list the standard
GPIO pins used for various output ports.  Even through ICP's standard
pin usage only utilizes pins 1, 2, and 9-12, and MCC's standard pin
usage only uses pins 1, 2, and 9, these platforms do still have GPIO
registers to address pins in the range 1-3 and 9-14.  OEM's may remap
GPIO usage in non-standard ways (and provide the actual mapping via VBT
settings), so we shouldn't exclude pins on these platforms just because
they aren't part of the standard mappings.

TGP's standard pin tables contains all the possible pins, so let's
rename them to "icp" and use them for all PCH >= PCH_ICP.  This will
prevent intel_gmbus_is_valid_pin from rejecting non-standard pin usage
that an OEM specifies via the VBT.

Note that this will cause pin 9 to be labeled as "tc1" instead of "dpc"
in debug messages on platforms with the MCC PCH, but that may actually
help avoid confusion since the text strings will now be the same on all
gen11+ platforms instead of being different on just EHL.

Bspec: 8417
Cc: José Roberto de Souza <jose.souza@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Vivek Kasireddy <vivek.kasireddy@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
---
 drivers/gpu/drm/i915/display/intel_bios.c  | 23 +-----------------
 drivers/gpu/drm/i915/display/intel_gmbus.c | 27 ++--------------------
 2 files changed, 3 insertions(+), 47 deletions(-)

Comments

Matt Roper Aug. 19, 2019, 2:53 p.m. UTC | #1
On Sat, Aug 17, 2019 at 09:30:15PM +0000, Patchwork wrote:
> == Series Details ==
> 
> Series: drm/i915/gen11: Allow usage of all GPIO pins (rev4)
> URL   : https://patchwork.freedesktop.org/series/65261/
> State : success
> 
> == Summary ==
> 
> CI Bug Log - changes from CI_DRM_6723_full -> Patchwork_14067_full
> ====================================================
> 
> Summary
> -------
> 
>   **SUCCESS**
> 
>   No regressions found.

Pushed to dinq; thanks Jose for the review.


Matt

> 
>   
> 
> Known issues
> ------------
> 
>   Here are the changes found in Patchwork_14067_full that come from known issues:
> 
> ### IGT changes ###
> 
> #### Issues hit ####
> 
>   * igt@gem_ctx_isolation@bcs0-s3:
>     - shard-apl:          [PASS][1] -> [DMESG-WARN][2] ([fdo#108566]) +1 similar issue
>    [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6723/shard-apl5/igt@gem_ctx_isolation@bcs0-s3.html
>    [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14067/shard-apl5/igt@gem_ctx_isolation@bcs0-s3.html
> 
>   * igt@gem_exec_schedule@out-order-bsd2:
>     - shard-iclb:         [PASS][3] -> [SKIP][4] ([fdo#109276]) +10 similar issues
>    [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6723/shard-iclb4/igt@gem_exec_schedule@out-order-bsd2.html
>    [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14067/shard-iclb5/igt@gem_exec_schedule@out-order-bsd2.html
> 
>   * igt@gem_exec_schedule@preemptive-hang-bsd:
>     - shard-iclb:         [PASS][5] -> [SKIP][6] ([fdo#111325]) +2 similar issues
>    [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6723/shard-iclb5/igt@gem_exec_schedule@preemptive-hang-bsd.html
>    [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14067/shard-iclb1/igt@gem_exec_schedule@preemptive-hang-bsd.html
> 
>   * igt@kms_cursor_crc@pipe-a-cursor-128x42-offscreen:
>     - shard-iclb:         [PASS][7] -> [INCOMPLETE][8] ([fdo#107713])
>    [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6723/shard-iclb7/igt@kms_cursor_crc@pipe-a-cursor-128x42-offscreen.html
>    [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14067/shard-iclb7/igt@kms_cursor_crc@pipe-a-cursor-128x42-offscreen.html
> 
>   * igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-draw-render:
>     - shard-iclb:         [PASS][9] -> [FAIL][10] ([fdo#103167]) +3 similar issues
>    [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6723/shard-iclb5/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-draw-render.html
>    [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14067/shard-iclb2/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-draw-render.html
> 
>   * igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
>     - shard-skl:          [PASS][11] -> [INCOMPLETE][12] ([fdo#104108]) +3 similar issues
>    [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6723/shard-skl2/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b.html
>    [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14067/shard-skl2/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b.html
> 
>   * igt@kms_plane_lowres@pipe-a-tiling-x:
>     - shard-iclb:         [PASS][13] -> [FAIL][14] ([fdo#103166])
>    [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6723/shard-iclb4/igt@kms_plane_lowres@pipe-a-tiling-x.html
>    [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14067/shard-iclb5/igt@kms_plane_lowres@pipe-a-tiling-x.html
> 
>   * igt@kms_psr@psr2_primary_render:
>     - shard-iclb:         [PASS][15] -> [SKIP][16] ([fdo#109441])
>    [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6723/shard-iclb2/igt@kms_psr@psr2_primary_render.html
>    [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14067/shard-iclb8/igt@kms_psr@psr2_primary_render.html
> 
>   
> #### Possible fixes ####
> 
>   * igt@gem_eio@in-flight-internal-1us:
>     - shard-skl:          [DMESG-WARN][17] -> [PASS][18]
>    [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6723/shard-skl1/igt@gem_eio@in-flight-internal-1us.html
>    [18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14067/shard-skl7/igt@gem_eio@in-flight-internal-1us.html
> 
>   * igt@gem_eio@unwedge-stress:
>     - shard-snb:          [FAIL][19] ([fdo#109661]) -> [PASS][20]
>    [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6723/shard-snb1/igt@gem_eio@unwedge-stress.html
>    [20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14067/shard-snb2/igt@gem_eio@unwedge-stress.html
> 
>   * igt@gem_exec_flush@basic-wb-prw-default:
>     - shard-apl:          [INCOMPLETE][21] ([fdo#103927]) -> [PASS][22]
>    [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6723/shard-apl2/igt@gem_exec_flush@basic-wb-prw-default.html
>    [22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14067/shard-apl8/igt@gem_exec_flush@basic-wb-prw-default.html
> 
>   * igt@gem_exec_schedule@independent-bsd2:
>     - shard-iclb:         [SKIP][23] ([fdo#109276]) -> [PASS][24] +14 similar issues
>    [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6723/shard-iclb3/igt@gem_exec_schedule@independent-bsd2.html
>    [24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14067/shard-iclb1/igt@gem_exec_schedule@independent-bsd2.html
> 
>   * igt@gem_exec_schedule@reorder-wide-bsd:
>     - shard-iclb:         [SKIP][25] ([fdo#111325]) -> [PASS][26] +7 similar issues
>    [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6723/shard-iclb2/igt@gem_exec_schedule@reorder-wide-bsd.html
>    [26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14067/shard-iclb6/igt@gem_exec_schedule@reorder-wide-bsd.html
> 
>   * igt@i915_selftest@live_execlists:
>     - shard-skl:          [DMESG-FAIL][27] -> [PASS][28]
>    [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6723/shard-skl9/igt@i915_selftest@live_execlists.html
>    [28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14067/shard-skl8/igt@i915_selftest@live_execlists.html
> 
>   * igt@kms_flip@flip-vs-expired-vblank:
>     - shard-glk:          [FAIL][29] ([fdo#105363]) -> [PASS][30]
>    [29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6723/shard-glk8/igt@kms_flip@flip-vs-expired-vblank.html
>    [30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14067/shard-glk6/igt@kms_flip@flip-vs-expired-vblank.html
> 
>   * igt@kms_frontbuffer_tracking@fbc-suspend:
>     - shard-apl:          [DMESG-WARN][31] ([fdo#108566]) -> [PASS][32] +4 similar issues
>    [31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6723/shard-apl4/igt@kms_frontbuffer_tracking@fbc-suspend.html
>    [32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14067/shard-apl7/igt@kms_frontbuffer_tracking@fbc-suspend.html
> 
>   * igt@kms_frontbuffer_tracking@fbcpsr-1p-offscren-pri-shrfb-draw-render:
>     - shard-iclb:         [FAIL][33] ([fdo#103167]) -> [PASS][34]
>    [33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6723/shard-iclb2/igt@kms_frontbuffer_tracking@fbcpsr-1p-offscren-pri-shrfb-draw-render.html
>    [34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14067/shard-iclb4/igt@kms_frontbuffer_tracking@fbcpsr-1p-offscren-pri-shrfb-draw-render.html
> 
>   * igt@kms_plane_alpha_blend@pipe-b-constant-alpha-min:
>     - shard-skl:          [FAIL][35] ([fdo#108145]) -> [PASS][36]
>    [35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6723/shard-skl5/igt@kms_plane_alpha_blend@pipe-b-constant-alpha-min.html
>    [36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14067/shard-skl9/igt@kms_plane_alpha_blend@pipe-b-constant-alpha-min.html
> 
>   * igt@kms_psr@no_drrs:
>     - shard-iclb:         [FAIL][37] ([fdo#108341]) -> [PASS][38]
>    [37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6723/shard-iclb1/igt@kms_psr@no_drrs.html
>    [38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14067/shard-iclb7/igt@kms_psr@no_drrs.html
> 
>   * igt@kms_psr@psr2_no_drrs:
>     - shard-iclb:         [SKIP][39] ([fdo#109441]) -> [PASS][40] +1 similar issue
>    [39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6723/shard-iclb5/igt@kms_psr@psr2_no_drrs.html
>    [40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14067/shard-iclb2/igt@kms_psr@psr2_no_drrs.html
> 
>   * igt@kms_rotation_crc@exhaust-fences:
>     - shard-iclb:         [INCOMPLETE][41] ([fdo#107713] / [fdo#110026]) -> [PASS][42]
>    [41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6723/shard-iclb7/igt@kms_rotation_crc@exhaust-fences.html
>    [42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14067/shard-iclb4/igt@kms_rotation_crc@exhaust-fences.html
> 
>   * igt@perf@blocking:
>     - shard-skl:          [FAIL][43] ([fdo#110728]) -> [PASS][44]
>    [43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6723/shard-skl8/igt@perf@blocking.html
>    [44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14067/shard-skl4/igt@perf@blocking.html
> 
>   * igt@tools_test@tools_test:
>     - shard-hsw:          [SKIP][45] ([fdo#109271]) -> [PASS][46]
>    [45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6723/shard-hsw6/igt@tools_test@tools_test.html
>    [46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14067/shard-hsw6/igt@tools_test@tools_test.html
> 
>   
> #### Warnings ####
> 
>   * igt@gem_ctx_clone@scheduler:
>     - shard-hsw:          [SKIP][47] ([fdo#109271]) -> [INCOMPLETE][48] ([fdo#103540])
>    [47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6723/shard-hsw2/igt@gem_ctx_clone@scheduler.html
>    [48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14067/shard-hsw6/igt@gem_ctx_clone@scheduler.html
> 
>   * igt@gem_ctx_isolation@vcs1-nonpriv:
>     - shard-iclb:         [FAIL][49] ([fdo#111329]) -> [SKIP][50] ([fdo#109276])
>    [49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6723/shard-iclb4/igt@gem_ctx_isolation@vcs1-nonpriv.html
>    [50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14067/shard-iclb5/igt@gem_ctx_isolation@vcs1-nonpriv.html
> 
>   * igt@gem_mocs_settings@mocs-isolation-bsd2:
>     - shard-iclb:         [SKIP][51] ([fdo#109276]) -> [FAIL][52] ([fdo#111330])
>    [51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6723/shard-iclb6/igt@gem_mocs_settings@mocs-isolation-bsd2.html
>    [52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14067/shard-iclb2/igt@gem_mocs_settings@mocs-isolation-bsd2.html
> 
>   * igt@gem_mocs_settings@mocs-reset-bsd2:
>     - shard-iclb:         [FAIL][53] ([fdo#111330]) -> [SKIP][54] ([fdo#109276])
>    [53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6723/shard-iclb1/igt@gem_mocs_settings@mocs-reset-bsd2.html
>    [54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14067/shard-iclb7/igt@gem_mocs_settings@mocs-reset-bsd2.html
> 
>   * igt@kms_dp_dsc@basic-dsc-enable-edp:
>     - shard-iclb:         [SKIP][55] ([fdo#109349]) -> [DMESG-WARN][56] ([fdo#107724])
>    [55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6723/shard-iclb4/igt@kms_dp_dsc@basic-dsc-enable-edp.html
>    [56]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14067/shard-iclb2/igt@kms_dp_dsc@basic-dsc-enable-edp.html
> 
>   
>   [fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
>   [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
>   [fdo#103540]: https://bugs.freedesktop.org/show_bug.cgi?id=103540
>   [fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
>   [fdo#104108]: https://bugs.freedesktop.org/show_bug.cgi?id=104108
>   [fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
>   [fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
>   [fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
>   [fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
>   [fdo#108341]: https://bugs.freedesktop.org/show_bug.cgi?id=108341
>   [fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
>   [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
>   [fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
>   [fdo#109349]: https://bugs.freedesktop.org/show_bug.cgi?id=109349
>   [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
>   [fdo#109661]: https://bugs.freedesktop.org/show_bug.cgi?id=109661
>   [fdo#110026]: https://bugs.freedesktop.org/show_bug.cgi?id=110026
>   [fdo#110728]: https://bugs.freedesktop.org/show_bug.cgi?id=110728
>   [fdo#111325]: https://bugs.freedesktop.org/show_bug.cgi?id=111325
>   [fdo#111329]: https://bugs.freedesktop.org/show_bug.cgi?id=111329
>   [fdo#111330]: https://bugs.freedesktop.org/show_bug.cgi?id=111330
> 
> 
> Participating hosts (10 -> 10)
> ------------------------------
> 
>   No changes in participating hosts
> 
> 
> Build changes
> -------------
> 
>   * CI: CI-20190529 -> None
>   * Linux: CI_DRM_6723 -> Patchwork_14067
> 
>   CI-20190529: 20190529
>   CI_DRM_6723: 3f85829ae2a124e54e39977748f2c85cd4be6b34 @ git://anongit.freedesktop.org/gfx-ci/linux
>   IGT_5138: b9abe0bf6c478c4f6cac56bff286d6926ad8c0ab @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
>   Patchwork_14067: 058bf5a4651d0a4d9b32d1cc8aed27ac38544ea2 @ git://anongit.freedesktop.org/gfx-ci/linux
>   piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
> 
> == Logs ==
> 
> For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14067/
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
index b416b394b641..ed608f2df130 100644
--- a/drivers/gpu/drm/i915/display/intel_bios.c
+++ b/drivers/gpu/drm/i915/display/intel_bios.c
@@ -1341,21 +1341,6 @@  static const u8 cnp_ddc_pin_map[] = {
 };
 
 static const u8 icp_ddc_pin_map[] = {
-	[ICL_DDC_BUS_DDI_A] = GMBUS_PIN_1_BXT,
-	[ICL_DDC_BUS_DDI_B] = GMBUS_PIN_2_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,
-};
-
-static const u8 mcc_ddc_pin_map[] = {
-	[MCC_DDC_BUS_DDI_A] = GMBUS_PIN_1_BXT,
-	[MCC_DDC_BUS_DDI_B] = GMBUS_PIN_2_BXT,
-	[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,
@@ -1372,13 +1357,7 @@  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_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)) {
+	if (INTEL_PCH_ID(dev_priv) >= PCH_ICP) {
 		ddc_pin_map = icp_ddc_pin_map;
 		n_entries = ARRAY_SIZE(icp_ddc_pin_map);
 	} else if (HAS_PCH_CNP(dev_priv)) {
diff --git a/drivers/gpu/drm/i915/display/intel_gmbus.c b/drivers/gpu/drm/i915/display/intel_gmbus.c
index 1e27b18aa3fc..3ac8a5c0b4b5 100644
--- a/drivers/gpu/drm/i915/display/intel_gmbus.c
+++ b/drivers/gpu/drm/i915/display/intel_gmbus.c
@@ -80,21 +80,6 @@  static const struct gmbus_pin gmbus_pins_cnp[] = {
 };
 
 static const struct gmbus_pin gmbus_pins_icp[] = {
-	[GMBUS_PIN_1_BXT] = { "dpa", GPIOB },
-	[GMBUS_PIN_2_BXT] = { "dpb", GPIOC },
-	[GMBUS_PIN_9_TC1_ICP] = { "tc1", GPIOJ },
-	[GMBUS_PIN_10_TC2_ICP] = { "tc2", GPIOK },
-	[GMBUS_PIN_11_TC3_ICP] = { "tc3", GPIOL },
-	[GMBUS_PIN_12_TC4_ICP] = { "tc4", GPIOM },
-};
-
-static const struct gmbus_pin gmbus_pins_mcc[] = {
-	[GMBUS_PIN_1_BXT] = { "dpa", GPIOB },
-	[GMBUS_PIN_2_BXT] = { "dpb", GPIOC },
-	[GMBUS_PIN_9_TC1_ICP] = { "dpc", GPIOJ },
-};
-
-static const struct gmbus_pin gmbus_pins_tgp[] = {
 	[GMBUS_PIN_1_BXT] = { "dpa", GPIOB },
 	[GMBUS_PIN_2_BXT] = { "dpb", GPIOC },
 	[GMBUS_PIN_3_BXT] = { "dpc", GPIOD },
@@ -110,11 +95,7 @@  static const struct gmbus_pin gmbus_pins_tgp[] = {
 static const struct gmbus_pin *get_gmbus_pin(struct drm_i915_private *dev_priv,
 					     unsigned int pin)
 {
-	if (HAS_PCH_TGP(dev_priv))
-		return &gmbus_pins_tgp[pin];
-	else if (HAS_PCH_MCC(dev_priv))
-		return &gmbus_pins_mcc[pin];
-	else if (HAS_PCH_ICP(dev_priv))
+	if (INTEL_PCH_ID(dev_priv) >= PCH_ICP)
 		return &gmbus_pins_icp[pin];
 	else if (HAS_PCH_CNP(dev_priv))
 		return &gmbus_pins_cnp[pin];
@@ -133,11 +114,7 @@  bool intel_gmbus_is_valid_pin(struct drm_i915_private *dev_priv,
 {
 	unsigned int size;
 
-	if (HAS_PCH_TGP(dev_priv))
-		size = ARRAY_SIZE(gmbus_pins_tgp);
-	else if (HAS_PCH_MCC(dev_priv))
-		size = ARRAY_SIZE(gmbus_pins_mcc);
-	else if (HAS_PCH_ICP(dev_priv))
+	if (INTEL_PCH_ID(dev_priv) >= PCH_ICP)
 		size = ARRAY_SIZE(gmbus_pins_icp);
 	else if (HAS_PCH_CNP(dev_priv))
 		size = ARRAY_SIZE(gmbus_pins_cnp);