aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2010-10-07 06:59:22 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-05-11 07:20:16 -0400
commit03329ace1dc7dc9319f6f405381d898fc66fb2cb (patch)
treeca282fb0107a545f66601921c85618732faffdb2 /drivers/video/omap2
parent65c62bb953d216aaf0e22692e8e12e5c568a3b02 (diff)
OMAP: DSS2: DSI: wait for TXCLKESC domain to come out of reset
Add dsi_cio_wait_tx_clk_esc_reset() function which waits for the TXCLKESC domains to come out of reset. Things have worked fine without this, but better be safe than sorry. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2')
-rw-r--r--drivers/video/omap2/dss/dsi.c65
1 files changed, 65 insertions, 0 deletions
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index f42196284443..8bc443bae6b1 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -1969,6 +1969,65 @@ static void dsi_cio_disable_lane_override(void)
1969 REG_FLD_MOD(DSI_DSIPHY_CFG10, 0, 22, 17); /* REGLPTXSCPDAT4TO0DXDY */ 1969 REG_FLD_MOD(DSI_DSIPHY_CFG10, 0, 22, 17); /* REGLPTXSCPDAT4TO0DXDY */
1970} 1970}
1971 1971
1972static int dsi_cio_wait_tx_clk_esc_reset(struct omap_dss_device *dssdev)
1973{
1974 int t;
1975 int bits[3];
1976 bool in_use[3];
1977
1978 if (dss_has_feature(FEAT_DSI_REVERSE_TXCLKESC)) {
1979 bits[0] = 28;
1980 bits[1] = 27;
1981 bits[2] = 26;
1982 } else {
1983 bits[0] = 24;
1984 bits[1] = 25;
1985 bits[2] = 26;
1986 }
1987
1988 in_use[0] = false;
1989 in_use[1] = false;
1990 in_use[2] = false;
1991
1992 if (dssdev->phy.dsi.clk_lane != 0)
1993 in_use[dssdev->phy.dsi.clk_lane - 1] = true;
1994 if (dssdev->phy.dsi.data1_lane != 0)
1995 in_use[dssdev->phy.dsi.data1_lane - 1] = true;
1996 if (dssdev->phy.dsi.data2_lane != 0)
1997 in_use[dssdev->phy.dsi.data2_lane - 1] = true;
1998
1999 t = 100000;
2000 while (true) {
2001 u32 l;
2002 int i;
2003 int ok;
2004
2005 l = dsi_read_reg(DSI_DSIPHY_CFG5);
2006
2007 ok = 0;
2008 for (i = 0; i < 3; ++i) {
2009 if (!in_use[i] || (l & (1 << bits[i])))
2010 ok++;
2011 }
2012
2013 if (ok == 3)
2014 break;
2015
2016 if (--t == 0) {
2017 for (i = 0; i < 3; ++i) {
2018 if (!in_use[i] || (l & (1 << bits[i])))
2019 continue;
2020
2021 DSSERR("CIO TXCLKESC%d domain not coming " \
2022 "out of reset\n", i);
2023 }
2024 return -EIO;
2025 }
2026 }
2027
2028 return 0;
2029}
2030
1972static int dsi_cio_init(struct omap_dss_device *dssdev) 2031static int dsi_cio_init(struct omap_dss_device *dssdev)
1973{ 2032{
1974 int r; 2033 int r;
@@ -2028,6 +2087,10 @@ static int dsi_cio_init(struct omap_dss_device *dssdev)
2028 dsi_if_enable(false); 2087 dsi_if_enable(false);
2029 REG_FLD_MOD(DSI_CLK_CTRL, 1, 20, 20); /* LP_CLK_ENABLE */ 2088 REG_FLD_MOD(DSI_CLK_CTRL, 1, 20, 20); /* LP_CLK_ENABLE */
2030 2089
2090 r = dsi_cio_wait_tx_clk_esc_reset(dssdev);
2091 if (r)
2092 goto err_tx_clk_esc_rst;
2093
2031 if (dsi.ulps_enabled) { 2094 if (dsi.ulps_enabled) {
2032 /* Keep Mark-1 state for 1ms (as per DSI spec) */ 2095 /* Keep Mark-1 state for 1ms (as per DSI spec) */
2033 ktime_t wait = ns_to_ktime(1000 * 1000); 2096 ktime_t wait = ns_to_ktime(1000 * 1000);
@@ -2050,6 +2113,8 @@ static int dsi_cio_init(struct omap_dss_device *dssdev)
2050 2113
2051 return 0; 2114 return 0;
2052 2115
2116err_tx_clk_esc_rst:
2117 REG_FLD_MOD(DSI_CLK_CTRL, 0, 20, 20); /* LP_CLK_ENABLE */
2053err_cio_pwr_dom: 2118err_cio_pwr_dom:
2054 dsi_cio_power(DSI_COMPLEXIO_POWER_OFF); 2119 dsi_cio_power(DSI_COMPLEXIO_POWER_OFF);
2055err_cio_pwr: 2120err_cio_pwr: