Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/i915/icl: Cleanup combo PHY aux power well handlers

Now that the combo PHY aux power well handlers are used exclusively on
Icelake, we can drop a bunch of the extra tests.

v2: Don't try to use intel_uncore_rmw for register updates yet; there's
pending display uncore patches that need to land first. (Lucas)

v3: Drop the combo phy assertion. It was backward before, but doesn't
seem terribly necessary. I'm keeping the IS_ICELAKE assertion
though since we often copy/paste/modify the power well tables when
defining new platforms and it's too easy to cargo cult the
ICL-specific handling to new platforms that shouldn't use it.
(Lucas)

v4: Fix build; forgot to commit all the changes. (CI)

Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191213010600.701315-1-matthew.d.roper@intel.com
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>

+8 -13
+8 -13
drivers/gpu/drm/i915/display/intel_display_power.c
··· 418 418 int pw_idx = power_well->desc->hsw.idx; 419 419 enum phy phy = ICL_AUX_PW_TO_PHY(pw_idx); 420 420 u32 val; 421 - int wa_idx_max; 421 + 422 + WARN_ON(!IS_ICELAKE(dev_priv)); 422 423 423 424 val = I915_READ(regs->driver); 424 425 I915_WRITE(regs->driver, val | HSW_PWR_WELL_CTL_REQ(pw_idx)); ··· 431 430 432 431 hsw_wait_for_power_well_enable(dev_priv, power_well); 433 432 434 - /* Display WA #1178: icl, tgl */ 435 - if (IS_TIGERLAKE(dev_priv)) 436 - wa_idx_max = ICL_PW_CTL_IDX_AUX_C; 437 - else 438 - wa_idx_max = ICL_PW_CTL_IDX_AUX_B; 439 - 440 - if (!IS_ELKHARTLAKE(dev_priv) && 441 - pw_idx >= ICL_PW_CTL_IDX_AUX_A && pw_idx <= wa_idx_max && 433 + /* Display WA #1178: icl */ 434 + if (pw_idx >= ICL_PW_CTL_IDX_AUX_A && pw_idx <= ICL_PW_CTL_IDX_AUX_B && 442 435 !intel_bios_is_port_edp(dev_priv, (enum port)phy)) { 443 436 val = I915_READ(ICL_AUX_ANAOVRD1(pw_idx)); 444 437 val |= ICL_AUX_ANAOVRD1_ENABLE | ICL_AUX_ANAOVRD1_LDO_BYPASS; ··· 449 454 enum phy phy = ICL_AUX_PW_TO_PHY(pw_idx); 450 455 u32 val; 451 456 452 - if (INTEL_GEN(dev_priv) < 12) { 453 - val = I915_READ(ICL_PORT_CL_DW12(phy)); 454 - I915_WRITE(ICL_PORT_CL_DW12(phy), val & ~ICL_LANE_ENABLE_AUX); 455 - } 457 + WARN_ON(!IS_ICELAKE(dev_priv)); 458 + 459 + val = I915_READ(ICL_PORT_CL_DW12(phy)); 460 + I915_WRITE(ICL_PORT_CL_DW12(phy), val & ~ICL_LANE_ENABLE_AUX); 456 461 457 462 val = I915_READ(regs->driver); 458 463 I915_WRITE(regs->driver, val & ~HSW_PWR_WELL_CTL_REQ(pw_idx));