aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_dsi.c
diff options
context:
space:
mode:
authorShobhit Kumar <shobhit.kumar@intel.com>2013-08-27 08:12:24 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-09-04 11:34:49 -0400
commit4ce8c9a720c566a4ce7b782ddd5df90d66f0ba85 (patch)
tree00d1cb6d13428186ca1aad3a9a04cf324587f49b /drivers/gpu/drm/i915/intel_dsi.c
parente9fd1c02aca7a3e00701debaca45ec7bb942050c (diff)
drm/i915: Band Gap WA
Note: No one seems to have docs for this, so this patch here is just unreviewed black magic :( Signed-off-by: Shobhit Kumar <shobhit.kumar@intel.com> Signed-off-by: ymohanma <yogesh.mohan.marimuthu@intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> [danvet: Add note about the doc situation.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_dsi.c')
-rw-r--r--drivers/gpu/drm/i915/intel_dsi.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
index 263c8d2603b6..674fd4989b45 100644
--- a/drivers/gpu/drm/i915/intel_dsi.c
+++ b/drivers/gpu/drm/i915/intel_dsi.c
@@ -37,6 +37,51 @@
37static const struct intel_dsi_device intel_dsi_devices[] = { 37static const struct intel_dsi_device intel_dsi_devices[] = {
38}; 38};
39 39
40
41static void vlv_cck_modify(struct drm_i915_private *dev_priv, u32 reg, u32 val,
42 u32 mask)
43{
44 u32 tmp = vlv_cck_read(dev_priv, reg);
45 tmp &= ~mask;
46 tmp |= val;
47 vlv_cck_write(dev_priv, reg, tmp);
48}
49
50static void band_gap_wa(struct drm_i915_private *dev_priv)
51{
52 mutex_lock(&dev_priv->dpio_lock);
53
54 /* Enable bandgap fix in GOP driver */
55 vlv_cck_modify(dev_priv, 0x6D, 0x00010000, 0x00030000);
56 msleep(20);
57 vlv_cck_modify(dev_priv, 0x6E, 0x00010000, 0x00030000);
58 msleep(20);
59 vlv_cck_modify(dev_priv, 0x6F, 0x00010000, 0x00030000);
60 msleep(20);
61 vlv_cck_modify(dev_priv, 0x00, 0x00008000, 0x00008000);
62 msleep(20);
63 vlv_cck_modify(dev_priv, 0x00, 0x00000000, 0x00008000);
64 msleep(20);
65
66 /* Turn Display Trunk on */
67 vlv_cck_modify(dev_priv, 0x6B, 0x00020000, 0x00030000);
68 msleep(20);
69
70 vlv_cck_modify(dev_priv, 0x6C, 0x00020000, 0x00030000);
71 msleep(20);
72
73 vlv_cck_modify(dev_priv, 0x6D, 0x00020000, 0x00030000);
74 msleep(20);
75 vlv_cck_modify(dev_priv, 0x6E, 0x00020000, 0x00030000);
76 msleep(20);
77 vlv_cck_modify(dev_priv, 0x6F, 0x00020000, 0x00030000);
78
79 mutex_unlock(&dev_priv->dpio_lock);
80
81 /* Need huge delay, otherwise clock is not stable */
82 msleep(100);
83}
84
40static struct intel_dsi *intel_attached_dsi(struct drm_connector *connector) 85static struct intel_dsi *intel_attached_dsi(struct drm_connector *connector)
41{ 86{
42 return container_of(intel_attached_encoder(connector), 87 return container_of(intel_attached_encoder(connector),
@@ -310,6 +355,9 @@ static void intel_dsi_mode_set(struct intel_encoder *intel_encoder)
310 /* Update the DSI PLL */ 355 /* Update the DSI PLL */
311 vlv_enable_dsi_pll(intel_encoder); 356 vlv_enable_dsi_pll(intel_encoder);
312 357
358 /* XXX: Location of the call */
359 band_gap_wa(dev_priv);
360
313 /* escape clock divider, 20MHz, shared for A and C. device ready must be 361 /* escape clock divider, 20MHz, shared for A and C. device ready must be
314 * off when doing this! txclkesc? */ 362 * off when doing this! txclkesc? */
315 tmp = I915_READ(MIPI_CTRL(0)); 363 tmp = I915_READ(MIPI_CTRL(0));