Commit dac57a05 authored by Archit Taneja's avatar Archit Taneja Committed by Tomi Valkeinen

OMAPDSS: DISPC: Create helper function dispc_mgr_is_lcd()

Create a helper function called dispc_mgr_is_lcd() which returns true if the
manager is LCD or LCD2.
Signed-off-by: default avatarArchit Taneja <archit@ti.com>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent c3d92529
...@@ -418,13 +418,20 @@ void dispc_runtime_put(void) ...@@ -418,13 +418,20 @@ void dispc_runtime_put(void)
WARN_ON(r < 0); WARN_ON(r < 0);
} }
static inline bool dispc_mgr_is_lcd(enum omap_channel channel)
{
if (channel == OMAP_DSS_CHANNEL_LCD ||
channel == OMAP_DSS_CHANNEL_LCD2)
return true;
else
return false;
}
bool dispc_mgr_go_busy(enum omap_channel channel) bool dispc_mgr_go_busy(enum omap_channel channel)
{ {
int bit; int bit;
if (channel == OMAP_DSS_CHANNEL_LCD || if (dispc_mgr_is_lcd(channel))
channel == OMAP_DSS_CHANNEL_LCD2)
bit = 5; /* GOLCD */ bit = 5; /* GOLCD */
else else
bit = 6; /* GODIGIT */ bit = 6; /* GODIGIT */
...@@ -440,8 +447,7 @@ void dispc_mgr_go(enum omap_channel channel) ...@@ -440,8 +447,7 @@ void dispc_mgr_go(enum omap_channel channel)
int bit; int bit;
bool enable_bit, go_bit; bool enable_bit, go_bit;
if (channel == OMAP_DSS_CHANNEL_LCD || if (dispc_mgr_is_lcd(channel))
channel == OMAP_DSS_CHANNEL_LCD2)
bit = 0; /* LCDENABLE */ bit = 0; /* LCDENABLE */
else else
bit = 1; /* DIGITALENABLE */ bit = 1; /* DIGITALENABLE */
...@@ -455,8 +461,7 @@ void dispc_mgr_go(enum omap_channel channel) ...@@ -455,8 +461,7 @@ void dispc_mgr_go(enum omap_channel channel)
if (!enable_bit) if (!enable_bit)
return; return;
if (channel == OMAP_DSS_CHANNEL_LCD || if (dispc_mgr_is_lcd(channel))
channel == OMAP_DSS_CHANNEL_LCD2)
bit = 5; /* GOLCD */ bit = 5; /* GOLCD */
else else
bit = 6; /* GODIGIT */ bit = 6; /* GODIGIT */
...@@ -945,7 +950,7 @@ void dispc_mgr_set_cpr_coef(enum omap_channel channel, ...@@ -945,7 +950,7 @@ void dispc_mgr_set_cpr_coef(enum omap_channel channel,
{ {
u32 coef_r, coef_g, coef_b; u32 coef_r, coef_g, coef_b;
if (channel != OMAP_DSS_CHANNEL_LCD && channel != OMAP_DSS_CHANNEL_LCD2) if (!dispc_mgr_is_lcd(channel))
return; return;
coef_r = FLD_VAL(coefs->rr, 31, 22) | FLD_VAL(coefs->rg, 20, 11) | coef_r = FLD_VAL(coefs->rr, 31, 22) | FLD_VAL(coefs->rg, 20, 11) |
...@@ -2001,8 +2006,7 @@ bool dispc_mgr_is_enabled(enum omap_channel channel) ...@@ -2001,8 +2006,7 @@ bool dispc_mgr_is_enabled(enum omap_channel channel)
void dispc_mgr_enable(enum omap_channel channel, bool enable) void dispc_mgr_enable(enum omap_channel channel, bool enable)
{ {
if (channel == OMAP_DSS_CHANNEL_LCD || if (dispc_mgr_is_lcd(channel))
channel == OMAP_DSS_CHANNEL_LCD2)
dispc_mgr_enable_lcd_out(channel, enable); dispc_mgr_enable_lcd_out(channel, enable);
else if (channel == OMAP_DSS_CHANNEL_DIGIT) else if (channel == OMAP_DSS_CHANNEL_DIGIT)
dispc_mgr_enable_digit_out(enable); dispc_mgr_enable_digit_out(enable);
......
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