drm/i915: Reject unusable power sequencers
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 25 Nov 2022 17:31:53 +0000 (19:31 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 9 Dec 2022 17:02:50 +0000 (19:02 +0200)
commitba21bb24810f8b49b83ee3f49b60953445e79f8f
treef69ebfd0a339c83eb60a91e39853645eeddf76ee
parentd83804f22d8532a8feb49ee5f552b41f3df41008
drm/i915: Reject unusable power sequencers

On ICP-ADP the pins used by the second PPS can be alternatively
muxed to some other function. In that case the second power
sequencer is unusable.

Unfortunately (on my ADL Thinkpad T14 gen3 at least) the
BIOS still likes to enable the VDD on the second PPS (due
to the VBT declaring the second bogus eDP panel) even when
not correctly muxed, so we need to deal with it somehow.
For now let's just initialize the PPS as normal, and then
use the normal eDP probe failure VDD off path to turn it off
(and release the wakeref the PPS init grabbed). The
alternative of just declaring that the platform has a single
PPS doesn't really work since it would cause the second eDP
probe to also try to use the first PPS and thus clobber the
state for the first (real) eDP panel.

Cc: Animesh Manna <animesh.manna@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221125173156.31689-7-ville.syrjala@linux.intel.com
Reviewed-by: Animesh Manna <animesh.manna@intel.com>
drivers/gpu/drm/i915/display/intel_dp.c
drivers/gpu/drm/i915/display/intel_pps.c
drivers/gpu/drm/i915/display/intel_pps.h
drivers/gpu/drm/i915/i915_reg.h