aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2015-11-04 10:10:46 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2015-12-29 04:06:26 -0500
commitd7df5ad44b1427598d7296b2c889988a63a4bce2 (patch)
treee29f236ad80d910a9f666db90b0301ed0ee85885
parent249ad8a38ea30aa1c7bf91fca48341f89ff9f084 (diff)
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: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r--drivers/video/fbdev/omap2/dss/dispc.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/drivers/video/fbdev/omap2/dss/dispc.c b/drivers/video/fbdev/omap2/dss/dispc.c
index aa74b3da3718..678a1928a9b5 100644
--- a/drivers/video/fbdev/omap2/dss/dispc.c
+++ b/drivers/video/fbdev/omap2/dss/dispc.c
@@ -992,7 +992,6 @@ static enum omap_channel dispc_ovl_get_channel_out(enum omap_plane plane)
992{ 992{
993 int shift; 993 int shift;
994 u32 val; 994 u32 val;
995 enum omap_channel channel;
996 995
997 switch (plane) { 996 switch (plane) {
998 case OMAP_DSS_GFX: 997 case OMAP_DSS_GFX:
@@ -1010,23 +1009,21 @@ static enum omap_channel dispc_ovl_get_channel_out(enum omap_plane plane)
1010 1009
1011 val = dispc_read_reg(DISPC_OVL_ATTRIBUTES(plane)); 1010 val = dispc_read_reg(DISPC_OVL_ATTRIBUTES(plane));
1012 1011
1013 if (dss_has_feature(FEAT_MGR_LCD3)) { 1012 if (FLD_GET(val, shift, shift) == 1)
1014 if (FLD_GET(val, 31, 30) == 0) 1013 return OMAP_DSS_CHANNEL_DIGIT;
1015 channel = FLD_GET(val, shift, shift); 1014
1016 else if (FLD_GET(val, 31, 30) == 1) 1015 if (!dss_has_feature(FEAT_MGR_LCD2))
1017 channel = OMAP_DSS_CHANNEL_LCD2; 1016 return OMAP_DSS_CHANNEL_LCD;
1018 else
1019 channel = OMAP_DSS_CHANNEL_LCD3;
1020 } else if (dss_has_feature(FEAT_MGR_LCD2)) {
1021 if (FLD_GET(val, 31, 30) == 0)
1022 channel = FLD_GET(val, shift, shift);
1023 else
1024 channel = OMAP_DSS_CHANNEL_LCD2;
1025 } else {
1026 channel = FLD_GET(val, shift, shift);
1027 }
1028 1017
1029 return channel; 1018 switch (FLD_GET(val, 31, 30)) {
1019 case 0:
1020 default:
1021 return OMAP_DSS_CHANNEL_LCD;
1022 case 1:
1023 return OMAP_DSS_CHANNEL_LCD2;
1024 case 2:
1025 return OMAP_DSS_CHANNEL_LCD3;
1026 }
1030} 1027}
1031 1028
1032void dispc_wb_set_channel_in(enum dss_writeback_channel channel) 1029void dispc_wb_set_channel_in(enum dss_writeback_channel channel)