Commit d7df5ad4 authored by Tomi Valkeinen's avatar Tomi Valkeinen

OMAPDSS: refactor dispc_ovl_get_channel_out

Refactor dispc_ovl_get_channel_out() to a bit cleaner form, which makes
it easier to add support for writeback in the following patch.
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent 249ad8a3
...@@ -992,7 +992,6 @@ static enum omap_channel dispc_ovl_get_channel_out(enum omap_plane plane) ...@@ -992,7 +992,6 @@ static enum omap_channel dispc_ovl_get_channel_out(enum omap_plane plane)
{ {
int shift; int shift;
u32 val; u32 val;
enum omap_channel channel;
switch (plane) { switch (plane) {
case OMAP_DSS_GFX: case OMAP_DSS_GFX:
...@@ -1010,23 +1009,21 @@ static enum omap_channel dispc_ovl_get_channel_out(enum omap_plane plane) ...@@ -1010,23 +1009,21 @@ static enum omap_channel dispc_ovl_get_channel_out(enum omap_plane plane)
val = dispc_read_reg(DISPC_OVL_ATTRIBUTES(plane)); val = dispc_read_reg(DISPC_OVL_ATTRIBUTES(plane));
if (dss_has_feature(FEAT_MGR_LCD3)) { if (FLD_GET(val, shift, shift) == 1)
if (FLD_GET(val, 31, 30) == 0) return OMAP_DSS_CHANNEL_DIGIT;
channel = FLD_GET(val, shift, shift);
else if (FLD_GET(val, 31, 30) == 1) if (!dss_has_feature(FEAT_MGR_LCD2))
channel = OMAP_DSS_CHANNEL_LCD2; return OMAP_DSS_CHANNEL_LCD;
else
channel = OMAP_DSS_CHANNEL_LCD3;
} else if (dss_has_feature(FEAT_MGR_LCD2)) {
if (FLD_GET(val, 31, 30) == 0)
channel = FLD_GET(val, shift, shift);
else
channel = OMAP_DSS_CHANNEL_LCD2;
} else {
channel = FLD_GET(val, shift, shift);
}
return channel; switch (FLD_GET(val, 31, 30)) {
case 0:
default:
return OMAP_DSS_CHANNEL_LCD;
case 1:
return OMAP_DSS_CHANNEL_LCD2;
case 2:
return OMAP_DSS_CHANNEL_LCD3;
}
} }
void dispc_wb_set_channel_in(enum dss_writeback_channel channel) void dispc_wb_set_channel_in(enum dss_writeback_channel channel)
......
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