aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_sideband.c
diff options
context:
space:
mode:
authorChon Ming Lee <chon.ming.lee@intel.com>2013-09-05 08:41:49 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-09-05 09:04:36 -0400
commit5e69f97fb39ea660075e6b65a1de33247b53f9d4 (patch)
treed1fc135073c4fd4336c5ae5fd7ece4022246e447 /drivers/gpu/drm/i915/intel_sideband.c
parent3c0e234c847318304c12f9e7fffac7e1cf3db3ff (diff)
drm/i915: Add additional pipe parameter for vlv_dpio_read and vlv_dpio_write. v2
The patch doesn't contain functional change, but is to prepare for future platform which has different DPIO phy. The additional pipe parameter will use to select which phy to target for. v2: Update the commit message and add static for the new function. (Jani/Ville) Signed-off-by: Chon Ming Lee <chon.ming.lee@intel.com> Reviewed-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_sideband.c')
-rw-r--r--drivers/gpu/drm/i915/intel_sideband.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/intel_sideband.c b/drivers/gpu/drm/i915/intel_sideband.c
index 0a4167019769..acd1cfe8b7dd 100644
--- a/drivers/gpu/drm/i915/intel_sideband.c
+++ b/drivers/gpu/drm/i915/intel_sideband.c
@@ -157,19 +157,27 @@ void vlv_gps_core_write(struct drm_i915_private *dev_priv, u32 reg, u32 val)
157 PUNIT_OPCODE_REG_WRITE, reg, &val); 157 PUNIT_OPCODE_REG_WRITE, reg, &val);
158} 158}
159 159
160u32 vlv_dpio_read(struct drm_i915_private *dev_priv, int reg) 160static u32 vlv_get_phy_port(enum pipe pipe)
161{
162 u32 port = IOSF_PORT_DPIO;
163
164 WARN_ON ((pipe != PIPE_A) && (pipe != PIPE_B));
165
166 return port;
167}
168
169u32 vlv_dpio_read(struct drm_i915_private *dev_priv, enum pipe pipe, int reg)
161{ 170{
162 u32 val = 0; 171 u32 val = 0;
163 172
164 vlv_sideband_rw(dev_priv, DPIO_DEVFN, IOSF_PORT_DPIO, 173 vlv_sideband_rw(dev_priv, DPIO_DEVFN, vlv_get_phy_port(pipe),
165 DPIO_OPCODE_REG_READ, reg, &val); 174 DPIO_OPCODE_REG_READ, reg, &val);
166
167 return val; 175 return val;
168} 176}
169 177
170void vlv_dpio_write(struct drm_i915_private *dev_priv, int reg, u32 val) 178void vlv_dpio_write(struct drm_i915_private *dev_priv, enum pipe pipe, int reg, u32 val)
171{ 179{
172 vlv_sideband_rw(dev_priv, DPIO_DEVFN, IOSF_PORT_DPIO, 180 vlv_sideband_rw(dev_priv, DPIO_DEVFN, vlv_get_phy_port(pipe),
173 DPIO_OPCODE_REG_WRITE, reg, &val); 181 DPIO_OPCODE_REG_WRITE, reg, &val);
174} 182}
175 183