Commit 8dc0766f authored by Tomi Valkeinen's avatar Tomi Valkeinen

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: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent 85f17e8e
...@@ -2365,51 +2365,40 @@ static void dsi_cio_disable_lane_override(struct platform_device *dsidev) ...@@ -2365,51 +2365,40 @@ static void dsi_cio_disable_lane_override(struct platform_device *dsidev)
static int dsi_cio_wait_tx_clk_esc_reset(struct omap_dss_device *dssdev) static int dsi_cio_wait_tx_clk_esc_reset(struct omap_dss_device *dssdev)
{ {
struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev); struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
int t; struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
int bits[3]; int t, i;
bool in_use[3]; bool in_use[DSI_MAX_NR_LANES];
static const u8 offsets_old[] = { 28, 27, 26 };
if (dss_has_feature(FEAT_DSI_REVERSE_TXCLKESC)) { static const u8 offsets_new[] = { 24, 25, 26, 27, 28 };
bits[0] = 28; const u8 *offsets;
bits[1] = 27;
bits[2] = 26; if (dss_has_feature(FEAT_DSI_REVERSE_TXCLKESC))
} else { offsets = offsets_old;
bits[0] = 24; else
bits[1] = 25; offsets = offsets_new;
bits[2] = 26;
}
in_use[0] = false;
in_use[1] = false;
in_use[2] = false;
if (dssdev->phy.dsi.clk_lane != 0) for (i = 0; i < dsi->num_lanes_supported; ++i)
in_use[dssdev->phy.dsi.clk_lane - 1] = true; in_use[i] = dsi->lanes[i].function != DSI_LANE_UNUSED;
if (dssdev->phy.dsi.data1_lane != 0)
in_use[dssdev->phy.dsi.data1_lane - 1] = true;
if (dssdev->phy.dsi.data2_lane != 0)
in_use[dssdev->phy.dsi.data2_lane - 1] = true;
t = 100000; t = 100000;
while (true) { while (true) {
u32 l; u32 l;
int i;
int ok; int ok;
l = dsi_read_reg(dsidev, DSI_DSIPHY_CFG5); l = dsi_read_reg(dsidev, DSI_DSIPHY_CFG5);
ok = 0; ok = 0;
for (i = 0; i < 3; ++i) { for (i = 0; i < dsi->num_lanes_supported; ++i) {
if (!in_use[i] || (l & (1 << bits[i]))) if (!in_use[i] || (l & (1 << offsets[i])))
ok++; ok++;
} }
if (ok == 3) if (ok == dsi->num_lanes_supported)
break; break;
if (--t == 0) { if (--t == 0) {
for (i = 0; i < 3; ++i) { for (i = 0; i < dsi->num_lanes_supported; ++i) {
if (!in_use[i] || (l & (1 << bits[i]))) if (!in_use[i] || (l & (1 << offsets[i])))
continue; continue;
DSSERR("CIO TXCLKESC%d domain not coming " \ DSSERR("CIO TXCLKESC%d domain not coming " \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment