From 5c888aa43ee9872efe2a09e8c9f03db84f60dd28 Mon Sep 17 00:00:00 2001 From: Emil Goode Date: Tue, 29 May 2012 18:57:00 +0200 Subject: video: bfin_adv7393fb: Convert to kstrtouint_from_user This patch removes a call to the deprecated simple_strtoul function and simplifies the code by replacing two function calls with one call to kstrtouint_from_user. -Simplify the adv7393_write_proc function by replacing the simple_strtoul and copy_from_user calls with one call to kstrtouint_from_user. -Change the count parameter from unsigned long to size_t as this is the type that the kstrtouint_from_user function expects. (size_t is what will be passed to the adv7393_write_proc function by the proc write handler function proc_file_write anyway) Signed-off-by: Emil Goode Signed-off-by: Florian Tobias Schandinat --- drivers/video/bfin_adv7393fb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/bfin_adv7393fb.c b/drivers/video/bfin_adv7393fb.c index 33ea874c87d..9bdd4b0c18c 100644 --- a/drivers/video/bfin_adv7393fb.c +++ b/drivers/video/bfin_adv7393fb.c @@ -353,18 +353,16 @@ adv7393_read_proc(char *page, char **start, off_t off, static int adv7393_write_proc(struct file *file, const char __user * buffer, - unsigned long count, void *data) + size_t count, void *data) { struct adv7393fb_device *fbdev = data; - char line[8]; unsigned int val; int ret; - ret = copy_from_user(line, buffer, count); + ret = kstrtouint_from_user(buffer, count, 0, &val); if (ret) return -EFAULT; - val = simple_strtoul(line, NULL, 0); adv7393_write(fbdev->client, val >> 8, val & 0xff); return count; -- cgit v1.2.3 From 6f32d03bc63ab27f5e21d40c4ec81e18d991f424 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Tue, 15 May 2012 15:02:57 -0600 Subject: drivers/video: use correct __devexit_p annotation __devexit functions are discarded when CONFIG_HOTPLUG is not set, so the symbol needs to be referenced carefully. Signed-off-by: Arnd Bergmann Signed-off-by: Mathieu Poirier Signed-off-by: Florian Tobias Schandinat --- drivers/video/broadsheetfb.c | 2 +- drivers/video/mbx/mbxfb.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/broadsheetfb.c b/drivers/video/broadsheetfb.c index 377dde3d5bf..c95b417d0d4 100644 --- a/drivers/video/broadsheetfb.c +++ b/drivers/video/broadsheetfb.c @@ -1211,7 +1211,7 @@ static int __devexit broadsheetfb_remove(struct platform_device *dev) static struct platform_driver broadsheetfb_driver = { .probe = broadsheetfb_probe, - .remove = broadsheetfb_remove, + .remove = __devexit_p(broadsheetfb_remove), .driver = { .owner = THIS_MODULE, .name = "broadsheetfb", diff --git a/drivers/video/mbx/mbxfb.c b/drivers/video/mbx/mbxfb.c index ab0a8e52733..85e4f44bfa6 100644 --- a/drivers/video/mbx/mbxfb.c +++ b/drivers/video/mbx/mbxfb.c @@ -1045,7 +1045,7 @@ static int __devexit mbxfb_remove(struct platform_device *dev) static struct platform_driver mbxfb_driver = { .probe = mbxfb_probe, - .remove = mbxfb_remove, + .remove = __devexit_p(mbxfb_remove), .suspend = mbxfb_suspend, .resume = mbxfb_resume, .driver = { -- cgit v1.2.3 From ff9440465c82099ba3365930a97f90b3acfcc980 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Tue, 15 May 2012 15:02:58 -0600 Subject: video/ili9320: do not mark exported functions __devexit No symbol can be exported when the section is discarded - the only solution I could think of is not to mark symbols as __devexit when they are exported. Signed-off-by: Arnd Bergmann Signed-off-by: Mathieu Poirier Signed-off-by: Florian Tobias Schandinat --- drivers/video/backlight/ili9320.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/backlight/ili9320.c b/drivers/video/backlight/ili9320.c index 5118a9f029a..b67485a595a 100644 --- a/drivers/video/backlight/ili9320.c +++ b/drivers/video/backlight/ili9320.c @@ -267,7 +267,7 @@ int __devinit ili9320_probe_spi(struct spi_device *spi, EXPORT_SYMBOL_GPL(ili9320_probe_spi); -int __devexit ili9320_remove(struct ili9320 *ili) +int ili9320_remove(struct ili9320 *ili) { ili9320_power(ili, FB_BLANK_POWERDOWN); -- cgit v1.2.3 From d399099cbba92b247ac323a99ac4c5fa5b0ca68d Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Tue, 15 May 2012 15:02:59 -0600 Subject: video/console: automatically select a font The frame buffer console needs at least one font to be built into the kernel, so add the necessary Kconfig magic to guarantee that one of the available font is always on. If a user accidentally disables all fonts manually, the 8x16 font will be selected anyway. Signed-off-by: Arnd Bergmann Signed-off-by: Mathieu Poirier Signed-off-by: Florian Tobias Schandinat --- drivers/video/console/Kconfig | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig index c2d11fef114..e2c96d01d8f 100644 --- a/drivers/video/console/Kconfig +++ b/drivers/video/console/Kconfig @@ -224,5 +224,19 @@ config FONT_10x18 big letters. It fits between the sun 12x22 and the normal 8x16 font. If other fonts are too big or too small for you, say Y, otherwise say N. +config FONT_AUTOSELECT + def_bool y + depends on FRAMEBUFFER_CONSOLE || SGI_NEWPORT_CONSOLE || STI_CONSOLE || USB_SISUSBVGA_CON + depends on !FONT_8x8 + depends on !FONT_6x11 + depends on !FONT_7x14 + depends on !FONT_PEARL_8x8 + depends on !FONT_ACORN_8x8 + depends on !FONT_MINI_4x6 + depends on !FONT_SUN8x16 + depends on !FONT_SUN12x22 + depends on !FONT_10x18 + select FONT_8x16 + endmenu -- cgit v1.2.3 From f5c3ac242d05c07f646824aba25a541af7464c82 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Tue, 15 May 2012 15:03:00 -0600 Subject: drivers/savagefb: use mdelay instead of udelay Long delays need to use mdelay on architectures such as ARM that cannot compute long timeouts in udelay. Signed-off-by: Arnd Bergmann Signed-off-by: Mathieu Poirier Signed-off-by: Florian Tobias Schandinat --- drivers/video/savage/savagefb_driver.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c index cee7803a0a1..f3d3b9ce475 100644 --- a/drivers/video/savage/savagefb_driver.c +++ b/drivers/video/savage/savagefb_driver.c @@ -1351,7 +1351,7 @@ static void savagefb_set_par_int(struct savagefb_par *par, struct savage_reg *r /* following part not present in X11 driver */ cr67 = vga_in8(0x3d5, par) & 0xf; vga_out8(0x3d5, 0x50 | cr67, par); - udelay(10000); + mdelay(10); vga_out8(0x3d4, 0x67, par); /* end of part */ vga_out8(0x3d5, reg->CR67 & ~0x0c, par); @@ -1904,11 +1904,11 @@ static int savage_init_hw(struct savagefb_par *par) vga_out8(0x3d4, 0x66, par); cr66 = vga_in8(0x3d5, par); vga_out8(0x3d5, cr66 | 0x02, par); - udelay(10000); + mdelay(10); vga_out8(0x3d4, 0x66, par); vga_out8(0x3d5, cr66 & ~0x02, par); /* clear reset flag */ - udelay(10000); + mdelay(10); /* @@ -1918,11 +1918,11 @@ static int savage_init_hw(struct savagefb_par *par) vga_out8(0x3d4, 0x3f, par); cr3f = vga_in8(0x3d5, par); vga_out8(0x3d5, cr3f | 0x08, par); - udelay(10000); + mdelay(10); vga_out8(0x3d4, 0x3f, par); vga_out8(0x3d5, cr3f & ~0x08, par); /* clear reset flags */ - udelay(10000); + mdelay(10); /* Savage ramdac speeds */ par->numClocks = 4; -- cgit v1.2.3 From 5fc05780b84d5227e6c15986f1bde488e52752bd Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Tue, 15 May 2012 15:03:01 -0600 Subject: drivers/tosa: driver needs I2C and SPI to compile This driver requires both SPI and I2C to build. Signed-off-by: Arnd Bergmann Signed-off-by: Mathieu Poirier Signed-off-by: Florian Tobias Schandinat --- drivers/video/backlight/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig index af16884491e..d7487d23f58 100644 --- a/drivers/video/backlight/Kconfig +++ b/drivers/video/backlight/Kconfig @@ -88,7 +88,7 @@ config LCD_PLATFORM config LCD_TOSA tristate "Sharp SL-6000 LCD Driver" - depends on SPI && MACH_TOSA + depends on I2C && SPI && MACH_TOSA help If you have an Sharp SL-6000 Zaurus say Y to enable a driver for its LCD. -- cgit v1.2.3 From ecd57ae28eb34e2b34fac1c5b74bb876efa665c0 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Mon, 11 Jun 2012 11:26:41 +0900 Subject: video: s3c-fb: clear SHADOWCON register when clearing hardware window registers All bits of SHADOWCON register should be cleared when clearing hardware window registers; however, some bits of SHADOWCON register are not cleared previously. Signed-off-by: Jingoo Han Signed-off-by: Florian Tobias Schandinat --- drivers/video/s3c-fb.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c index 5f9d8e69029..b5c29399a5e 100644 --- a/drivers/video/s3c-fb.c +++ b/drivers/video/s3c-fb.c @@ -1348,8 +1348,14 @@ static void s3c_fb_clear_win(struct s3c_fb *sfb, int win) writel(0, regs + VIDOSD_A(win, sfb->variant)); writel(0, regs + VIDOSD_B(win, sfb->variant)); writel(0, regs + VIDOSD_C(win, sfb->variant)); - reg = readl(regs + SHADOWCON); - writel(reg & ~SHADOWCON_WINx_PROTECT(win), regs + SHADOWCON); + + if (sfb->variant.has_shadowcon) { + reg = readl(sfb->regs + SHADOWCON); + reg &= ~(SHADOWCON_WINx_PROTECT(win) | + SHADOWCON_CHx_ENABLE(win) | + SHADOWCON_CHx_LOCAL_ENABLE(win)); + writel(reg, sfb->regs + SHADOWCON); + } } static int __devinit s3c_fb_probe(struct platform_device *pdev) -- cgit v1.2.3 From b67989515defba7412acff01162e5bb1f0f5923a Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Mon, 11 Jun 2012 11:27:27 +0900 Subject: video: s3c-fb: fix possible division by zero in s3c_fb_calc_pixclk Divider value can be zero and it makes division by zero from debug message in s3c_fb_calc_pixclk; therefore, it should be fixed. Signed-off-by: Jingoo Han Signed-off-by: Florian Tobias Schandinat --- drivers/video/s3c-fb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c index b5c29399a5e..ea7b661e722 100644 --- a/drivers/video/s3c-fb.c +++ b/drivers/video/s3c-fb.c @@ -361,7 +361,7 @@ static int s3c_fb_calc_pixclk(struct s3c_fb *sfb, unsigned int pixclk) result = (unsigned int)tmp / 1000; dev_dbg(sfb->dev, "pixclk=%u, clk=%lu, div=%d (%lu)\n", - pixclk, clk, result, clk / result); + pixclk, clk, result, result ? clk / result : clk); return result; } -- cgit v1.2.3