aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/hpfb.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-10-11 21:21:02 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-11 21:21:02 -0400
commit5f76945a9c978b8b8bf8eb7fe3b17b9981240a97 (patch)
treedf61aca168df657bc71ce8b578bcb0c81b0622ee /drivers/video/hpfb.c
parent940e3a8dd6683a3787faf769b3df7a06f1c2fa31 (diff)
parentcd9d6f10d07f26dd8a70e519c22b6b4f8a9e3e7a (diff)
Merge tag 'fbdev-updates-for-3.7' of git://github.com/schandinat/linux-2.6
Pull fbdev updates from Florian Tobias Schandinat: "This includes: - large updates for OMAP - basic OMAP5 DSS support for DPI and DSI outputs - large cleanups and restructuring - some update to Exynos and da8xx-fb - removal of the pnx4008 driver (arch removed) - various other small patches" Fix up some trivial conflicts (mostly just include line changes, but also some due to the renaming of the deferred work functions by Tejun). * tag 'fbdev-updates-for-3.7' of git://github.com/schandinat/linux-2.6: (193 commits) gbefb: fix compile error video: mark nuc900fb_map_video_memory as __devinit video/mx3fb: set .owner to prevent module unloading while being used video: exynos_dp: use clk_prepare_enable and clk_disable_unprepare drivers/video/exynos/exynos_mipi_dsi.c: fix error return code drivers/video/savage/savagefb_driver.c: fix error return code video: s3c-fb: use clk_prepare_enable and clk_disable_unprepare da8xx-fb: save and restore LCDC context across suspend/resume cycle da8xx-fb: add pm_runtime support video/udlfb: fix line counting in fb_write OMAPDSS: add missing include for string.h OMAPDSS: DISPC: Configure color conversion coefficients for writeback OMAPDSS: DISPC: Add manager like functions for writeback OMAPDSS: DISPC: Configure writeback FIFOs OMAPDSS: DISPC: Configure writeback specific parameters in dispc_wb_setup() OMAPDSS: DISPC: Configure overlay-like parameters in dispc_wb_setup OMAPDSS: DISPC: Add function to set channel in for writeback OMAPDSS: DISPC: Don't set chroma resampling bit for writeback OMAPDSS: DISPC: Downscale chroma if plane is writeback OMAPDSS: DISPC: Configure input and output sizes for writeback ...
Diffstat (limited to 'drivers/video/hpfb.c')
-rw-r--r--drivers/video/hpfb.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/drivers/video/hpfb.c b/drivers/video/hpfb.c
index ebf8495ff198..7324865f965f 100644
--- a/drivers/video/hpfb.c
+++ b/drivers/video/hpfb.c
@@ -210,6 +210,7 @@ static int __devinit hpfb_init_one(unsigned long phys_base,
210 unsigned long virt_base) 210 unsigned long virt_base)
211{ 211{
212 unsigned long fboff, fb_width, fb_height, fb_start; 212 unsigned long fboff, fb_width, fb_height, fb_start;
213 int ret;
213 214
214 fb_regs = virt_base; 215 fb_regs = virt_base;
215 fboff = (in_8(fb_regs + HPFB_FBOMSB) << 8) | in_8(fb_regs + HPFB_FBOLSB); 216 fboff = (in_8(fb_regs + HPFB_FBOMSB) << 8) | in_8(fb_regs + HPFB_FBOLSB);
@@ -290,19 +291,29 @@ static int __devinit hpfb_init_one(unsigned long phys_base,
290 fb_info.var = hpfb_defined; 291 fb_info.var = hpfb_defined;
291 fb_info.screen_base = (char *)fb_start; 292 fb_info.screen_base = (char *)fb_start;
292 293
293 fb_alloc_cmap(&fb_info.cmap, 1 << hpfb_defined.bits_per_pixel, 0); 294 ret = fb_alloc_cmap(&fb_info.cmap, 1 << hpfb_defined.bits_per_pixel, 0);
295 if (ret < 0)
296 goto unmap_screen_base;
294 297
295 if (register_framebuffer(&fb_info) < 0) { 298 ret = register_framebuffer(&fb_info);
296 fb_dealloc_cmap(&fb_info.cmap); 299 if (ret < 0)
297 iounmap(fb_info.screen_base); 300 goto dealloc_cmap;
298 fb_info.screen_base = NULL;
299 return 1;
300 }
301 301
302 printk(KERN_INFO "fb%d: %s frame buffer device\n", 302 printk(KERN_INFO "fb%d: %s frame buffer device\n",
303 fb_info.node, fb_info.fix.id); 303 fb_info.node, fb_info.fix.id);
304 304
305 return 0; 305 return 0;
306
307dealloc_cmap:
308 fb_dealloc_cmap(&fb_info.cmap);
309
310unmap_screen_base:
311 if (fb_info.screen_base) {
312 iounmap(fb_info.screen_base);
313 fb_info.screen_base = NULL;
314 }
315
316 return ret;
306} 317}
307 318
308/* 319/*
@@ -345,6 +356,9 @@ static void __devexit hpfb_remove_one(struct dio_dev *d)
345 if (d->scode >= DIOII_SCBASE) 356 if (d->scode >= DIOII_SCBASE)
346 iounmap((void *)fb_regs); 357 iounmap((void *)fb_regs);
347 release_mem_region(d->resource.start, resource_size(&d->resource)); 358 release_mem_region(d->resource.start, resource_size(&d->resource));
359 fb_dealloc_cmap(&fb_info.cmap);
360 if (fb_info.screen_base)
361 iounmap(fb_info.screen_base);
348} 362}
349 363
350static struct dio_device_id hpfb_dio_tbl[] = { 364static struct dio_device_id hpfb_dio_tbl[] = {