aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/dss/dsi.c
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2011-10-13 08:26:50 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-12-02 01:54:17 -0500
commit8dc0766fcf3b84ec83aa601acabf21f2c98ca253 (patch)
tree9a928fbabb8f570ff551d93dded10f07db4ed669 /drivers/video/omap2/dss/dsi.c
parent85f17e8e2c8d5f9266ca28f05cbc57598eddb05a (diff)
OMAPDSS: DSI: use lane config in dsi_cio_wait_tx_clk_esc_reset
Use the new lane config in dsi_cio_wait_tx_clk_esc_reset(). This also extends the function to support 5 lanes on OMAP4, instead of 3 lanes. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss/dsi.c')
-rw-r--r--drivers/video/omap2/dss/dsi.c47
1 files changed, 18 insertions, 29 deletions
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 1a209a23f515..52cf97f52172 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -2365,51 +2365,40 @@ static void dsi_cio_disable_lane_override(struct platform_device *dsidev)
2365static int dsi_cio_wait_tx_clk_esc_reset(struct omap_dss_device *dssdev) 2365static int dsi_cio_wait_tx_clk_esc_reset(struct omap_dss_device *dssdev)
2366{ 2366{
2367 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); 2367 struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
2368 int t; 2368 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
2369 int bits[3]; 2369 int t, i;
2370 bool in_use[3]; 2370 bool in_use[DSI_MAX_NR_LANES];
2371 2371 static const u8 offsets_old[] = { 28, 27, 26 };
2372 if (dss_has_feature(FEAT_DSI_REVERSE_TXCLKESC)) { 2372 static const u8 offsets_new[] = { 24, 25, 26, 27, 28 };
2373 bits[0] = 28; 2373 const u8 *offsets;
2374 bits[1] = 27; 2374
2375 bits[2] = 26; 2375 if (dss_has_feature(FEAT_DSI_REVERSE_TXCLKESC))
2376 } else { 2376 offsets = offsets_old;
2377 bits[0] = 24; 2377 else
2378 bits[1] = 25; 2378 offsets = offsets_new;
2379 bits[2] = 26;
2380 }
2381
2382 in_use[0] = false;
2383 in_use[1] = false;
2384 in_use[2] = false;
2385 2379
2386 if (dssdev->phy.dsi.clk_lane != 0) 2380 for (i = 0; i < dsi->num_lanes_supported; ++i)
2387 in_use[dssdev->phy.dsi.clk_lane - 1] = true; 2381 in_use[i] = dsi->lanes[i].function != DSI_LANE_UNUSED;
2388 if (dssdev->phy.dsi.data1_lane != 0)
2389 in_use[dssdev->phy.dsi.data1_lane - 1] = true;
2390 if (dssdev->phy.dsi.data2_lane != 0)
2391 in_use[dssdev->phy.dsi.data2_lane - 1] = true;
2392 2382
2393 t = 100000; 2383 t = 100000;
2394 while (true) { 2384 while (true) {
2395 u32 l; 2385 u32 l;
2396 int i;
2397 int ok; 2386 int ok;
2398 2387
2399 l = dsi_read_reg(dsidev, DSI_DSIPHY_CFG5); 2388 l = dsi_read_reg(dsidev, DSI_DSIPHY_CFG5);
2400 2389
2401 ok = 0; 2390 ok = 0;
2402 for (i = 0; i < 3; ++i) { 2391 for (i = 0; i < dsi->num_lanes_supported; ++i) {
2403 if (!in_use[i] || (l & (1 << bits[i]))) 2392 if (!in_use[i] || (l & (1 << offsets[i])))
2404 ok++; 2393 ok++;
2405 } 2394 }
2406 2395
2407 if (ok == 3) 2396 if (ok == dsi->num_lanes_supported)
2408 break; 2397 break;
2409 2398
2410 if (--t == 0) { 2399 if (--t == 0) {
2411 for (i = 0; i < 3; ++i) { 2400 for (i = 0; i < dsi->num_lanes_supported; ++i) {
2412 if (!in_use[i] || (l & (1 << bits[i]))) 2401 if (!in_use[i] || (l & (1 << offsets[i])))
2413 continue; 2402 continue;
2414 2403
2415 DSSERR("CIO TXCLKESC%d domain not coming " \ 2404 DSSERR("CIO TXCLKESC%d domain not coming " \