drm/i915: Add vlv_dport_to_phy()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 8 Jul 2015 20:45:53 +0000 (23:45 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 26 Aug 2015 08:23:15 +0000 (10:23 +0200)
Add vlv_dport_to_phy() and fix up the return values of
vlv_dport_to_channel() and vlv_pipe_to_channel() to use
the appropriate enums.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Deepak S <deepak.s@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_drv.h

index 525e45736e1c6d582267b27d16c763d1cf31c7b1..49d1b61336a1deb1a9f38fe46fdef06ca7170451 100644 (file)
@@ -788,7 +788,7 @@ struct intel_dp_mst_encoder {
        void *port; /* store this opaque as its illegal to dereference it */
 };
 
-static inline int
+static inline enum dpio_channel
 vlv_dport_to_channel(struct intel_digital_port *dport)
 {
        switch (dport->port) {
@@ -802,7 +802,21 @@ vlv_dport_to_channel(struct intel_digital_port *dport)
        }
 }
 
-static inline int
+static inline enum dpio_phy
+vlv_dport_to_phy(struct intel_digital_port *dport)
+{
+       switch (dport->port) {
+       case PORT_B:
+       case PORT_C:
+               return DPIO_PHY0;
+       case PORT_D:
+               return DPIO_PHY1;
+       default:
+               BUG();
+       }
+}
+
+static inline enum dpio_channel
 vlv_pipe_to_channel(enum pipe pipe)
 {
        switch (pipe) {