aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorArchit Taneja <archit@ti.com>2011-09-08 03:00:19 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-09-30 09:17:25 -0400
commitdac57a05fcf4808bbc91a96a034cae84716f0077 (patch)
tree45733f687a21036f63304007c7903133f7d7ae2a /drivers/video
parentc3d92529c3c2d7b511903d98efc1537081e62eca (diff)
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: Archit Taneja <archit@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/omap2/dss/dispc.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index fbcefcef29ec..a96fc41d7668 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -418,13 +418,20 @@ void dispc_runtime_put(void)
418 WARN_ON(r < 0); 418 WARN_ON(r < 0);
419} 419}
420 420
421static inline bool dispc_mgr_is_lcd(enum omap_channel channel)
422{
423 if (channel == OMAP_DSS_CHANNEL_LCD ||
424 channel == OMAP_DSS_CHANNEL_LCD2)
425 return true;
426 else
427 return false;
428}
421 429
422bool dispc_mgr_go_busy(enum omap_channel channel) 430bool dispc_mgr_go_busy(enum omap_channel channel)
423{ 431{
424 int bit; 432 int bit;
425 433
426 if (channel == OMAP_DSS_CHANNEL_LCD || 434 if (dispc_mgr_is_lcd(channel))
427 channel == OMAP_DSS_CHANNEL_LCD2)
428 bit = 5; /* GOLCD */ 435 bit = 5; /* GOLCD */
429 else 436 else
430 bit = 6; /* GODIGIT */ 437 bit = 6; /* GODIGIT */
@@ -440,8 +447,7 @@ void dispc_mgr_go(enum omap_channel channel)
440 int bit; 447 int bit;
441 bool enable_bit, go_bit; 448 bool enable_bit, go_bit;
442 449
443 if (channel == OMAP_DSS_CHANNEL_LCD || 450 if (dispc_mgr_is_lcd(channel))
444 channel == OMAP_DSS_CHANNEL_LCD2)
445 bit = 0; /* LCDENABLE */ 451 bit = 0; /* LCDENABLE */
446 else 452 else
447 bit = 1; /* DIGITALENABLE */ 453 bit = 1; /* DIGITALENABLE */
@@ -455,8 +461,7 @@ void dispc_mgr_go(enum omap_channel channel)
455 if (!enable_bit) 461 if (!enable_bit)
456 return; 462 return;
457 463
458 if (channel == OMAP_DSS_CHANNEL_LCD || 464 if (dispc_mgr_is_lcd(channel))
459 channel == OMAP_DSS_CHANNEL_LCD2)
460 bit = 5; /* GOLCD */ 465 bit = 5; /* GOLCD */
461 else 466 else
462 bit = 6; /* GODIGIT */ 467 bit = 6; /* GODIGIT */
@@ -945,7 +950,7 @@ void dispc_mgr_set_cpr_coef(enum omap_channel channel,
945{ 950{
946 u32 coef_r, coef_g, coef_b; 951 u32 coef_r, coef_g, coef_b;
947 952
948 if (channel != OMAP_DSS_CHANNEL_LCD && channel != OMAP_DSS_CHANNEL_LCD2) 953 if (!dispc_mgr_is_lcd(channel))
949 return; 954 return;
950 955
951 coef_r = FLD_VAL(coefs->rr, 31, 22) | FLD_VAL(coefs->rg, 20, 11) | 956 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 2006
2002void dispc_mgr_enable(enum omap_channel channel, bool enable) 2007void dispc_mgr_enable(enum omap_channel channel, bool enable)
2003{ 2008{
2004 if (channel == OMAP_DSS_CHANNEL_LCD || 2009 if (dispc_mgr_is_lcd(channel))
2005 channel == OMAP_DSS_CHANNEL_LCD2)
2006 dispc_mgr_enable_lcd_out(channel, enable); 2010 dispc_mgr_enable_lcd_out(channel, enable);
2007 else if (channel == OMAP_DSS_CHANNEL_DIGIT) 2011 else if (channel == OMAP_DSS_CHANNEL_DIGIT)
2008 dispc_mgr_enable_digit_out(enable); 2012 dispc_mgr_enable_digit_out(enable);