aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Ung <davidu@nvidia.com>2014-12-05 18:30:05 -0500
committerThierry Reding <treding@nvidia.com>2015-01-27 04:14:40 -0500
commit2dafd63682d0e2be20b913f370d9f29eb0d483f7 (patch)
treef817efde1e0c4d2ef2c1b2526db242e1963bd534
parent201106d83ee4dc54342e4d8d31a202bf6711a25e (diff)
drm/tegra: dsi: Adjust D-PHY timing
Compliance testing shows that HS Trail is off by -12%. Increase the HS Trail time to make this test pass. Signed-off-by: David Ung <davidu@nvidia.com> [treding@nvidia.com: update specification references, add comment] Signed-off-by: Thierry Reding <treding@nvidia.com>
-rw-r--r--drivers/gpu/drm/tegra/mipi-phy.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/drivers/gpu/drm/tegra/mipi-phy.c b/drivers/gpu/drm/tegra/mipi-phy.c
index 486d19d589c8..ba2ae6511957 100644
--- a/drivers/gpu/drm/tegra/mipi-phy.c
+++ b/drivers/gpu/drm/tegra/mipi-phy.c
@@ -12,9 +12,9 @@
12#include "mipi-phy.h" 12#include "mipi-phy.h"
13 13
14/* 14/*
15 * Default D-PHY timings based on MIPI D-PHY specification. Derived from 15 * Default D-PHY timings based on MIPI D-PHY specification. Derived from the
16 * the valid ranges specified in Section 5.9 of the D-PHY specification 16 * valid ranges specified in Section 6.9, Table 14, Page 40 of the D-PHY
17 * with minor adjustments. 17 * specification (v1.2) with minor adjustments.
18 */ 18 */
19int mipi_dphy_timing_get_default(struct mipi_dphy_timing *timing, 19int mipi_dphy_timing_get_default(struct mipi_dphy_timing *timing,
20 unsigned long period) 20 unsigned long period)
@@ -34,7 +34,20 @@ int mipi_dphy_timing_get_default(struct mipi_dphy_timing *timing,
34 timing->hszero = 145 + 5 * period; 34 timing->hszero = 145 + 5 * period;
35 timing->hssettle = 85 + 6 * period; 35 timing->hssettle = 85 + 6 * period;
36 timing->hsskip = 40; 36 timing->hsskip = 40;
37 timing->hstrail = max(8 * period, 60 + 4 * period); 37
38 /*
39 * The MIPI D-PHY specification (Section 6.9, v1.2, Table 14, Page 40)
40 * contains this formula as:
41 *
42 * T_HS-TRAIL = max(n * 8 * period, 60 + n * 4 * period)
43 *
44 * where n = 1 for forward-direction HS mode and n = 4 for reverse-
45 * direction HS mode. There's only one setting and this function does
46 * not parameterize on anything other that period, so this code will
47 * assumes that reverse-direction HS mode is supported and uses n = 4.
48 */
49 timing->hstrail = max(4 * 8 * period, 60 + 4 * 4 * period);
50
38 timing->init = 100000; 51 timing->init = 100000;
39 timing->lpx = 60; 52 timing->lpx = 60;
40 timing->taget = 5 * timing->lpx; 53 timing->taget = 5 * timing->lpx;
@@ -46,8 +59,8 @@ int mipi_dphy_timing_get_default(struct mipi_dphy_timing *timing,
46} 59}
47 60
48/* 61/*
49 * Validate D-PHY timing according to MIPI Alliance Specification for D-PHY, 62 * Validate D-PHY timing according to MIPI D-PHY specification (v1.2, Section
50 * Section 5.9 "Global Operation Timing Parameters". 63 * Section 6.9 "Global Operation Timing Parameters").
51 */ 64 */
52int mipi_dphy_timing_validate(struct mipi_dphy_timing *timing, 65int mipi_dphy_timing_validate(struct mipi_dphy_timing *timing,
53 unsigned long period) 66 unsigned long period)