drm/i915: Split map_aux_ch() into per-platform arrays
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 9 May 2023 16:02:04 +0000 (19:02 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 11 May 2023 14:26:03 +0000 (17:26 +0300)
commit5a0fc7a0df6b3525bf3b33fb27eb8d47f7826dc2
tree7845952a0626b8052605bcad8ce724dff864fae6
parent0cad796a226997e176c71bd4e04a3d426ba4fcc3
drm/i915: Split map_aux_ch() into per-platform arrays

The big switch+if statement mess in map_aux_ch() is
illegible. Split up into cleaner per-platform arrays
like we already have for the gmbus pins.

We use enum aux_ch as the index and the VBT thing as
the value. Slightly non-intuitive perhaps but if we
did it the other way around we'd have problems with
AUX_CH_A being zero, and thus any non-populated
element would look like AUX_CH_A.

v2: flip the index vs. value around

TODO: Didn't bother with the platform variants beyond the
      ones that really need remapping, which means if the
      VBT is bogus we end up with a nonexistent aux ch.
      Might be nice to check this a bit better.
      Yet another bitmask in device info?

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230509160206.25971-1-ville.syrjala@linux.intel.com
Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>
drivers/gpu/drm/i915/display/intel_bios.c