aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-06-04 12:05:12 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-04 12:05:12 -0400
commitd55696af8d91e8f21dacd74a236e6dcc4f6d78c4 (patch)
tree99c14624b8da7ad38f357c3ca225dc5c0e46ab9d /drivers
parent4dc4226f994db264c844a5fcf556935c66f963a5 (diff)
parentfbc6c4a13bbfb420eedfdb26a0a859f9c07e8a7b (diff)
Merge tag 'fbdev-main-3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux into next
Pull main fbdev changes from Tomi Valkeinen: "Mainly fixes and small improvements. The biggest change seems to be backlight control support for mx3fb" * tag 'fbdev-main-3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux: (31 commits) drivers/video/fbdev/fb-puv3.c: Add header files for function unifb_mmap video: fbdev: s3fb.c: Fix for possible null pointer dereference video: fbdev: grvga.c: Fix for possible null pointer dereference matroxfb: perform a dummy read of M_STATUS video: of: display_timing: fix default native-mode setting video: delete unneeded call to platform_get_drvdata video: mx3fb: Add backlight control support video: omap: delete support for early fbmem allocation video: of: display_timing: remove two unsafe error messages fbdev: fbmem: remove positive test on unsigned values fbcon: Fix memory leak in con2fb_release_oldinfo() video: Kconfig: Add a dependency to the Goldfish framebuffer driver video: exynos: Add a dependency to the menu video: mx3fb: Use devm_kzalloc video/nuc900: allow modular build video: atmel needs FB_BACKLIGHT video: export fb_prepare_logo video/mbx: fix building debugfs support video/omap: fix modular build video: clarify I2C dependencies ...
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/console/fbcon.c1
-rw-r--r--drivers/video/fbdev/Kconfig11
-rw-r--r--drivers/video/fbdev/bf54x-lq043fb.c2
-rw-r--r--drivers/video/fbdev/core/fbmem.c7
-rw-r--r--drivers/video/fbdev/core/fbmon.c9
-rw-r--r--drivers/video/fbdev/da8xx-fb.c14
-rw-r--r--drivers/video/fbdev/exynos/Kconfig2
-rw-r--r--drivers/video/fbdev/fb-puv3.c2
-rw-r--r--drivers/video/fbdev/gbefb.c2
-rw-r--r--drivers/video/fbdev/grvga.c3
-rw-r--r--drivers/video/fbdev/matrox/matroxfb_base.h2
-rw-r--r--drivers/video/fbdev/mbx/Makefile3
-rw-r--r--drivers/video/fbdev/mbx/mbxdebugfs.c2
-rw-r--r--drivers/video/fbdev/mbx/mbxfb.c2
-rw-r--r--drivers/video/fbdev/mmp/Kconfig2
-rw-r--r--drivers/video/fbdev/mmp/fb/mmpfb.c9
-rw-r--r--drivers/video/fbdev/mmp/hw/Kconfig6
-rw-r--r--drivers/video/fbdev/mmp/hw/mmp_ctrl.h32
-rw-r--r--drivers/video/fbdev/mx3fb.c85
-rw-r--r--drivers/video/fbdev/omap/Kconfig9
-rw-r--r--drivers/video/fbdev/omap/Makefile23
-rw-r--r--drivers/video/fbdev/omap/lcdc.c67
-rw-r--r--drivers/video/fbdev/omap/omapfb_main.c1
-rw-r--r--drivers/video/fbdev/pxa3xx-gcu.c6
-rw-r--r--drivers/video/fbdev/s3fb.c3
-rw-r--r--drivers/video/fbdev/wm8505fb.c2
-rw-r--r--drivers/video/of_display_timing.c10
27 files changed, 166 insertions, 151 deletions
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index f447734b09b4..57b1d44acbfe 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -748,6 +748,7 @@ static int con2fb_release_oldinfo(struct vc_data *vc, struct fb_info *oldinfo,
748 fbcon_del_cursor_timer(oldinfo); 748 fbcon_del_cursor_timer(oldinfo);
749 kfree(ops->cursor_state.mask); 749 kfree(ops->cursor_state.mask);
750 kfree(ops->cursor_data); 750 kfree(ops->cursor_data);
751 kfree(ops->cursor_src);
751 kfree(ops->fontbuffer); 752 kfree(ops->fontbuffer);
752 kfree(oldinfo->fbcon_par); 753 kfree(oldinfo->fbcon_par);
753 oldinfo->fbcon_par = NULL; 754 oldinfo->fbcon_par = NULL;
diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
index e1f47272fdea..59c98bfd5a8a 100644
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
@@ -360,6 +360,7 @@ config FB_CYBER2000_DDC
360config FB_CYBER2000_I2C 360config FB_CYBER2000_I2C
361 bool "CyberPro 2000/2010/5000 I2C support" 361 bool "CyberPro 2000/2010/5000 I2C support"
362 depends on FB_CYBER2000 && I2C && ARCH_NETWINDER 362 depends on FB_CYBER2000 && I2C && ARCH_NETWINDER
363 depends on I2C=y || FB_CYBER2000=m
363 select I2C_ALGOBIT 364 select I2C_ALGOBIT
364 help 365 help
365 Enable support for the I2C video decoder interface on the 366 Enable support for the I2C video decoder interface on the
@@ -966,6 +967,7 @@ config FB_S1D13XXX
966config FB_ATMEL 967config FB_ATMEL
967 tristate "AT91/AT32 LCD Controller support" 968 tristate "AT91/AT32 LCD Controller support"
968 depends on FB && HAVE_FB_ATMEL 969 depends on FB && HAVE_FB_ATMEL
970 select FB_BACKLIGHT
969 select FB_CFB_FILLRECT 971 select FB_CFB_FILLRECT
970 select FB_CFB_COPYAREA 972 select FB_CFB_COPYAREA
971 select FB_CFB_IMAGEBLIT 973 select FB_CFB_IMAGEBLIT
@@ -1971,6 +1973,7 @@ config FB_W100
1971config FB_SH_MOBILE_LCDC 1973config FB_SH_MOBILE_LCDC
1972 tristate "SuperH Mobile LCDC framebuffer support" 1974 tristate "SuperH Mobile LCDC framebuffer support"
1973 depends on FB && (SUPERH || ARCH_SHMOBILE) && HAVE_CLK 1975 depends on FB && (SUPERH || ARCH_SHMOBILE) && HAVE_CLK
1976 depends on FB_SH_MOBILE_MERAM || !FB_SH_MOBILE_MERAM
1974 select FB_SYS_FILLRECT 1977 select FB_SYS_FILLRECT
1975 select FB_SYS_COPYAREA 1978 select FB_SYS_COPYAREA
1976 select FB_SYS_IMAGEBLIT 1979 select FB_SYS_IMAGEBLIT
@@ -1993,7 +1996,7 @@ config FB_SH_MOBILE_HDMI
1993 1996
1994config FB_TMIO 1997config FB_TMIO
1995 tristate "Toshiba Mobile IO FrameBuffer support" 1998 tristate "Toshiba Mobile IO FrameBuffer support"
1996 depends on FB && MFD_CORE 1999 depends on FB && (MFD_TMIO || COMPILE_TEST)
1997 select FB_CFB_FILLRECT 2000 select FB_CFB_FILLRECT
1998 select FB_CFB_COPYAREA 2001 select FB_CFB_COPYAREA
1999 select FB_CFB_IMAGEBLIT 2002 select FB_CFB_IMAGEBLIT
@@ -2062,7 +2065,7 @@ config FB_S3C2410_DEBUG
2062 through sysfs 2065 through sysfs
2063 2066
2064config FB_NUC900 2067config FB_NUC900
2065 bool "NUC900 LCD framebuffer support" 2068 tristate "NUC900 LCD framebuffer support"
2066 depends on FB && ARCH_W90X900 2069 depends on FB && ARCH_W90X900
2067 select FB_CFB_FILLRECT 2070 select FB_CFB_FILLRECT
2068 select FB_CFB_COPYAREA 2071 select FB_CFB_COPYAREA
@@ -2169,7 +2172,7 @@ config FB_XILINX
2169 2172
2170config FB_GOLDFISH 2173config FB_GOLDFISH
2171 tristate "Goldfish Framebuffer" 2174 tristate "Goldfish Framebuffer"
2172 depends on FB && HAS_DMA 2175 depends on FB && HAS_DMA && (GOLDFISH || COMPILE_TEST)
2173 select FB_CFB_FILLRECT 2176 select FB_CFB_FILLRECT
2174 select FB_CFB_COPYAREA 2177 select FB_CFB_COPYAREA
2175 select FB_CFB_IMAGEBLIT 2178 select FB_CFB_IMAGEBLIT
@@ -2295,6 +2298,7 @@ endchoice
2295config FB_MB862XX_I2C 2298config FB_MB862XX_I2C
2296 bool "Support I2C bus on MB862XX GDC" 2299 bool "Support I2C bus on MB862XX GDC"
2297 depends on FB_MB862XX && I2C 2300 depends on FB_MB862XX && I2C
2301 depends on FB_MB862XX=m || I2C=y
2298 default y 2302 default y
2299 help 2303 help
2300 Selecting this option adds Coral-P(A)/Lime GDC I2C bus adapter 2304 Selecting this option adds Coral-P(A)/Lime GDC I2C bus adapter
@@ -2332,6 +2336,7 @@ config FB_MX3
2332 select FB_CFB_FILLRECT 2336 select FB_CFB_FILLRECT
2333 select FB_CFB_COPYAREA 2337 select FB_CFB_COPYAREA
2334 select FB_CFB_IMAGEBLIT 2338 select FB_CFB_IMAGEBLIT
2339 select BACKLIGHT_CLASS_DEVICE
2335 default y 2340 default y
2336 help 2341 help
2337 This is a framebuffer device for the i.MX31 LCD Controller. So 2342 This is a framebuffer device for the i.MX31 LCD Controller. So
diff --git a/drivers/video/fbdev/bf54x-lq043fb.c b/drivers/video/fbdev/bf54x-lq043fb.c
index e2c42ad8515a..adbef542c998 100644
--- a/drivers/video/fbdev/bf54x-lq043fb.c
+++ b/drivers/video/fbdev/bf54x-lq043fb.c
@@ -717,8 +717,6 @@ static int bfin_bf54x_remove(struct platform_device *pdev)
717#ifdef CONFIG_PM 717#ifdef CONFIG_PM
718static int bfin_bf54x_suspend(struct platform_device *pdev, pm_message_t state) 718static int bfin_bf54x_suspend(struct platform_device *pdev, pm_message_t state)
719{ 719{
720 struct fb_info *fbinfo = platform_get_drvdata(pdev);
721
722 bfin_write_EPPI0_CONTROL(bfin_read_EPPI0_CONTROL() & ~EPPI_EN); 720 bfin_write_EPPI0_CONTROL(bfin_read_EPPI0_CONTROL() & ~EPPI_EN);
723 disable_dma(CH_EPPI0); 721 disable_dma(CH_EPPI0);
724 bfin_write_EPPI0_STATUS(0xFFFF); 722 bfin_write_EPPI0_STATUS(0xFFFF);
diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
index b6d5008f361f..b5e85f6c1c26 100644
--- a/drivers/video/fbdev/core/fbmem.c
+++ b/drivers/video/fbdev/core/fbmem.c
@@ -433,7 +433,7 @@ static void fb_do_show_logo(struct fb_info *info, struct fb_image *image,
433 image->dx += image->width + 8; 433 image->dx += image->width + 8;
434 } 434 }
435 } else if (rotate == FB_ROTATE_UD) { 435 } else if (rotate == FB_ROTATE_UD) {
436 for (x = 0; x < num && image->dx >= 0; x++) { 436 for (x = 0; x < num; x++) {
437 info->fbops->fb_imageblit(info, image); 437 info->fbops->fb_imageblit(info, image);
438 image->dx -= image->width + 8; 438 image->dx -= image->width + 8;
439 } 439 }
@@ -445,7 +445,7 @@ static void fb_do_show_logo(struct fb_info *info, struct fb_image *image,
445 image->dy += image->height + 8; 445 image->dy += image->height + 8;
446 } 446 }
447 } else if (rotate == FB_ROTATE_CCW) { 447 } else if (rotate == FB_ROTATE_CCW) {
448 for (x = 0; x < num && image->dy >= 0; x++) { 448 for (x = 0; x < num; x++) {
449 info->fbops->fb_imageblit(info, image); 449 info->fbops->fb_imageblit(info, image);
450 image->dy -= image->height + 8; 450 image->dy -= image->height + 8;
451 } 451 }
@@ -674,6 +674,7 @@ int fb_show_logo(struct fb_info *info, int rotate)
674int fb_prepare_logo(struct fb_info *info, int rotate) { return 0; } 674int fb_prepare_logo(struct fb_info *info, int rotate) { return 0; }
675int fb_show_logo(struct fb_info *info, int rotate) { return 0; } 675int fb_show_logo(struct fb_info *info, int rotate) { return 0; }
676#endif /* CONFIG_LOGO */ 676#endif /* CONFIG_LOGO */
677EXPORT_SYMBOL(fb_prepare_logo);
677EXPORT_SYMBOL(fb_show_logo); 678EXPORT_SYMBOL(fb_show_logo);
678 679
679static void *fb_seq_start(struct seq_file *m, loff_t *pos) 680static void *fb_seq_start(struct seq_file *m, loff_t *pos)
@@ -1179,7 +1180,7 @@ static long do_fb_ioctl(struct fb_info *info, unsigned int cmd,
1179 return -EFAULT; 1180 return -EFAULT;
1180 if (con2fb.console < 1 || con2fb.console > MAX_NR_CONSOLES) 1181 if (con2fb.console < 1 || con2fb.console > MAX_NR_CONSOLES)
1181 return -EINVAL; 1182 return -EINVAL;
1182 if (con2fb.framebuffer < 0 || con2fb.framebuffer >= FB_MAX) 1183 if (con2fb.framebuffer >= FB_MAX)
1183 return -EINVAL; 1184 return -EINVAL;
1184 if (!registered_fb[con2fb.framebuffer]) 1185 if (!registered_fb[con2fb.framebuffer])
1185 request_module("fb%d", con2fb.framebuffer); 1186 request_module("fb%d", con2fb.framebuffer);
diff --git a/drivers/video/fbdev/core/fbmon.c b/drivers/video/fbdev/core/fbmon.c
index c204ebe6187e..5b0e313849bd 100644
--- a/drivers/video/fbdev/core/fbmon.c
+++ b/drivers/video/fbdev/core/fbmon.c
@@ -1012,13 +1012,20 @@ void fb_edid_add_monspecs(unsigned char *edid, struct fb_monspecs *specs)
1012 while (pos < edid[2]) { 1012 while (pos < edid[2]) {
1013 u8 len = edid[pos] & 0x1f, type = (edid[pos] >> 5) & 7; 1013 u8 len = edid[pos] & 0x1f, type = (edid[pos] >> 5) & 7;
1014 pr_debug("Data block %u of %u bytes\n", type, len); 1014 pr_debug("Data block %u of %u bytes\n", type, len);
1015 if (type == 2) 1015 if (type == 2) {
1016 for (i = pos; i < pos + len; i++) { 1016 for (i = pos; i < pos + len; i++) {
1017 u8 idx = edid[pos + i] & 0x7f; 1017 u8 idx = edid[pos + i] & 0x7f;
1018 svd[svd_n++] = idx; 1018 svd[svd_n++] = idx;
1019 pr_debug("N%sative mode #%d\n", 1019 pr_debug("N%sative mode #%d\n",
1020 edid[pos + i] & 0x80 ? "" : "on-n", idx); 1020 edid[pos + i] & 0x80 ? "" : "on-n", idx);
1021 } 1021 }
1022 } else if (type == 3 && len >= 3) {
1023 /* Check Vendor Specific Data Block. For HDMI,
1024 it is always 00-0C-03 for HDMI Licensing, LLC. */
1025 if (edid[pos + 1] == 3 && edid[pos + 2] == 0xc &&
1026 edid[pos + 3] == 0)
1027 specs->misc |= FB_MISC_HDMI;
1028 }
1022 pos += len + 1; 1029 pos += len + 1;
1023 } 1030 }
1024 1031
diff --git a/drivers/video/fbdev/da8xx-fb.c b/drivers/video/fbdev/da8xx-fb.c
index 6b23508ff0a5..a8484f768d04 100644
--- a/drivers/video/fbdev/da8xx-fb.c
+++ b/drivers/video/fbdev/da8xx-fb.c
@@ -242,6 +242,20 @@ static struct fb_videomode known_lcd_panels[] = {
242 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, 242 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
243 .flag = 0, 243 .flag = 0,
244 }, 244 },
245 [3] = {
246 /* Densitron 84-0023-001T */
247 .name = "Densitron_84-0023-001T",
248 .xres = 320,
249 .yres = 240,
250 .pixclock = KHZ2PICOS(6400),
251 .left_margin = 0,
252 .right_margin = 0,
253 .upper_margin = 0,
254 .lower_margin = 0,
255 .hsync_len = 30,
256 .vsync_len = 3,
257 .sync = 0,
258 },
245}; 259};
246 260
247static bool da8xx_fb_is_raster_enabled(void) 261static bool da8xx_fb_is_raster_enabled(void)
diff --git a/drivers/video/fbdev/exynos/Kconfig b/drivers/video/fbdev/exynos/Kconfig
index fcf2d48ac6d1..1f16b4678c71 100644
--- a/drivers/video/fbdev/exynos/Kconfig
+++ b/drivers/video/fbdev/exynos/Kconfig
@@ -4,6 +4,7 @@
4 4
5menuconfig EXYNOS_VIDEO 5menuconfig EXYNOS_VIDEO
6 bool "Exynos Video driver support" 6 bool "Exynos Video driver support"
7 depends on ARCH_S5PV210 || ARCH_EXYNOS
7 help 8 help
8 This enables support for EXYNOS Video device. 9 This enables support for EXYNOS Video device.
9 10
@@ -15,7 +16,6 @@ if EXYNOS_VIDEO
15 16
16config EXYNOS_MIPI_DSI 17config EXYNOS_MIPI_DSI
17 bool "EXYNOS MIPI DSI driver support." 18 bool "EXYNOS MIPI DSI driver support."
18 depends on ARCH_S5PV210 || ARCH_EXYNOS
19 select GENERIC_PHY 19 select GENERIC_PHY
20 help 20 help
21 This enables support for MIPI-DSI device. 21 This enables support for MIPI-DSI device.
diff --git a/drivers/video/fbdev/fb-puv3.c b/drivers/video/fbdev/fb-puv3.c
index 6db9ebd042a3..88fa2e70a0bb 100644
--- a/drivers/video/fbdev/fb-puv3.c
+++ b/drivers/video/fbdev/fb-puv3.c
@@ -18,8 +18,10 @@
18#include <linux/fb.h> 18#include <linux/fb.h>
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/console.h> 20#include <linux/console.h>
21#include <linux/mm.h>
21 22
22#include <asm/sizes.h> 23#include <asm/sizes.h>
24#include <asm/pgtable.h>
23#include <mach/hardware.h> 25#include <mach/hardware.h>
24 26
25/* Platform_data reserved for unifb registers. */ 27/* Platform_data reserved for unifb registers. */
diff --git a/drivers/video/fbdev/gbefb.c b/drivers/video/fbdev/gbefb.c
index 3ec65a878ac8..4aa56ba78f32 100644
--- a/drivers/video/fbdev/gbefb.c
+++ b/drivers/video/fbdev/gbefb.c
@@ -1068,7 +1068,7 @@ static struct fb_ops gbefb_ops = {
1068 1068
1069static ssize_t gbefb_show_memsize(struct device *dev, struct device_attribute *attr, char *buf) 1069static ssize_t gbefb_show_memsize(struct device *dev, struct device_attribute *attr, char *buf)
1070{ 1070{
1071 return snprintf(buf, PAGE_SIZE, "%d\n", gbe_mem_size); 1071 return snprintf(buf, PAGE_SIZE, "%u\n", gbe_mem_size);
1072} 1072}
1073 1073
1074static DEVICE_ATTR(size, S_IRUGO, gbefb_show_memsize, NULL); 1074static DEVICE_ATTR(size, S_IRUGO, gbefb_show_memsize, NULL);
diff --git a/drivers/video/fbdev/grvga.c b/drivers/video/fbdev/grvga.c
index c078701f15f6..2db5bb1a33e8 100644
--- a/drivers/video/fbdev/grvga.c
+++ b/drivers/video/fbdev/grvga.c
@@ -514,9 +514,10 @@ free_fb:
514static int grvga_remove(struct platform_device *device) 514static int grvga_remove(struct platform_device *device)
515{ 515{
516 struct fb_info *info = dev_get_drvdata(&device->dev); 516 struct fb_info *info = dev_get_drvdata(&device->dev);
517 struct grvga_par *par = info->par; 517 struct grvga_par *par;
518 518
519 if (info) { 519 if (info) {
520 par = info->par;
520 unregister_framebuffer(info); 521 unregister_framebuffer(info);
521 fb_dealloc_cmap(&info->cmap); 522 fb_dealloc_cmap(&info->cmap);
522 523
diff --git a/drivers/video/fbdev/matrox/matroxfb_base.h b/drivers/video/fbdev/matrox/matroxfb_base.h
index 556d96ce40bf..89a8a89a5eb2 100644
--- a/drivers/video/fbdev/matrox/matroxfb_base.h
+++ b/drivers/video/fbdev/matrox/matroxfb_base.h
@@ -698,7 +698,7 @@ void matroxfb_unregister_driver(struct matroxfb_driver* drv);
698 698
699#define mga_fifo(n) do {} while ((mga_inl(M_FIFOSTATUS) & 0xFF) < (n)) 699#define mga_fifo(n) do {} while ((mga_inl(M_FIFOSTATUS) & 0xFF) < (n))
700 700
701#define WaitTillIdle() do {} while (mga_inl(M_STATUS) & 0x10000) 701#define WaitTillIdle() do { mga_inl(M_STATUS); do {} while (mga_inl(M_STATUS) & 0x10000); } while (0)
702 702
703/* code speedup */ 703/* code speedup */
704#ifdef CONFIG_FB_MATROX_MILLENIUM 704#ifdef CONFIG_FB_MATROX_MILLENIUM
diff --git a/drivers/video/fbdev/mbx/Makefile b/drivers/video/fbdev/mbx/Makefile
index 16c1165cf9c7..d7ae5a9bb376 100644
--- a/drivers/video/fbdev/mbx/Makefile
+++ b/drivers/video/fbdev/mbx/Makefile
@@ -1,4 +1,3 @@
1# Makefile for the 2700G controller driver. 1# Makefile for the 2700G controller driver.
2 2
3obj-$(CONFIG_FB_MBX) += mbxfb.o 3obj-y += mbxfb.o
4obj-$(CONFIG_FB_MBX_DEBUG) += mbxfbdebugfs.o
diff --git a/drivers/video/fbdev/mbx/mbxdebugfs.c b/drivers/video/fbdev/mbx/mbxdebugfs.c
index 4449f249b0e7..e3bc00a75296 100644
--- a/drivers/video/fbdev/mbx/mbxdebugfs.c
+++ b/drivers/video/fbdev/mbx/mbxdebugfs.c
@@ -17,7 +17,7 @@ struct mbxfb_debugfs_data {
17 17
18static int open_file_generic(struct inode *inode, struct file *file) 18static int open_file_generic(struct inode *inode, struct file *file)
19{ 19{
20 file->private_data = inode->u.generic_ip; 20 file->private_data = inode->i_private;
21 return 0; 21 return 0;
22} 22}
23 23
diff --git a/drivers/video/fbdev/mbx/mbxfb.c b/drivers/video/fbdev/mbx/mbxfb.c
index f0a5392f5fd3..2bd52ed8832c 100644
--- a/drivers/video/fbdev/mbx/mbxfb.c
+++ b/drivers/video/fbdev/mbx/mbxfb.c
@@ -877,6 +877,8 @@ static int mbxfb_resume(struct platform_device *dev)
877#ifndef CONFIG_FB_MBX_DEBUG 877#ifndef CONFIG_FB_MBX_DEBUG
878#define mbxfb_debugfs_init(x) do {} while(0) 878#define mbxfb_debugfs_init(x) do {} while(0)
879#define mbxfb_debugfs_remove(x) do {} while(0) 879#define mbxfb_debugfs_remove(x) do {} while(0)
880#else
881#include "mbxdebugfs.c"
880#endif 882#endif
881 883
882#define res_size(_r) (((_r)->end - (_r)->start) + 1) 884#define res_size(_r) (((_r)->end - (_r)->start) + 1)
diff --git a/drivers/video/fbdev/mmp/Kconfig b/drivers/video/fbdev/mmp/Kconfig
index d4a4ffc24749..f56a7e2e8136 100644
--- a/drivers/video/fbdev/mmp/Kconfig
+++ b/drivers/video/fbdev/mmp/Kconfig
@@ -1,6 +1,6 @@
1menuconfig MMP_DISP 1menuconfig MMP_DISP
2 tristate "Marvell MMP Display Subsystem support" 2 tristate "Marvell MMP Display Subsystem support"
3 depends on CPU_PXA910 || CPU_MMP2 || CPU_MMP3 || CPU_PXA988 3 depends on CPU_PXA910 || CPU_MMP2
4 help 4 help
5 Marvell Display Subsystem support. 5 Marvell Display Subsystem support.
6 6
diff --git a/drivers/video/fbdev/mmp/fb/mmpfb.c b/drivers/video/fbdev/mmp/fb/mmpfb.c
index 7ab31eb76a8c..910fcc6ecece 100644
--- a/drivers/video/fbdev/mmp/fb/mmpfb.c
+++ b/drivers/video/fbdev/mmp/fb/mmpfb.c
@@ -554,8 +554,8 @@ static void fb_info_clear(struct fb_info *info)
554static int mmpfb_probe(struct platform_device *pdev) 554static int mmpfb_probe(struct platform_device *pdev)
555{ 555{
556 struct mmp_buffer_driver_mach_info *mi; 556 struct mmp_buffer_driver_mach_info *mi;
557 struct fb_info *info = 0; 557 struct fb_info *info;
558 struct mmpfb_info *fbi = 0; 558 struct mmpfb_info *fbi;
559 int ret, modes_num; 559 int ret, modes_num;
560 560
561 mi = pdev->dev.platform_data; 561 mi = pdev->dev.platform_data;
@@ -569,10 +569,6 @@ static int mmpfb_probe(struct platform_device *pdev)
569 if (info == NULL) 569 if (info == NULL)
570 return -ENOMEM; 570 return -ENOMEM;
571 fbi = info->par; 571 fbi = info->par;
572 if (!fbi) {
573 ret = -EINVAL;
574 goto failed;
575 }
576 572
577 /* init fb */ 573 /* init fb */
578 fbi->fb_info = info; 574 fbi->fb_info = info;
@@ -667,7 +663,6 @@ failed_free_buff:
667 fbi->fb_start_dma); 663 fbi->fb_start_dma);
668failed_destroy_mutex: 664failed_destroy_mutex:
669 mutex_destroy(&fbi->access_ok); 665 mutex_destroy(&fbi->access_ok);
670failed:
671 dev_err(fbi->dev, "mmp-fb: frame buffer device init failed\n"); 666 dev_err(fbi->dev, "mmp-fb: frame buffer device init failed\n");
672 667
673 framebuffer_release(info); 668 framebuffer_release(info);
diff --git a/drivers/video/fbdev/mmp/hw/Kconfig b/drivers/video/fbdev/mmp/hw/Kconfig
index 02f109a20cd0..c735d133895c 100644
--- a/drivers/video/fbdev/mmp/hw/Kconfig
+++ b/drivers/video/fbdev/mmp/hw/Kconfig
@@ -2,12 +2,12 @@ if MMP_DISP
2 2
3config MMP_DISP_CONTROLLER 3config MMP_DISP_CONTROLLER
4 bool "mmp display controller hw support" 4 bool "mmp display controller hw support"
5 depends on CPU_PXA910 || CPU_MMP2 || CPU_MMP3 || CPU_PXA988 5 depends on CPU_PXA910 || CPU_MMP2
6 default n 6 default n
7 help 7 help
8 Marvell MMP display hw controller support 8 Marvell MMP display hw controller support
9 this controller is used on Marvell PXA910, 9 this controller is used on Marvell PXA910 and
10 MMP2, MMP3, PXA988 chips 10 MMP2 chips
11 11
12config MMP_DISP_SPI 12config MMP_DISP_SPI
13 bool "mmp display controller spi port" 13 bool "mmp display controller spi port"
diff --git a/drivers/video/fbdev/mmp/hw/mmp_ctrl.h b/drivers/video/fbdev/mmp/hw/mmp_ctrl.h
index 53301cfdb1ae..56fdeab34355 100644
--- a/drivers/video/fbdev/mmp/hw/mmp_ctrl.h
+++ b/drivers/video/fbdev/mmp/hw/mmp_ctrl.h
@@ -167,11 +167,7 @@ struct lcd_regs {
167 PN2_IOPAD_CONTROL) : LCD_TOP_CTRL) 167 PN2_IOPAD_CONTROL) : LCD_TOP_CTRL)
168 168
169/* dither configure */ 169/* dither configure */
170#ifdef CONFIG_CPU_PXA988
171#define LCD_DITHER_CTRL (0x01EC)
172#else
173#define LCD_DITHER_CTRL (0x00A0) 170#define LCD_DITHER_CTRL (0x00A0)
174#endif
175 171
176#define DITHER_TBL_INDEX_SEL(s) ((s) << 16) 172#define DITHER_TBL_INDEX_SEL(s) ((s) << 16)
177#define DITHER_MODE2(m) ((m) << 12) 173#define DITHER_MODE2(m) ((m) << 12)
@@ -186,15 +182,6 @@ struct lcd_regs {
186#define DITHER_EN1 (1) 182#define DITHER_EN1 (1)
187 183
188/* dither table data was fixed by video bpp of input and output*/ 184/* dither table data was fixed by video bpp of input and output*/
189#ifdef CONFIG_CPU_PXA988
190#define DITHER_TB_4X4_INDEX0 (0x6e4ca280)
191#define DITHER_TB_4X4_INDEX1 (0x5d7f91b3)
192#define DITHER_TB_4X8_INDEX0 (0xb391a280)
193#define DITHER_TB_4X8_INDEX1 (0x7f5d6e4c)
194#define DITHER_TB_4X8_INDEX2 (0x80a291b3)
195#define DITHER_TB_4X8_INDEX3 (0x4c6e5d7f)
196#define LCD_DITHER_TBL_DATA (0x01F0)
197#else
198#define DITHER_TB_4X4_INDEX0 (0x3b19f7d5) 185#define DITHER_TB_4X4_INDEX0 (0x3b19f7d5)
199#define DITHER_TB_4X4_INDEX1 (0x082ac4e6) 186#define DITHER_TB_4X4_INDEX1 (0x082ac4e6)
200#define DITHER_TB_4X8_INDEX0 (0xf7d508e6) 187#define DITHER_TB_4X8_INDEX0 (0xf7d508e6)
@@ -202,7 +189,6 @@ struct lcd_regs {
202#define DITHER_TB_4X8_INDEX2 (0xc4e6d5f7) 189#define DITHER_TB_4X8_INDEX2 (0xc4e6d5f7)
203#define DITHER_TB_4X8_INDEX3 (0x082a193b) 190#define DITHER_TB_4X8_INDEX3 (0x082a193b)
204#define LCD_DITHER_TBL_DATA (0x00A4) 191#define LCD_DITHER_TBL_DATA (0x00A4)
205#endif
206 192
207/* Video Frame 0&1 start address registers */ 193/* Video Frame 0&1 start address registers */
208#define LCD_SPU_DMA_START_ADDR_Y0 0x00C0 194#define LCD_SPU_DMA_START_ADDR_Y0 0x00C0
@@ -933,16 +919,9 @@ struct lcd_regs {
933#define LCD_PN2_SQULN2_CTRL (0x02F0) 919#define LCD_PN2_SQULN2_CTRL (0x02F0)
934#define ALL_LAYER_ALPHA_SEL (0x02F4) 920#define ALL_LAYER_ALPHA_SEL (0x02F4)
935 921
936/* pxa988 has different MASTER_CTRL from MMP3/MMP2 */
937#ifdef CONFIG_CPU_PXA988
938#define TIMING_MASTER_CONTROL (0x01F4)
939#define MASTER_ENH(id) (1 << ((id) + 5))
940#define MASTER_ENV(id) (1 << ((id) + 6))
941#else
942#define TIMING_MASTER_CONTROL (0x02F8) 922#define TIMING_MASTER_CONTROL (0x02F8)
943#define MASTER_ENH(id) (1 << (id)) 923#define MASTER_ENH(id) (1 << (id))
944#define MASTER_ENV(id) (1 << ((id) + 4)) 924#define MASTER_ENV(id) (1 << ((id) + 4))
945#endif
946 925
947#define DSI_START_SEL_SHIFT(id) (((id) << 1) + 8) 926#define DSI_START_SEL_SHIFT(id) (((id) << 1) + 8)
948#define timing_master_config(path, dsi_id, lcd_id) \ 927#define timing_master_config(path, dsi_id, lcd_id) \
@@ -1312,19 +1291,8 @@ struct dsi_regs {
1312#define DSI_PHY_TIME_3_CFG_CSR_TIME_REQRDY_MASK (0xff) 1291#define DSI_PHY_TIME_3_CFG_CSR_TIME_REQRDY_MASK (0xff)
1313#define DSI_PHY_TIME_3_CFG_CSR_TIME_REQRDY_SHIFT 0 1292#define DSI_PHY_TIME_3_CFG_CSR_TIME_REQRDY_SHIFT 0
1314 1293
1315/*
1316 * DSI timings
1317 * PXA988 has diffrent ESC CLK with MMP2/MMP3
1318 * it will be used in dsi_set_dphy() in pxa688_phy.c
1319 * as low power mode clock.
1320 */
1321#ifdef CONFIG_CPU_PXA988
1322#define DSI_ESC_CLK 52 /* Unit: Mhz */
1323#define DSI_ESC_CLK_T 19 /* Unit: ns */
1324#else
1325#define DSI_ESC_CLK 66 /* Unit: Mhz */ 1294#define DSI_ESC_CLK 66 /* Unit: Mhz */
1326#define DSI_ESC_CLK_T 15 /* Unit: ns */ 1295#define DSI_ESC_CLK_T 15 /* Unit: ns */
1327#endif
1328 1296
1329/* LVDS */ 1297/* LVDS */
1330/* LVDS_PHY_CTRL */ 1298/* LVDS_PHY_CTRL */
diff --git a/drivers/video/fbdev/mx3fb.c b/drivers/video/fbdev/mx3fb.c
index 142e860fb527..c645a0a0c341 100644
--- a/drivers/video/fbdev/mx3fb.c
+++ b/drivers/video/fbdev/mx3fb.c
@@ -27,6 +27,7 @@
27#include <linux/clk.h> 27#include <linux/clk.h>
28#include <linux/mutex.h> 28#include <linux/mutex.h>
29#include <linux/dma/ipu-dma.h> 29#include <linux/dma/ipu-dma.h>
30#include <linux/backlight.h>
30 31
31#include <linux/platform_data/dma-imx.h> 32#include <linux/platform_data/dma-imx.h>
32#include <linux/platform_data/video-mx3fb.h> 33#include <linux/platform_data/video-mx3fb.h>
@@ -241,6 +242,7 @@ struct mx3fb_data {
241 void __iomem *reg_base; 242 void __iomem *reg_base;
242 spinlock_t lock; 243 spinlock_t lock;
243 struct device *dev; 244 struct device *dev;
245 struct backlight_device *bl;
244 246
245 uint32_t h_start_width; 247 uint32_t h_start_width;
246 uint32_t v_start_width; 248 uint32_t v_start_width;
@@ -271,6 +273,71 @@ struct mx3fb_info {
271 struct fb_var_screeninfo cur_var; /* current var info */ 273 struct fb_var_screeninfo cur_var; /* current var info */
272}; 274};
273 275
276static void sdc_set_brightness(struct mx3fb_data *mx3fb, uint8_t value);
277static u32 sdc_get_brightness(struct mx3fb_data *mx3fb);
278
279static int mx3fb_bl_get_brightness(struct backlight_device *bl)
280{
281 struct mx3fb_data *fbd = bl_get_data(bl);
282
283 return sdc_get_brightness(fbd);
284}
285
286static int mx3fb_bl_update_status(struct backlight_device *bl)
287{
288 struct mx3fb_data *fbd = bl_get_data(bl);
289 int brightness = bl->props.brightness;
290
291 if (bl->props.power != FB_BLANK_UNBLANK)
292 brightness = 0;
293 if (bl->props.fb_blank != FB_BLANK_UNBLANK)
294 brightness = 0;
295
296 fbd->backlight_level = (fbd->backlight_level & ~0xFF) | brightness;
297
298 sdc_set_brightness(fbd, fbd->backlight_level);
299
300 return 0;
301}
302
303static const struct backlight_ops mx3fb_lcdc_bl_ops = {
304 .update_status = mx3fb_bl_update_status,
305 .get_brightness = mx3fb_bl_get_brightness,
306};
307
308static void mx3fb_init_backlight(struct mx3fb_data *fbd)
309{
310 struct backlight_properties props;
311 struct backlight_device *bl;
312
313 if (fbd->bl)
314 return;
315
316 memset(&props, 0, sizeof(struct backlight_properties));
317 props.max_brightness = 0xff;
318 props.type = BACKLIGHT_RAW;
319 sdc_set_brightness(fbd, fbd->backlight_level);
320
321 bl = backlight_device_register("mx3fb-bl", fbd->dev, fbd,
322 &mx3fb_lcdc_bl_ops, &props);
323 if (IS_ERR(bl)) {
324 dev_err(fbd->dev, "error %ld on backlight register\n",
325 PTR_ERR(bl));
326 return;
327 }
328
329 fbd->bl = bl;
330 bl->props.power = FB_BLANK_UNBLANK;
331 bl->props.fb_blank = FB_BLANK_UNBLANK;
332 bl->props.brightness = mx3fb_bl_get_brightness(bl);
333}
334
335static void mx3fb_exit_backlight(struct mx3fb_data *fbd)
336{
337 if (fbd->bl)
338 backlight_device_unregister(fbd->bl);
339}
340
274static void mx3fb_dma_done(void *); 341static void mx3fb_dma_done(void *);
275 342
276/* Used fb-mode and bpp. Can be set on kernel command line, therefore file-static. */ 343/* Used fb-mode and bpp. Can be set on kernel command line, therefore file-static. */
@@ -628,6 +695,16 @@ static int sdc_set_global_alpha(struct mx3fb_data *mx3fb, bool enable, uint8_t a
628 return 0; 695 return 0;
629} 696}
630 697
698static u32 sdc_get_brightness(struct mx3fb_data *mx3fb)
699{
700 u32 brightness;
701
702 brightness = mx3fb_read_reg(mx3fb, SDC_PWM_CTRL);
703 brightness = (brightness >> 16) & 0xFF;
704
705 return brightness;
706}
707
631static void sdc_set_brightness(struct mx3fb_data *mx3fb, uint8_t value) 708static void sdc_set_brightness(struct mx3fb_data *mx3fb, uint8_t value)
632{ 709{
633 dev_dbg(mx3fb->dev, "%s: value = %d\n", __func__, value); 710 dev_dbg(mx3fb->dev, "%s: value = %d\n", __func__, value);
@@ -1496,7 +1573,7 @@ static int mx3fb_probe(struct platform_device *pdev)
1496 if (!sdc_reg) 1573 if (!sdc_reg)
1497 return -EINVAL; 1574 return -EINVAL;
1498 1575
1499 mx3fb = kzalloc(sizeof(*mx3fb), GFP_KERNEL); 1576 mx3fb = devm_kzalloc(&pdev->dev, sizeof(*mx3fb), GFP_KERNEL);
1500 if (!mx3fb) 1577 if (!mx3fb)
1501 return -ENOMEM; 1578 return -ENOMEM;
1502 1579
@@ -1534,6 +1611,8 @@ static int mx3fb_probe(struct platform_device *pdev)
1534 if (ret < 0) 1611 if (ret < 0)
1535 goto eisdc0; 1612 goto eisdc0;
1536 1613
1614 mx3fb_init_backlight(mx3fb);
1615
1537 return 0; 1616 return 0;
1538 1617
1539eisdc0: 1618eisdc0:
@@ -1542,7 +1621,6 @@ ersdc0:
1542 dmaengine_put(); 1621 dmaengine_put();
1543 iounmap(mx3fb->reg_base); 1622 iounmap(mx3fb->reg_base);
1544eremap: 1623eremap:
1545 kfree(mx3fb);
1546 dev_err(dev, "mx3fb: failed to register fb\n"); 1624 dev_err(dev, "mx3fb: failed to register fb\n");
1547 return ret; 1625 return ret;
1548} 1626}
@@ -1557,11 +1635,12 @@ static int mx3fb_remove(struct platform_device *dev)
1557 chan = &mx3_fbi->idmac_channel->dma_chan; 1635 chan = &mx3_fbi->idmac_channel->dma_chan;
1558 release_fbi(fbi); 1636 release_fbi(fbi);
1559 1637
1638 mx3fb_exit_backlight(mx3fb);
1639
1560 dma_release_channel(chan); 1640 dma_release_channel(chan);
1561 dmaengine_put(); 1641 dmaengine_put();
1562 1642
1563 iounmap(mx3fb->reg_base); 1643 iounmap(mx3fb->reg_base);
1564 kfree(mx3fb);
1565 return 0; 1644 return 0;
1566} 1645}
1567 1646
diff --git a/drivers/video/fbdev/omap/Kconfig b/drivers/video/fbdev/omap/Kconfig
index 0bc3a936ce2b..18c4cb0d5690 100644
--- a/drivers/video/fbdev/omap/Kconfig
+++ b/drivers/video/fbdev/omap/Kconfig
@@ -39,6 +39,15 @@ config FB_OMAP_LCD_MIPID
39 the Mobile Industry Processor Interface DBI-C/DCS 39 the Mobile Industry Processor Interface DBI-C/DCS
40 specification. (Supported LCDs: Philips LPH8923, Sharp LS041Y3) 40 specification. (Supported LCDs: Philips LPH8923, Sharp LS041Y3)
41 41
42config FB_OMAP_LCD_H3
43 bool "TPS65010 LCD controller on OMAP-H3"
44 depends on MACH_OMAP_H3
45 depends on TPS65010
46 default y
47 help
48 Say Y here if you want to have support for the LCD on the
49 H3 board.
50
42config FB_OMAP_DMA_TUNE 51config FB_OMAP_DMA_TUNE
43 bool "Set DMA SDRAM access priority high" 52 bool "Set DMA SDRAM access priority high"
44 depends on FB_OMAP 53 depends on FB_OMAP
diff --git a/drivers/video/fbdev/omap/Makefile b/drivers/video/fbdev/omap/Makefile
index 1927faffb5bc..732e0718be53 100644
--- a/drivers/video/fbdev/omap/Makefile
+++ b/drivers/video/fbdev/omap/Makefile
@@ -10,17 +10,18 @@ objs-y$(CONFIG_FB_OMAP_LCDC_EXTERNAL) += sossi.o
10 10
11objs-y$(CONFIG_FB_OMAP_LCDC_HWA742) += hwa742.o 11objs-y$(CONFIG_FB_OMAP_LCDC_HWA742) += hwa742.o
12 12
13objs-y$(CONFIG_MACH_AMS_DELTA) += lcd_ams_delta.o 13lcds-y$(CONFIG_MACH_AMS_DELTA) += lcd_ams_delta.o
14objs-y$(CONFIG_MACH_OMAP_H3) += lcd_h3.o 14lcds-y$(CONFIG_FB_OMAP_LCD_H3) += lcd_h3.o
15objs-y$(CONFIG_MACH_OMAP_PALMTE) += lcd_palmte.o 15lcds-y$(CONFIG_MACH_OMAP_PALMTE) += lcd_palmte.o
16objs-y$(CONFIG_MACH_OMAP_PALMTT) += lcd_palmtt.o 16lcds-y$(CONFIG_MACH_OMAP_PALMTT) += lcd_palmtt.o
17objs-y$(CONFIG_MACH_OMAP_PALMZ71) += lcd_palmz71.o 17lcds-y$(CONFIG_MACH_OMAP_PALMZ71) += lcd_palmz71.o
18objs-$(CONFIG_ARCH_OMAP16XX)$(CONFIG_MACH_OMAP_INNOVATOR) += lcd_inn1610.o 18lcds-$(CONFIG_ARCH_OMAP16XX)$(CONFIG_MACH_OMAP_INNOVATOR) += lcd_inn1610.o
19objs-$(CONFIG_ARCH_OMAP15XX)$(CONFIG_MACH_OMAP_INNOVATOR) += lcd_inn1510.o 19lcds-$(CONFIG_ARCH_OMAP15XX)$(CONFIG_MACH_OMAP_INNOVATOR) += lcd_inn1510.o
20objs-y$(CONFIG_MACH_OMAP_OSK) += lcd_osk.o 20lcds-y$(CONFIG_MACH_OMAP_OSK) += lcd_osk.o
21 21
22objs-y$(CONFIG_FB_OMAP_LCD_MIPID) += lcd_mipid.o 22lcds-y$(CONFIG_FB_OMAP_LCD_MIPID) += lcd_mipid.o
23objs-y$(CONFIG_MACH_HERALD) += lcd_htcherald.o 23lcds-y$(CONFIG_MACH_HERALD) += lcd_htcherald.o
24 24
25omapfb-objs := $(objs-yy) 25omapfb-objs := $(objs-yy)
26 26
27obj-$(CONFIG_FB_OMAP) += $(lcds-yy)
diff --git a/drivers/video/fbdev/omap/lcdc.c b/drivers/video/fbdev/omap/lcdc.c
index b52f62595f65..6efa2591eaa8 100644
--- a/drivers/video/fbdev/omap/lcdc.c
+++ b/drivers/video/fbdev/omap/lcdc.c
@@ -74,7 +74,6 @@ static struct omap_lcd_controller {
74 void (*dma_callback)(void *data); 74 void (*dma_callback)(void *data);
75 void *dma_callback_data; 75 void *dma_callback_data;
76 76
77 int fbmem_allocated;
78 dma_addr_t vram_phys; 77 dma_addr_t vram_phys;
79 void *vram_virt; 78 void *vram_virt;
80 unsigned long vram_size; 79 unsigned long vram_size;
@@ -611,42 +610,6 @@ static void lcdc_dma_handler(u16 status, void *data)
611 lcdc.dma_callback(lcdc.dma_callback_data); 610 lcdc.dma_callback(lcdc.dma_callback_data);
612} 611}
613 612
614static int mmap_kern(void)
615{
616 struct vm_struct *kvma;
617 struct vm_area_struct vma;
618 pgprot_t pgprot;
619 unsigned long vaddr;
620
621 kvma = get_vm_area(lcdc.vram_size, VM_IOREMAP);
622 if (kvma == NULL) {
623 dev_err(lcdc.fbdev->dev, "can't get kernel vm area\n");
624 return -ENOMEM;
625 }
626 vma.vm_mm = &init_mm;
627
628 vaddr = (unsigned long)kvma->addr;
629 vma.vm_start = vaddr;
630 vma.vm_end = vaddr + lcdc.vram_size;
631
632 pgprot = pgprot_writecombine(pgprot_kernel);
633 if (io_remap_pfn_range(&vma, vaddr,
634 lcdc.vram_phys >> PAGE_SHIFT,
635 lcdc.vram_size, pgprot) < 0) {
636 dev_err(lcdc.fbdev->dev, "kernel mmap for FB memory failed\n");
637 return -EAGAIN;
638 }
639
640 lcdc.vram_virt = (void *)vaddr;
641
642 return 0;
643}
644
645static void unmap_kern(void)
646{
647 vunmap(lcdc.vram_virt);
648}
649
650static int alloc_palette_ram(void) 613static int alloc_palette_ram(void)
651{ 614{
652 lcdc.palette_virt = dma_alloc_writecombine(lcdc.fbdev->dev, 615 lcdc.palette_virt = dma_alloc_writecombine(lcdc.fbdev->dev,
@@ -703,8 +666,6 @@ static void free_fbmem(void)
703 666
704static int setup_fbmem(struct omapfb_mem_desc *req_md) 667static int setup_fbmem(struct omapfb_mem_desc *req_md)
705{ 668{
706 int r;
707
708 if (!req_md->region_cnt) { 669 if (!req_md->region_cnt) {
709 dev_err(lcdc.fbdev->dev, "no memory regions defined\n"); 670 dev_err(lcdc.fbdev->dev, "no memory regions defined\n");
710 return -EINVAL; 671 return -EINVAL;
@@ -715,31 +676,7 @@ static int setup_fbmem(struct omapfb_mem_desc *req_md)
715 req_md->region_cnt = 1; 676 req_md->region_cnt = 1;
716 } 677 }
717 678
718 if (req_md->region[0].paddr == 0) { 679 return alloc_fbmem(&req_md->region[0]);
719 lcdc.fbmem_allocated = 1;
720 if ((r = alloc_fbmem(&req_md->region[0])) < 0)
721 return r;
722 return 0;
723 }
724
725 lcdc.vram_phys = req_md->region[0].paddr;
726 lcdc.vram_size = req_md->region[0].size;
727
728 if ((r = mmap_kern()) < 0)
729 return r;
730
731 dev_dbg(lcdc.fbdev->dev, "vram at %08x size %08lx mapped to 0x%p\n",
732 lcdc.vram_phys, lcdc.vram_size, lcdc.vram_virt);
733
734 return 0;
735}
736
737static void cleanup_fbmem(void)
738{
739 if (lcdc.fbmem_allocated)
740 free_fbmem();
741 else
742 unmap_kern();
743} 680}
744 681
745static int omap_lcdc_init(struct omapfb_device *fbdev, int ext_mode, 682static int omap_lcdc_init(struct omapfb_device *fbdev, int ext_mode,
@@ -833,7 +770,7 @@ static void omap_lcdc_cleanup(void)
833{ 770{
834 if (!lcdc.ext_mode) 771 if (!lcdc.ext_mode)
835 free_palette_ram(); 772 free_palette_ram();
836 cleanup_fbmem(); 773 free_fbmem();
837 omap_free_lcd_dma(); 774 omap_free_lcd_dma();
838 free_irq(OMAP_LCDC_IRQ, lcdc.fbdev); 775 free_irq(OMAP_LCDC_IRQ, lcdc.fbdev);
839 clk_disable(lcdc.lcd_ck); 776 clk_disable(lcdc.lcd_ck);
diff --git a/drivers/video/fbdev/omap/omapfb_main.c b/drivers/video/fbdev/omap/omapfb_main.c
index e4fc6d9b5371..d8d028d98711 100644
--- a/drivers/video/fbdev/omap/omapfb_main.c
+++ b/drivers/video/fbdev/omap/omapfb_main.c
@@ -1823,6 +1823,7 @@ void omapfb_register_panel(struct lcd_panel *panel)
1823 if (fbdev_pdev != NULL) 1823 if (fbdev_pdev != NULL)
1824 omapfb_do_probe(fbdev_pdev, fbdev_panel); 1824 omapfb_do_probe(fbdev_pdev, fbdev_panel);
1825} 1825}
1826EXPORT_SYMBOL_GPL(omapfb_register_panel);
1826 1827
1827/* Called when the device is being detached from the driver */ 1828/* Called when the device is being detached from the driver */
1828static int omapfb_remove(struct platform_device *pdev) 1829static int omapfb_remove(struct platform_device *pdev)
diff --git a/drivers/video/fbdev/pxa3xx-gcu.c b/drivers/video/fbdev/pxa3xx-gcu.c
index 417f9a27eb7d..4df3657fe221 100644
--- a/drivers/video/fbdev/pxa3xx-gcu.c
+++ b/drivers/video/fbdev/pxa3xx-gcu.c
@@ -612,11 +612,9 @@ static int pxa3xx_gcu_probe(struct platform_device *pdev)
612 612
613 /* handle IO resources */ 613 /* handle IO resources */
614 r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 614 r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
615 priv->mmio_base = devm_request_and_ioremap(dev, r); 615 priv->mmio_base = devm_ioremap_resource(dev, r);
616 if (IS_ERR(priv->mmio_base)) { 616 if (IS_ERR(priv->mmio_base))
617 dev_err(dev, "failed to map I/O memory\n");
618 return PTR_ERR(priv->mmio_base); 617 return PTR_ERR(priv->mmio_base);
619 }
620 618
621 /* enable the clock */ 619 /* enable the clock */
622 priv->clk = devm_clk_get(dev, NULL); 620 priv->clk = devm_clk_get(dev, NULL);
diff --git a/drivers/video/fbdev/s3fb.c b/drivers/video/fbdev/s3fb.c
index 9a3f8f1c6aab..c43b969e1e23 100644
--- a/drivers/video/fbdev/s3fb.c
+++ b/drivers/video/fbdev/s3fb.c
@@ -1401,9 +1401,10 @@ err_enable_device:
1401static void s3_pci_remove(struct pci_dev *dev) 1401static void s3_pci_remove(struct pci_dev *dev)
1402{ 1402{
1403 struct fb_info *info = pci_get_drvdata(dev); 1403 struct fb_info *info = pci_get_drvdata(dev);
1404 struct s3fb_info __maybe_unused *par = info->par; 1404 struct s3fb_info __maybe_unused *par;
1405 1405
1406 if (info) { 1406 if (info) {
1407 par = info->par;
1407 1408
1408#ifdef CONFIG_MTRR 1409#ifdef CONFIG_MTRR
1409 if (par->mtrr_reg >= 0) { 1410 if (par->mtrr_reg >= 0) {
diff --git a/drivers/video/fbdev/wm8505fb.c b/drivers/video/fbdev/wm8505fb.c
index 537d199612af..d2fafbbcd7f8 100644
--- a/drivers/video/fbdev/wm8505fb.c
+++ b/drivers/video/fbdev/wm8505fb.c
@@ -162,7 +162,7 @@ static ssize_t contrast_show(struct device *dev,
162 struct fb_info *info = dev_get_drvdata(dev); 162 struct fb_info *info = dev_get_drvdata(dev);
163 struct wm8505fb_info *fbi = to_wm8505fb_info(info); 163 struct wm8505fb_info *fbi = to_wm8505fb_info(info);
164 164
165 return sprintf(buf, "%d\n", fbi->contrast); 165 return sprintf(buf, "%u\n", fbi->contrast);
166} 166}
167 167
168static ssize_t contrast_store(struct device *dev, 168static ssize_t contrast_store(struct device *dev,
diff --git a/drivers/video/of_display_timing.c b/drivers/video/of_display_timing.c
index ba5b40f581f6..987edf110038 100644
--- a/drivers/video/of_display_timing.c
+++ b/drivers/video/of_display_timing.c
@@ -115,10 +115,8 @@ int of_get_display_timing(struct device_node *np, const char *name,
115{ 115{
116 struct device_node *timing_np; 116 struct device_node *timing_np;
117 117
118 if (!np) { 118 if (!np)
119 pr_err("%s: no devicenode given\n", of_node_full_name(np));
120 return -EINVAL; 119 return -EINVAL;
121 }
122 120
123 timing_np = of_get_child_by_name(np, name); 121 timing_np = of_get_child_by_name(np, name);
124 if (!timing_np) { 122 if (!timing_np) {
@@ -142,10 +140,8 @@ struct display_timings *of_get_display_timings(struct device_node *np)
142 struct device_node *native_mode; 140 struct device_node *native_mode;
143 struct display_timings *disp; 141 struct display_timings *disp;
144 142
145 if (!np) { 143 if (!np)
146 pr_err("%s: no device node given\n", of_node_full_name(np));
147 return NULL; 144 return NULL;
148 }
149 145
150 timings_np = of_get_child_by_name(np, "display-timings"); 146 timings_np = of_get_child_by_name(np, "display-timings");
151 if (!timings_np) { 147 if (!timings_np) {
@@ -164,7 +160,7 @@ struct display_timings *of_get_display_timings(struct device_node *np)
164 entry = of_parse_phandle(timings_np, "native-mode", 0); 160 entry = of_parse_phandle(timings_np, "native-mode", 0);
165 /* assume first child as native mode if none provided */ 161 /* assume first child as native mode if none provided */
166 if (!entry) 162 if (!entry)
167 entry = of_get_next_child(np, NULL); 163 entry = of_get_next_child(timings_np, NULL);
168 /* if there is no child, it is useless to go on */ 164 /* if there is no child, it is useless to go on */
169 if (!entry) { 165 if (!entry) {
170 pr_err("%s: no timing specifications given\n", 166 pr_err("%s: no timing specifications given\n",