Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

David Ung and committed by
Thierry Reding
2dafd636 201106d8

+19 -6
+19 -6
drivers/gpu/drm/tegra/mipi-phy.c
··· 12 12 #include "mipi-phy.h" 13 13 14 14 /* 15 - * Default D-PHY timings based on MIPI D-PHY specification. Derived from 16 - * the valid ranges specified in Section 5.9 of the D-PHY specification 17 - * with minor adjustments. 15 + * Default D-PHY timings based on MIPI D-PHY specification. Derived from the 16 + * valid ranges specified in Section 6.9, Table 14, Page 40 of the D-PHY 17 + * specification (v1.2) with minor adjustments. 18 18 */ 19 19 int mipi_dphy_timing_get_default(struct mipi_dphy_timing *timing, 20 20 unsigned long period) ··· 34 34 timing->hszero = 145 + 5 * period; 35 35 timing->hssettle = 85 + 6 * period; 36 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 51 timing->init = 100000; 39 52 timing->lpx = 60; 40 53 timing->taget = 5 * timing->lpx; ··· 59 46 } 60 47 61 48 /* 62 - * Validate D-PHY timing according to MIPI Alliance Specification for D-PHY, 63 - * Section 5.9 "Global Operation Timing Parameters". 49 + * Validate D-PHY timing according to MIPI D-PHY specification (v1.2, Section 50 + * Section 6.9 "Global Operation Timing Parameters"). 64 51 */ 65 52 int mipi_dphy_timing_validate(struct mipi_dphy_timing *timing, 66 53 unsigned long period)