diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-09-07 08:21:56 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-09-18 09:15:04 -0400 |
commit | 6b41785836f184df585e33cd6b940852fb9299ed (patch) | |
tree | bdabcae873c1baa0b9bd0a5252bd8c213bd45753 | |
parent | 47eb6763ff63126e34785be0ea5f365180595024 (diff) |
OMAPDSS: cleanup dss_recheck_connections
dss_recheck_connections is quite a mess. With the previous commit that
initializes the channel field for HDMI and VENC displays, we can greatly
simplify the dss_recheck_connections.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r-- | drivers/video/omap2/dss/overlay.c | 49 |
1 files changed, 6 insertions, 43 deletions
diff --git a/drivers/video/omap2/dss/overlay.c b/drivers/video/omap2/dss/overlay.c index e3d406875afd..1bf05efffe13 100644 --- a/drivers/video/omap2/dss/overlay.c +++ b/drivers/video/omap2/dss/overlay.c | |||
@@ -109,52 +109,15 @@ void dss_init_overlays(struct platform_device *pdev) | |||
109 | * selected, connect always. */ | 109 | * selected, connect always. */ |
110 | void dss_recheck_connections(struct omap_dss_device *dssdev, bool force) | 110 | void dss_recheck_connections(struct omap_dss_device *dssdev, bool force) |
111 | { | 111 | { |
112 | int i; | ||
113 | struct omap_overlay_manager *lcd_mgr; | ||
114 | struct omap_overlay_manager *tv_mgr; | ||
115 | struct omap_overlay_manager *lcd2_mgr = NULL; | ||
116 | struct omap_overlay_manager *lcd3_mgr = NULL; | ||
117 | struct omap_overlay_manager *mgr = NULL; | 112 | struct omap_overlay_manager *mgr = NULL; |
113 | int i; | ||
118 | 114 | ||
119 | lcd_mgr = omap_dss_get_overlay_manager(OMAP_DSS_CHANNEL_LCD); | 115 | mgr = omap_dss_get_overlay_manager(dssdev->channel); |
120 | tv_mgr = omap_dss_get_overlay_manager(OMAP_DSS_CHANNEL_DIGIT); | ||
121 | if (dss_has_feature(FEAT_MGR_LCD3)) | ||
122 | lcd3_mgr = omap_dss_get_overlay_manager(OMAP_DSS_CHANNEL_LCD3); | ||
123 | if (dss_has_feature(FEAT_MGR_LCD2)) | ||
124 | lcd2_mgr = omap_dss_get_overlay_manager(OMAP_DSS_CHANNEL_LCD2); | ||
125 | |||
126 | if (dssdev->channel == OMAP_DSS_CHANNEL_LCD3) { | ||
127 | if (!lcd3_mgr->device || force) { | ||
128 | if (lcd3_mgr->device) | ||
129 | lcd3_mgr->unset_device(lcd3_mgr); | ||
130 | lcd3_mgr->set_device(lcd3_mgr, dssdev); | ||
131 | mgr = lcd3_mgr; | ||
132 | } | ||
133 | } else if (dssdev->channel == OMAP_DSS_CHANNEL_LCD2) { | ||
134 | if (!lcd2_mgr->device || force) { | ||
135 | if (lcd2_mgr->device) | ||
136 | lcd2_mgr->unset_device(lcd2_mgr); | ||
137 | lcd2_mgr->set_device(lcd2_mgr, dssdev); | ||
138 | mgr = lcd2_mgr; | ||
139 | } | ||
140 | } else if (dssdev->type != OMAP_DISPLAY_TYPE_VENC | ||
141 | && dssdev->type != OMAP_DISPLAY_TYPE_HDMI) { | ||
142 | if (!lcd_mgr->device || force) { | ||
143 | if (lcd_mgr->device) | ||
144 | lcd_mgr->unset_device(lcd_mgr); | ||
145 | lcd_mgr->set_device(lcd_mgr, dssdev); | ||
146 | mgr = lcd_mgr; | ||
147 | } | ||
148 | } | ||
149 | 116 | ||
150 | if (dssdev->type == OMAP_DISPLAY_TYPE_VENC | 117 | if (!mgr->device || force) { |
151 | || dssdev->type == OMAP_DISPLAY_TYPE_HDMI) { | 118 | if (mgr->device) |
152 | if (!tv_mgr->device || force) { | 119 | mgr->unset_device(mgr); |
153 | if (tv_mgr->device) | 120 | mgr->set_device(mgr, dssdev); |
154 | tv_mgr->unset_device(tv_mgr); | ||
155 | tv_mgr->set_device(tv_mgr, dssdev); | ||
156 | mgr = tv_mgr; | ||
157 | } | ||
158 | } | 121 | } |
159 | 122 | ||
160 | if (mgr) { | 123 | if (mgr) { |