aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/omapfb
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2010-09-23 04:18:44 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-05-11 07:19:25 -0400
commit91ac27a6879df3865e160adf979960a14f17d1aa (patch)
tree83419eca87a5624680f337e63e5911288db6b3c6 /drivers/video/omap2/omapfb
parent7a0987bf2cf2683901d0cd7f1504023da2584c5f (diff)
OMAP: DSS2: OMAPFB: Handle errors when initializing panel
Errors from the panel driver were ignored during panel initialization. Handle the errors and fail accordingly. Also move the display initialization to a separate function to make it cleaner. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/omapfb')
-rw-r--r--drivers/video/omap2/omapfb/omapfb-main.c80
1 files changed, 59 insertions, 21 deletions
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index c0c846c8f231..60a0eb793422 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -2193,6 +2193,61 @@ static int omapfb_parse_def_modes(struct omapfb2_device *fbdev)
2193 return r; 2193 return r;
2194} 2194}
2195 2195
2196static int omapfb_init_display(struct omapfb2_device *fbdev,
2197 struct omap_dss_device *dssdev)
2198{
2199 struct omap_dss_driver *dssdrv = dssdev->driver;
2200 int r;
2201
2202 r = dssdrv->enable(dssdev);
2203 if (r) {
2204 dev_warn(fbdev->dev, "Failed to enable display '%s'\n",
2205 dssdev->name);
2206 return r;
2207 }
2208
2209 if (dssdev->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE) {
2210 u16 w, h;
2211 if (dssdrv->enable_te) {
2212 r = dssdrv->enable_te(dssdev, 1);
2213 if (r) {
2214 dev_err(fbdev->dev, "Failed to set TE\n");
2215 return r;
2216 }
2217 }
2218
2219 if (dssdrv->set_update_mode) {
2220 r = dssdrv->set_update_mode(dssdev,
2221 OMAP_DSS_UPDATE_MANUAL);
2222 if (r) {
2223 dev_err(fbdev->dev,
2224 "Failed to set update mode\n");
2225 return r;
2226 }
2227 }
2228
2229 dssdrv->get_resolution(dssdev, &w, &h);
2230 r = dssdrv->update(dssdev, 0, 0, w, h);
2231 if (r) {
2232 dev_err(fbdev->dev,
2233 "Failed to update display\n");
2234 return r;
2235 }
2236 } else {
2237 if (dssdrv->set_update_mode) {
2238 r = dssdrv->set_update_mode(dssdev,
2239 OMAP_DSS_UPDATE_AUTO);
2240 if (r) {
2241 dev_err(fbdev->dev,
2242 "Failed to set update mode\n");
2243 return r;
2244 }
2245 }
2246 }
2247
2248 return 0;
2249}
2250
2196static int omapfb_probe(struct platform_device *pdev) 2251static int omapfb_probe(struct platform_device *pdev)
2197{ 2252{
2198 struct omapfb2_device *fbdev = NULL; 2253 struct omapfb2_device *fbdev = NULL;
@@ -2292,30 +2347,13 @@ static int omapfb_probe(struct platform_device *pdev)
2292 } 2347 }
2293 2348
2294 if (def_display) { 2349 if (def_display) {
2295 struct omap_dss_driver *dssdrv = def_display->driver; 2350 r = omapfb_init_display(fbdev, def_display);
2296
2297 r = def_display->driver->enable(def_display);
2298 if (r) { 2351 if (r) {
2299 dev_warn(fbdev->dev, "Failed to enable display '%s'\n", 2352 dev_err(fbdev->dev,
2300 def_display->name); 2353 "failed to initialize default "
2354 "display\n");
2301 goto cleanup; 2355 goto cleanup;
2302 } 2356 }
2303
2304 if (def_display->caps & OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE) {
2305 u16 w, h;
2306 if (dssdrv->enable_te)
2307 dssdrv->enable_te(def_display, 1);
2308 if (dssdrv->set_update_mode)
2309 dssdrv->set_update_mode(def_display,
2310 OMAP_DSS_UPDATE_MANUAL);
2311
2312 dssdrv->get_resolution(def_display, &w, &h);
2313 def_display->driver->update(def_display, 0, 0, w, h);
2314 } else {
2315 if (dssdrv->set_update_mode)
2316 dssdrv->set_update_mode(def_display,
2317 OMAP_DSS_UPDATE_AUTO);
2318 }
2319 } 2357 }
2320 2358
2321 DBG("create sysfs for fbs\n"); 2359 DBG("create sysfs for fbs\n");