diff options
Diffstat (limited to 'drivers/video')
37 files changed, 181 insertions, 484 deletions
diff --git a/drivers/video/amba-clcd.c b/drivers/video/amba-clcd.c index 2cda6ba0939..0a2cce7285b 100644 --- a/drivers/video/amba-clcd.c +++ b/drivers/video/amba-clcd.c @@ -621,6 +621,8 @@ static struct amba_id clcdfb_id_table[] = { { 0, 0 }, }; +MODULE_DEVICE_TABLE(amba, clcdfb_id_table); + static struct amba_driver clcd_driver = { .drv = { .name = "clcd-pl11x", diff --git a/drivers/video/backlight/88pm860x_bl.c b/drivers/video/backlight/88pm860x_bl.c index 1105fa1ed7f..a1376dc73d7 100644 --- a/drivers/video/backlight/88pm860x_bl.c +++ b/drivers/video/backlight/88pm860x_bl.c @@ -270,17 +270,7 @@ static struct platform_driver pm860x_backlight_driver = { .remove = pm860x_backlight_remove, }; -static int __init pm860x_backlight_init(void) -{ - return platform_driver_register(&pm860x_backlight_driver); -} -module_init(pm860x_backlight_init); - -static void __exit pm860x_backlight_exit(void) -{ - platform_driver_unregister(&pm860x_backlight_driver); -} -module_exit(pm860x_backlight_exit); +module_platform_driver(pm860x_backlight_driver); MODULE_DESCRIPTION("Backlight Driver for Marvell Semiconductor 88PM8606"); MODULE_AUTHOR("Haojian Zhuang <haojian.zhuang@marvell.com>"); diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig index 278aeaa9250..681b36929fe 100644 --- a/drivers/video/backlight/Kconfig +++ b/drivers/video/backlight/Kconfig @@ -280,14 +280,6 @@ config BACKLIGHT_WM831X If you have a backlight driven by the ISINK and DCDC of a WM831x PMIC say y to enable the backlight driver for it. -config BACKLIGHT_ADX - tristate "Avionic Design Xanthos Backlight Driver" - depends on ARCH_PXA_ADX - default y - help - Say Y to enable the backlight driver on Avionic Design Xanthos-based - boards. - config BACKLIGHT_ADP5520 tristate "Backlight Driver for ADP5520/ADP5501 using WLED" depends on PMIC_ADP5520 diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile index fdd1fc4b277..af5cf654ec7 100644 --- a/drivers/video/backlight/Makefile +++ b/drivers/video/backlight/Makefile @@ -32,7 +32,6 @@ obj-$(CONFIG_BACKLIGHT_APPLE) += apple_bl.o obj-$(CONFIG_BACKLIGHT_TOSA) += tosa_bl.o obj-$(CONFIG_BACKLIGHT_SAHARA) += kb3886_bl.o obj-$(CONFIG_BACKLIGHT_WM831X) += wm831x_bl.o -obj-$(CONFIG_BACKLIGHT_ADX) += adx_bl.o obj-$(CONFIG_BACKLIGHT_ADP5520) += adp5520_bl.o obj-$(CONFIG_BACKLIGHT_ADP8860) += adp8860_bl.o obj-$(CONFIG_BACKLIGHT_ADP8870) += adp8870_bl.o diff --git a/drivers/video/backlight/adp5520_bl.c b/drivers/video/backlight/adp5520_bl.c index dfb763e9147..2e630bf1164 100644 --- a/drivers/video/backlight/adp5520_bl.c +++ b/drivers/video/backlight/adp5520_bl.c @@ -384,17 +384,7 @@ static struct platform_driver adp5520_bl_driver = { .resume = adp5520_bl_resume, }; -static int __init adp5520_bl_init(void) -{ - return platform_driver_register(&adp5520_bl_driver); -} -module_init(adp5520_bl_init); - -static void __exit adp5520_bl_exit(void) -{ - platform_driver_unregister(&adp5520_bl_driver); -} -module_exit(adp5520_bl_exit); +module_platform_driver(adp5520_bl_driver); MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); MODULE_DESCRIPTION("ADP5520(01) Backlight Driver"); diff --git a/drivers/video/backlight/adx_bl.c b/drivers/video/backlight/adx_bl.c deleted file mode 100644 index c861c41af44..00000000000 --- a/drivers/video/backlight/adx_bl.c +++ /dev/null @@ -1,182 +0,0 @@ -/* - * linux/drivers/video/backlight/adx.c - * - * Copyright (C) 2009 Avionic Design GmbH - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * Written by Thierry Reding <thierry.reding@avionic-design.de> - */ - -#include <linux/backlight.h> -#include <linux/fb.h> -#include <linux/gfp.h> -#include <linux/io.h> -#include <linux/module.h> -#include <linux/platform_device.h> - -/* register definitions */ -#define ADX_BACKLIGHT_CONTROL 0x00 -#define ADX_BACKLIGHT_CONTROL_ENABLE (1 << 0) -#define ADX_BACKLIGHT_BRIGHTNESS 0x08 -#define ADX_BACKLIGHT_STATUS 0x10 -#define ADX_BACKLIGHT_ERROR 0x18 - -struct adxbl { - void __iomem *base; -}; - -static int adx_backlight_update_status(struct backlight_device *bldev) -{ - struct adxbl *bl = bl_get_data(bldev); - u32 value; - - value = bldev->props.brightness; - writel(value, bl->base + ADX_BACKLIGHT_BRIGHTNESS); - - value = readl(bl->base + ADX_BACKLIGHT_CONTROL); - - if (bldev->props.state & BL_CORE_FBBLANK) - value &= ~ADX_BACKLIGHT_CONTROL_ENABLE; - else - value |= ADX_BACKLIGHT_CONTROL_ENABLE; - - writel(value, bl->base + ADX_BACKLIGHT_CONTROL); - - return 0; -} - -static int adx_backlight_get_brightness(struct backlight_device *bldev) -{ - struct adxbl *bl = bl_get_data(bldev); - u32 brightness; - - brightness = readl(bl->base + ADX_BACKLIGHT_BRIGHTNESS); - return brightness & 0xff; -} - -static int adx_backlight_check_fb(struct backlight_device *bldev, struct fb_info *fb) -{ - return 1; -} - -static const struct backlight_ops adx_backlight_ops = { - .options = 0, - .update_status = adx_backlight_update_status, - .get_brightness = adx_backlight_get_brightness, - .check_fb = adx_backlight_check_fb, -}; - -static int __devinit adx_backlight_probe(struct platform_device *pdev) -{ - struct backlight_properties props; - struct backlight_device *bldev; - struct resource *res; - struct adxbl *bl; - int ret = 0; - - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - ret = -ENXIO; - goto out; - } - - res = devm_request_mem_region(&pdev->dev, res->start, - resource_size(res), res->name); - if (!res) { - ret = -ENXIO; - goto out; - } - - bl = devm_kzalloc(&pdev->dev, sizeof(*bl), GFP_KERNEL); - if (!bl) { - ret = -ENOMEM; - goto out; - } - - bl->base = devm_ioremap_nocache(&pdev->dev, res->start, - resource_size(res)); - if (!bl->base) { - ret = -ENXIO; - goto out; - } - - memset(&props, 0, sizeof(struct backlight_properties)); - props.type = BACKLIGHT_RAW; - props.max_brightness = 0xff; - bldev = backlight_device_register(dev_name(&pdev->dev), &pdev->dev, - bl, &adx_backlight_ops, &props); - if (IS_ERR(bldev)) { - ret = PTR_ERR(bldev); - goto out; - } - - bldev->props.brightness = 0xff; - bldev->props.power = FB_BLANK_UNBLANK; - - platform_set_drvdata(pdev, bldev); - -out: - return ret; -} - -static int __devexit adx_backlight_remove(struct platform_device *pdev) -{ - struct backlight_device *bldev; - int ret = 0; - - bldev = platform_get_drvdata(pdev); - bldev->props.power = FB_BLANK_UNBLANK; - bldev->props.brightness = 0xff; - backlight_update_status(bldev); - backlight_device_unregister(bldev); - platform_set_drvdata(pdev, NULL); - - return ret; -} - -#ifdef CONFIG_PM -static int adx_backlight_suspend(struct platform_device *pdev, - pm_message_t state) -{ - return 0; -} - -static int adx_backlight_resume(struct platform_device *pdev) -{ - return 0; -} -#else -#define adx_backlight_suspend NULL -#define adx_backlight_resume NULL -#endif - -static struct platform_driver adx_backlight_driver = { - .probe = adx_backlight_probe, - .remove = __devexit_p(adx_backlight_remove), - .suspend = adx_backlight_suspend, - .resume = adx_backlight_resume, - .driver = { - .name = "adx-backlight", - .owner = THIS_MODULE, - }, -}; - -static int __init adx_backlight_init(void) -{ - return platform_driver_register(&adx_backlight_driver); -} - -static void __exit adx_backlight_exit(void) -{ - platform_driver_unregister(&adx_backlight_driver); -} - -module_init(adx_backlight_init); -module_exit(adx_backlight_exit); - -MODULE_AUTHOR("Thierry Reding <thierry.reding@avionic-design.de>"); -MODULE_DESCRIPTION("Avionic Design Xanthos Backlight Driver"); -MODULE_LICENSE("GPL v2"); diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c index 7363c1b169e..bf5b1ece716 100644 --- a/drivers/video/backlight/backlight.c +++ b/drivers/video/backlight/backlight.c @@ -102,7 +102,7 @@ static void backlight_generate_event(struct backlight_device *bd, } static ssize_t backlight_show_power(struct device *dev, - struct device_attribute *attr,char *buf) + struct device_attribute *attr, char *buf) { struct backlight_device *bd = to_backlight_device(dev); @@ -116,7 +116,7 @@ static ssize_t backlight_store_power(struct device *dev, struct backlight_device *bd = to_backlight_device(dev); unsigned long power; - rc = strict_strtoul(buf, 0, &power); + rc = kstrtoul(buf, 0, &power); if (rc) return rc; @@ -150,7 +150,7 @@ static ssize_t backlight_store_brightness(struct device *dev, struct backlight_device *bd = to_backlight_device(dev); unsigned long brightness; - rc = strict_strtoul(buf, 0, &brightness); + rc = kstrtoul(buf, 0, &brightness); if (rc) return rc; diff --git a/drivers/video/backlight/da903x_bl.c b/drivers/video/backlight/da903x_bl.c index d68f14bbb68..abb4a06268f 100644 --- a/drivers/video/backlight/da903x_bl.c +++ b/drivers/video/backlight/da903x_bl.c @@ -199,17 +199,7 @@ static struct platform_driver da903x_backlight_driver = { .remove = da903x_backlight_remove, }; -static int __init da903x_backlight_init(void) -{ - return platform_driver_register(&da903x_backlight_driver); -} -module_init(da903x_backlight_init); - -static void __exit da903x_backlight_exit(void) -{ - platform_driver_unregister(&da903x_backlight_driver); -} -module_exit(da903x_backlight_exit); +module_platform_driver(da903x_backlight_driver); MODULE_DESCRIPTION("Backlight Driver for Dialog Semiconductor DA9030/DA9034"); MODULE_AUTHOR("Eric Miao <eric.miao@marvell.com>" diff --git a/drivers/video/backlight/ep93xx_bl.c b/drivers/video/backlight/ep93xx_bl.c index c74a6f4baa1..b62b8b9063b 100644 --- a/drivers/video/backlight/ep93xx_bl.c +++ b/drivers/video/backlight/ep93xx_bl.c @@ -13,7 +13,6 @@ #include <linux/module.h> #include <linux/platform_device.h> -#include <linux/module.h> #include <linux/io.h> #include <linux/fb.h> #include <linux/backlight.h> @@ -144,17 +143,7 @@ static struct platform_driver ep93xxbl_driver = { .resume = ep93xxbl_resume, }; -static int __init ep93xxbl_init(void) -{ - return platform_driver_register(&ep93xxbl_driver); -} -module_init(ep93xxbl_init); - -static void __exit ep93xxbl_exit(void) -{ - platform_driver_unregister(&ep93xxbl_driver); -} -module_exit(ep93xxbl_exit); +module_platform_driver(ep93xxbl_driver); MODULE_DESCRIPTION("EP93xx Backlight Driver"); MODULE_AUTHOR("H Hartley Sweeten <hsweeten@visionengravers.com>"); diff --git a/drivers/video/backlight/generic_bl.c b/drivers/video/backlight/generic_bl.c index adb191466d6..9ce6170c186 100644 --- a/drivers/video/backlight/generic_bl.c +++ b/drivers/video/backlight/generic_bl.c @@ -132,18 +132,7 @@ static struct platform_driver genericbl_driver = { }, }; -static int __init genericbl_init(void) -{ - return platform_driver_register(&genericbl_driver); -} - -static void __exit genericbl_exit(void) -{ - platform_driver_unregister(&genericbl_driver); -} - -module_init(genericbl_init); -module_exit(genericbl_exit); +module_platform_driver(genericbl_driver); MODULE_AUTHOR("Richard Purdie <rpurdie@rpsys.net>"); MODULE_DESCRIPTION("Generic Backlight Driver"); diff --git a/drivers/video/backlight/jornada720_bl.c b/drivers/video/backlight/jornada720_bl.c index de65d80159b..2f8af5d786a 100644 --- a/drivers/video/backlight/jornada720_bl.c +++ b/drivers/video/backlight/jornada720_bl.c @@ -147,19 +147,8 @@ static struct platform_driver jornada_bl_driver = { }, }; -static int __init jornada_bl_init(void) -{ - return platform_driver_register(&jornada_bl_driver); -} - -static void __exit jornada_bl_exit(void) -{ - platform_driver_unregister(&jornada_bl_driver); -} +module_platform_driver(jornada_bl_driver); MODULE_AUTHOR("Kristoffer Ericson <kristoffer.ericson>"); MODULE_DESCRIPTION("HP Jornada 710/720/728 Backlight driver"); MODULE_LICENSE("GPL"); - -module_init(jornada_bl_init); -module_exit(jornada_bl_exit); diff --git a/drivers/video/backlight/jornada720_lcd.c b/drivers/video/backlight/jornada720_lcd.c index d2ff658b414..22d231a17e3 100644 --- a/drivers/video/backlight/jornada720_lcd.c +++ b/drivers/video/backlight/jornada720_lcd.c @@ -135,19 +135,8 @@ static struct platform_driver jornada_lcd_driver = { }, }; -static int __init jornada_lcd_init(void) -{ - return platform_driver_register(&jornada_lcd_driver); -} - -static void __exit jornada_lcd_exit(void) -{ - platform_driver_unregister(&jornada_lcd_driver); -} +module_platform_driver(jornada_lcd_driver); MODULE_AUTHOR("Kristoffer Ericson <kristoffer.ericson@gmail.com>"); MODULE_DESCRIPTION("HP Jornada 710/720/728 LCD driver"); MODULE_LICENSE("GPL"); - -module_init(jornada_lcd_init); -module_exit(jornada_lcd_exit); diff --git a/drivers/video/backlight/lcd.c b/drivers/video/backlight/lcd.c index 71a11cadffc..79c1b0d609a 100644 --- a/drivers/video/backlight/lcd.c +++ b/drivers/video/backlight/lcd.c @@ -97,19 +97,16 @@ static ssize_t lcd_store_power(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { int rc = -ENXIO; - char *endp; struct lcd_device *ld = to_lcd_device(dev); - int power = simple_strtoul(buf, &endp, 0); - size_t size = endp - buf; + unsigned long power; - if (isspace(*endp)) - size++; - if (size != count) - return -EINVAL; + rc = kstrtoul(buf, 0, &power); + if (rc) + return rc; mutex_lock(&ld->ops_lock); if (ld->ops && ld->ops->set_power) { - pr_debug("lcd: set power to %d\n", power); + pr_debug("lcd: set power to %lu\n", power); ld->ops->set_power(ld, power); rc = count; } @@ -136,19 +133,16 @@ static ssize_t lcd_store_contrast(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { int rc = -ENXIO; - char *endp; struct lcd_device *ld = to_lcd_device(dev); - int contrast = simple_strtoul(buf, &endp, 0); - size_t size = endp - buf; + unsigned long contrast; - if (isspace(*endp)) - size++; - if (size != count) - return -EINVAL; + rc = kstrtoul(buf, 0, &contrast); + if (rc) + return rc; mutex_lock(&ld->ops_lock); if (ld->ops && ld->ops->set_contrast) { - pr_debug("lcd: set contrast to %d\n", contrast); + pr_debug("lcd: set contrast to %lu\n", contrast); ld->ops->set_contrast(ld, contrast); rc = count; } diff --git a/drivers/video/backlight/ld9040.c b/drivers/video/backlight/ld9040.c index da9a5ce0ccb..78dafc0c8fc 100644 --- a/drivers/video/backlight/ld9040.c +++ b/drivers/video/backlight/ld9040.c @@ -31,6 +31,7 @@ #include <linux/lcd.h> #include <linux/backlight.h> #include <linux/module.h> +#include <linux/regulator/consumer.h> #include "ld9040_gamma.h" @@ -53,8 +54,51 @@ struct ld9040 { struct lcd_device *ld; struct backlight_device *bd; struct lcd_platform_data *lcd_pd; + + struct mutex lock; + bool enabled; +}; + +static struct regulator_bulk_data supplies[] = { + { .supply = "vdd3", }, + { .supply = "vci", }, }; +static void ld9040_regulator_enable(struct ld9040 *lcd) +{ + int ret = 0; + struct lcd_platform_data *pd = NULL; + + pd = lcd->lcd_pd; + mutex_lock(&lcd->lock); + if (!lcd->enabled) { + ret = regulator_bulk_enable(ARRAY_SIZE(supplies), supplies); + if (ret) + goto out; + + lcd->enabled = true; + } + mdelay(pd->power_on_delay); +out: + mutex_unlock(&lcd->lock); +} + +static void ld9040_regulator_disable(struct ld9040 *lcd) +{ + int ret = 0; + + mutex_lock(&lcd->lock); + if (lcd->enabled) { + ret = regulator_bulk_disable(ARRAY_SIZE(supplies), supplies); + if (ret) + goto out; + + lcd->enabled = false; + } +out: + mutex_unlock(&lcd->lock); +} + static const unsigned short seq_swreset[] = { 0x01, COMMAND_ONLY, ENDDEF, 0x00 @@ -532,13 +576,8 @@ static int ld9040_power_on(struct ld9040 *lcd) return -EFAULT; } - if (!pd->power_on) { - dev_err(lcd->dev, "power_on is NULL.\n"); - return -EFAULT; - } else { - pd->power_on(lcd->ld, 1); - mdelay(pd->power_on_delay); - } + /* lcd power on */ + ld9040_regulator_enable(lcd); if (!pd->reset) { dev_err(lcd->dev, "reset is NULL.\n"); @@ -582,11 +621,8 @@ static int ld9040_power_off(struct ld9040 *lcd) mdelay(pd->power_off_delay); - if (!pd->power_on) { - dev_err(lcd->dev, "power_on is NULL.\n"); - return -EFAULT; - } else - pd->power_on(lcd->ld, 0); + /* lcd power off */ + ld9040_regulator_disable(lcd); return 0; } @@ -693,6 +729,14 @@ static int ld9040_probe(struct spi_device *spi) goto out_free_lcd; } + mutex_init(&lcd->lock); + + ret = regulator_bulk_get(lcd->dev, ARRAY_SIZE(supplies), supplies); + if (ret) { + dev_err(lcd->dev, "Failed to get regulators: %d\n", ret); + goto out_free_lcd; + } + ld = lcd_device_register("ld9040", &spi->dev, lcd, &ld9040_lcd_ops); if (IS_ERR(ld)) { ret = PTR_ERR(ld); @@ -739,6 +783,8 @@ static int ld9040_probe(struct spi_device *spi) out_unregister_lcd: lcd_device_unregister(lcd->ld); out_free_lcd: + regulator_bulk_free(ARRAY_SIZE(supplies), supplies); + kfree(lcd); return ret; } @@ -750,6 +796,7 @@ static int __devexit ld9040_remove(struct spi_device *spi) ld9040_power(lcd, FB_BLANK_POWERDOWN); backlight_device_unregister(lcd->bd); lcd_device_unregister(lcd->ld); + regulator_bulk_free(ARRAY_SIZE(supplies), supplies); kfree(lcd); return 0; diff --git a/drivers/video/backlight/max8925_bl.c b/drivers/video/backlight/max8925_bl.c index 7bbc802560e..c915e3b5388 100644 --- a/drivers/video/backlight/max8925_bl.c +++ b/drivers/video/backlight/max8925_bl.c @@ -188,17 +188,7 @@ static struct platform_driver max8925_backlight_driver = { .remove = __devexit_p(max8925_backlight_remove), }; -static int __init max8925_backlight_init(void) -{ - return platform_driver_register(&max8925_backlight_driver); -} -module_init(max8925_backlight_init); - -static void __exit max8925_backlight_exit(void) -{ - platform_driver_unregister(&max8925_backlight_driver); -}; -module_exit(max8925_backlight_exit); +module_platform_driver(max8925_backlight_driver); MODULE_DESCRIPTION("Backlight Driver for Maxim MAX8925"); MODULE_AUTHOR("Haojian Zhuang <haojian.zhuang@marvell.com>"); diff --git a/drivers/video/backlight/omap1_bl.c b/drivers/video/backlight/omap1_bl.c index 08d26a72394..d8cde277ec8 100644 --- a/drivers/video/backlight/omap1_bl.c +++ b/drivers/video/backlight/omap1_bl.c @@ -195,18 +195,7 @@ static struct platform_driver omapbl_driver = { }, }; -static int __init omapbl_init(void) -{ - return platform_driver_register(&omapbl_driver); -} - -static void __exit omapbl_exit(void) -{ - platform_driver_unregister(&omapbl_driver); -} - -module_init(omapbl_init); -module_exit(omapbl_exit); +module_platform_driver(omapbl_driver); MODULE_AUTHOR("Andrzej Zaborowski <balrog@zabor.org>"); MODULE_DESCRIPTION("OMAP LCD Backlight driver"); diff --git a/drivers/video/backlight/pcf50633-backlight.c b/drivers/video/backlight/pcf50633-backlight.c index ef5628d6056..13e88b71dae 100644 --- a/drivers/video/backlight/pcf50633-backlight.c +++ b/drivers/video/backlight/pcf50633-backlight.c @@ -173,17 +173,7 @@ static struct platform_driver pcf50633_bl_driver = { }, }; -static int __init pcf50633_bl_init(void) -{ - return platform_driver_register(&pcf50633_bl_driver); -} -module_init(pcf50633_bl_init); - -static void __exit pcf50633_bl_exit(void) -{ - platform_driver_unregister(&pcf50633_bl_driver); -} -module_exit(pcf50633_bl_exit); +module_platform_driver(pcf50633_bl_driver); MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>"); MODULE_DESCRIPTION("PCF50633 backlight driver"); diff --git a/drivers/video/backlight/platform_lcd.c b/drivers/video/backlight/platform_lcd.c index 302330acf62..f0bf491ed08 100644 --- a/drivers/video/backlight/platform_lcd.c +++ b/drivers/video/backlight/platform_lcd.c @@ -85,7 +85,8 @@ static int __devinit platform_lcd_probe(struct platform_device *pdev) return -EINVAL; } - plcd = kzalloc(sizeof(struct platform_lcd), GFP_KERNEL); + plcd = devm_kzalloc(&pdev->dev, sizeof(struct platform_lcd), + GFP_KERNEL); if (!plcd) { dev_err(dev, "no memory for state\n"); return -ENOMEM; @@ -98,7 +99,7 @@ static int __devinit platform_lcd_probe(struct platform_device *pdev) if (IS_ERR(plcd->lcd)) { dev_err(dev, "cannot register lcd device\n"); err = PTR_ERR(plcd->lcd); - goto err_mem; + goto err; } platform_set_drvdata(pdev, plcd); @@ -106,8 +107,7 @@ static int __devinit platform_lcd_probe(struct platform_device *pdev) return 0; - err_mem: - kfree(plcd); + err: return err; } @@ -116,7 +116,6 @@ static int __devexit platform_lcd_remove(struct platform_device *pdev) struct platform_lcd *plcd = platform_get_drvdata(pdev); lcd_device_unregister(plcd->lcd); - kfree(plcd); return 0; } @@ -157,18 +156,7 @@ static struct platform_driver platform_lcd_driver = { .resume = platform_lcd_resume, }; -static int __init platform_lcd_init(void) -{ - return platform_driver_register(&platform_lcd_driver); -} - -static void __exit platform_lcd_cleanup(void) -{ - platform_driver_unregister(&platform_lcd_driver); -} - -module_init(platform_lcd_init); -module_exit(platform_lcd_cleanup); +module_platform_driver(platform_lcd_driver); MODULE_AUTHOR("Ben Dooks <ben-linux@fluff.org>"); MODULE_LICENSE("GPL v2"); diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index 8b5b2a4124c..7496d04e1d3 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -169,10 +169,9 @@ static int pwm_backlight_remove(struct platform_device *pdev) } #ifdef CONFIG_PM -static int pwm_backlight_suspend(struct platform_device *pdev, - pm_message_t state) +static int pwm_backlight_suspend(struct device *dev) { - struct backlight_device *bl = platform_get_drvdata(pdev); + struct backlight_device *bl = dev_get_drvdata(dev); struct pwm_bl_data *pb = dev_get_drvdata(&bl->dev); if (pb->notify) @@ -184,40 +183,32 @@ static int pwm_backlight_suspend(struct platform_device *pdev, return 0; } -static int pwm_backlight_resume(struct platform_device *pdev) +static int pwm_backlight_resume(struct device *dev) { - struct backlight_device *bl = platform_get_drvdata(pdev); + struct backlight_device *bl = dev_get_drvdata(dev); backlight_update_status(bl); return 0; } -#else -#define pwm_backlight_suspend NULL -#define pwm_backlight_resume NULL + +static SIMPLE_DEV_PM_OPS(pwm_backlight_pm_ops, pwm_backlight_suspend, + pwm_backlight_resume); + #endif static struct platform_driver pwm_backlight_driver = { .driver = { .name = "pwm-backlight", .owner = THIS_MODULE, +#ifdef CONFIG_PM + .pm = &pwm_backlight_pm_ops, +#endif }, .probe = pwm_backlight_probe, .remove = pwm_backlight_remove, - .suspend = pwm_backlight_suspend, - .resume = pwm_backlight_resume, }; -static int __init pwm_backlight_init(void) -{ - return platform_driver_register(&pwm_backlight_driver); -} -module_init(pwm_backlight_init); - -static void __exit pwm_backlight_exit(void) -{ - platform_driver_unregister(&pwm_backlight_driver); -} -module_exit(pwm_backlight_exit); +module_platform_driver(pwm_backlight_driver); MODULE_DESCRIPTION("PWM based Backlight Driver"); MODULE_LICENSE("GPL"); diff --git a/drivers/video/backlight/wm831x_bl.c b/drivers/video/backlight/wm831x_bl.c index fbe9e9316f3..4e915f5eca9 100644 --- a/drivers/video/backlight/wm831x_bl.c +++ b/drivers/video/backlight/wm831x_bl.c @@ -236,17 +236,7 @@ static struct platform_driver wm831x_backlight_driver = { .remove = wm831x_backlight_remove, }; -static int __init wm831x_backlight_init(void) -{ - return platform_driver_register(&wm831x_backlight_driver); -} -module_init(wm831x_backlight_init); - -static void __exit wm831x_backlight_exit(void) -{ - platform_driver_unregister(&wm831x_backlight_driver); -} -module_exit(wm831x_backlight_exit); +module_platform_driver(wm831x_backlight_driver); MODULE_DESCRIPTION("Backlight Driver for WM831x PMICs"); MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com"); diff --git a/drivers/video/bf54x-lq043fb.c b/drivers/video/bf54x-lq043fb.c index 56720fb476b..46b03f53985 100644 --- a/drivers/video/bf54x-lq043fb.c +++ b/drivers/video/bf54x-lq043fb.c @@ -4,7 +4,7 @@ * Author: Michael Hennerich <hennerich@blackfin.uclinux.org> * * Created: - * Description: ADSP-BF54x Framebufer driver + * Description: ADSP-BF54x Framebuffer driver * * * Modified: diff --git a/drivers/video/bfin-t350mcqb-fb.c b/drivers/video/bfin-t350mcqb-fb.c index d5e12675961..7a0c05f3537 100644 --- a/drivers/video/bfin-t350mcqb-fb.c +++ b/drivers/video/bfin-t350mcqb-fb.c @@ -4,7 +4,7 @@ * Author: Michael Hennerich <hennerich@blackfin.uclinux.org> * * Created: - * Description: Blackfin LCD Framebufer driver + * Description: Blackfin LCD Framebuffer driver * * * Modified: diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig index 2209e354f53..c2d11fef114 100644 --- a/drivers/video/console/Kconfig +++ b/drivers/video/console/Kconfig @@ -66,8 +66,6 @@ config SGI_NEWPORT_CONSOLE Say Y here if you want the console on the Newport aka XL graphics card of your Indy. Most people say Y here. -# bool 'IODC console' CONFIG_IODC_CONSOLE - config DUMMY_CONSOLE bool depends on VGA_CONSOLE!=y || SGI_NEWPORT_CONSOLE!=y diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c index 55f91d9ab00..29577bf1f55 100644 --- a/drivers/video/da8xx-fb.c +++ b/drivers/video/da8xx-fb.c @@ -116,6 +116,7 @@ /* Clock registers available only on Version 2 */ #define LCD_CLK_ENABLE_REG 0x6c #define LCD_CLK_RESET_REG 0x70 +#define LCD_CLK_MAIN_RESET BIT(3) #define LCD_NUM_BUFFERS 2 @@ -244,6 +245,10 @@ static inline void lcd_enable_raster(void) { u32 reg; + /* Bring LCDC out of reset */ + if (lcd_revision == LCD_VERSION_2) + lcdc_write(0, LCD_CLK_RESET_REG); + reg = lcdc_read(LCD_RASTER_CTRL_REG); if (!(reg & LCD_RASTER_ENABLE)) lcdc_write(reg | LCD_RASTER_ENABLE, LCD_RASTER_CTRL_REG); @@ -257,6 +262,10 @@ static inline void lcd_disable_raster(void) reg = lcdc_read(LCD_RASTER_CTRL_REG); if (reg & LCD_RASTER_ENABLE) lcdc_write(reg & ~LCD_RASTER_ENABLE, LCD_RASTER_CTRL_REG); + + if (lcd_revision == LCD_VERSION_2) + /* Write 1 to reset LCDC */ + lcdc_write(LCD_CLK_MAIN_RESET, LCD_CLK_RESET_REG); } static void lcd_blit(int load_mode, struct da8xx_fb_par *par) @@ -584,8 +593,12 @@ static void lcd_reset(struct da8xx_fb_par *par) lcdc_write(0, LCD_DMA_CTRL_REG); lcdc_write(0, LCD_RASTER_CTRL_REG); - if (lcd_revision == LCD_VERSION_2) + if (lcd_revision == LCD_VERSION_2) { lcdc_write(0, LCD_INT_ENABLE_SET_REG); + /* Write 1 to reset */ + lcdc_write(LCD_CLK_MAIN_RESET, LCD_CLK_RESET_REG); + lcdc_write(0, LCD_CLK_RESET_REG); + } } static void lcd_calc_clk_divider(struct da8xx_fb_par *par) diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c index d837d63c456..eb3c5eea1a0 100644 --- a/drivers/video/mxsfb.c +++ b/drivers/video/mxsfb.c @@ -328,7 +328,7 @@ static void mxsfb_enable_controller(struct fb_info *fb_info) dev_dbg(&host->pdev->dev, "%s\n", __func__); - clk_enable(host->clk); + clk_prepare_enable(host->clk); clk_set_rate(host->clk, PICOS2KHZ(fb_info->var.pixclock) * 1000U); /* if it was disabled, re-enable the mode again */ @@ -368,7 +368,7 @@ static void mxsfb_disable_controller(struct fb_info *fb_info) writel(VDCTRL4_SYNC_SIGNALS_ON, host->base + LCDC_VDCTRL4 + REG_CLR); - clk_disable(host->clk); + clk_disable_unprepare(host->clk); host->enabled = 0; } @@ -668,7 +668,7 @@ static int __devinit mxsfb_restore_mode(struct mxsfb_info *host) line_count = fb_info->fix.smem_len / fb_info->fix.line_length; fb_info->fix.ypanstep = 1; - clk_enable(host->clk); + clk_prepare_enable(host->clk); host->enabled = 1; return 0; @@ -841,7 +841,7 @@ static int __devinit mxsfb_probe(struct platform_device *pdev) error_register: if (host->enabled) - clk_disable(host->clk); + clk_disable_unprepare(host->clk); fb_destroy_modelist(&fb_info->modelist); error_init_fb: kfree(fb_info->pseudo_palette); diff --git a/drivers/video/nvidia/nvidia.c b/drivers/video/nvidia/nvidia.c index 081dc474527..fe13ac567d5 100644 --- a/drivers/video/nvidia/nvidia.c +++ b/drivers/video/nvidia/nvidia.c @@ -81,7 +81,7 @@ static int vram __devinitdata = 0; static int bpp __devinitdata = 8; static int reverse_i2c __devinitdata; #ifdef CONFIG_MTRR -static int nomtrr __devinitdata = 0; +static bool nomtrr __devinitdata = false; #endif #ifdef CONFIG_PMAC_BACKLIGHT static int backlight __devinitdata = 1; @@ -1509,7 +1509,7 @@ static int __devinit nvidiafb_setup(char *options) backlight = simple_strtoul(this_opt+10, NULL, 0); #ifdef CONFIG_MTRR } else if (!strncmp(this_opt, "nomtrr", 6)) { - nomtrr = 1; + nomtrr = true; #endif } else if (!strncmp(this_opt, "fpdither:", 9)) { fpdither = simple_strtol(this_opt+9, NULL, 0); @@ -1599,7 +1599,7 @@ MODULE_PARM_DESC(bpp, "pixel width in bits" module_param(reverse_i2c, int, 0); MODULE_PARM_DESC(reverse_i2c, "reverse port assignment of the i2c bus"); #ifdef CONFIG_MTRR -module_param(nomtrr, bool, 0); +module_param(nomtrr, bool, false); MODULE_PARM_DESC(nomtrr, "Disables MTRR support (0 or 1=disabled) " "(default=0)"); #endif diff --git a/drivers/video/offb.c b/drivers/video/offb.c index cb163a5397b..0c4f34311ed 100644 --- a/drivers/video/offb.c +++ b/drivers/video/offb.c @@ -41,13 +41,14 @@ /* Supported palette hacks */ enum { cmap_unknown, - cmap_m64, /* ATI Mach64 */ + cmap_simple, /* ATI Mach64 */ cmap_r128, /* ATI Rage128 */ cmap_M3A, /* ATI Rage Mobility M3 Head A */ cmap_M3B, /* ATI Rage Mobility M3 Head B */ cmap_radeon, /* ATI Radeon */ cmap_gxt2000, /* IBM GXT2000 */ cmap_avivo, /* ATI R5xx */ + cmap_qemu, /* qemu vga */ }; struct offb_par { @@ -100,36 +101,32 @@ static int offb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, u_int transp, struct fb_info *info) { struct offb_par *par = (struct offb_par *) info->par; - int i, depth; - u32 *pal = info->pseudo_palette; - - depth = info->var.bits_per_pixel; - if (depth == 16) - depth = (info->var.green.length == 5) ? 15 : 16; - - if (regno > 255 || - (depth == 16 && regno > 63) || - (depth == 15 && regno > 31)) - return 1; - - if (regno < 16) { - switch (depth) { - case 15: - pal[regno] = (regno << 10) | (regno << 5) | regno; - break; - case 16: - pal[regno] = (regno << 11) | (regno << 5) | regno; - break; - case 24: - pal[regno] = (regno << 16) | (regno << 8) | regno; - break; - case 32: - i = (regno << 8) | regno; - pal[regno] = (i << 16) | i; - break; + + if (info->fix.visual == FB_VISUAL_TRUECOLOR) { + u32 *pal = info->pseudo_palette; + u32 cr = red >> (16 - info->var.red.length); + u32 cg = green >> (16 - info->var.green.length); + u32 cb = blue >> (16 - info->var.blue.length); + u32 value; + + if (regno >= 16) + return -EINVAL; + + value = (cr << info->var.red.offset) | + (cg << info->var.green.offset) | + (cb << info->var.blue.offset); + if (info->var.transp.length > 0) { + u32 mask = (1 << info->var.transp.length) - 1; + mask <<= info->var.transp.offset; + value |= mask; } + pal[regno] = value; + return 0; } + if (regno > 255) + return -EINVAL; + red >>= 8; green >>= 8; blue >>= 8; @@ -138,7 +135,7 @@ static int offb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, return 0; switch (par->cmap_type) { - case cmap_m64: + case cmap_simple: writeb(regno, par->cmap_adr); writeb(red, par->cmap_data); writeb(green, par->cmap_data); @@ -208,7 +205,7 @@ static int offb_blank(int blank, struct fb_info *info) if (blank) for (i = 0; i < 256; i++) { switch (par->cmap_type) { - case cmap_m64: + case cmap_simple: writeb(i, par->cmap_adr); for (j = 0; j < 3; j++) writeb(0, par->cmap_data); @@ -350,7 +347,7 @@ static void offb_init_palette_hacks(struct fb_info *info, struct device_node *dp par->cmap_adr = ioremap(base + 0x7ff000, 0x1000) + 0xcc0; par->cmap_data = par->cmap_adr + 1; - par->cmap_type = cmap_m64; + par->cmap_type = cmap_simple; } else if (dp && (of_device_is_compatible(dp, "pci1014,b7") || of_device_is_compatible(dp, "pci1014,21c"))) { par->cmap_adr = offb_map_reg(dp, 0, 0x6000, 0x1000); @@ -371,6 +368,16 @@ static void offb_init_palette_hacks(struct fb_info *info, struct device_node *dp par->cmap_type = cmap_avivo; } of_node_put(pciparent); + } else if (dp && of_device_is_compatible(dp, "qemu,std-vga")) { + const u32 io_of_addr[3] = { 0x01000000, 0x0, 0x0 }; + u64 io_addr = of_translate_address(dp, io_of_addr); + if (io_addr != OF_BAD_ADDR) { + par->cmap_adr = ioremap(io_addr + 0x3c8, 2); + if (par->cmap_adr) { + par->cmap_type = cmap_simple; + par->cmap_data = par->cmap_adr + 1; + } + } } info->fix.visual = (par->cmap_type != cmap_unknown) ? FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_STATIC_PSEUDOCOLOR; @@ -381,7 +388,7 @@ static void __init offb_init_fb(const char *name, const char *full_name, int pitch, unsigned long address, int foreign_endian, struct device_node *dp) { - unsigned long res_size = pitch * height * (depth + 7) / 8; + unsigned long res_size = pitch * height; struct offb_par *par = &default_par; unsigned long res_start = address; struct fb_fix_screeninfo *fix; diff --git a/drivers/video/omap/dispc.c b/drivers/video/omap/dispc.c index 0ccd7adf47b..6f61e781f15 100644 --- a/drivers/video/omap/dispc.c +++ b/drivers/video/omap/dispc.c @@ -19,6 +19,7 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <linux/kernel.h> +#include <linux/module.h> #include <linux/dma-mapping.h> #include <linux/mm.h> #include <linux/vmalloc.h> diff --git a/drivers/video/omap/rfbi.c b/drivers/video/omap/rfbi.c index 0c6981f1a4a..2c1a3402bef 100644 --- a/drivers/video/omap/rfbi.c +++ b/drivers/video/omap/rfbi.c @@ -2,7 +2,7 @@ * OMAP2 Remote Frame Buffer Interface support * * Copyright (C) 2005 Nokia Corporation - * Author: Juha Yrjölä <juha.yrjola@nokia.com> + * Author: Juha Yrjölä <juha.yrjola@nokia.com> * Imre Deak <imre.deak@nokia.com> * * This program is free software; you can redistribute it and/or modify it diff --git a/drivers/video/omap/sossi.c b/drivers/video/omap/sossi.c index 8fb7c708f56..f79c137753d 100644 --- a/drivers/video/omap/sossi.c +++ b/drivers/video/omap/sossi.c @@ -2,7 +2,7 @@ * OMAP1 Special OptimiSed Screen Interface support * * Copyright (C) 2004-2005 Nokia Corporation - * Author: Juha Yrjölä <juha.yrjola@nokia.com> + * Author: Juha Yrjölä <juha.yrjola@nokia.com> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index 3532782551c..5c81533eaca 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c @@ -1720,12 +1720,11 @@ static int dispc_ovl_calc_scaling(enum omap_plane plane, const int maxdownscale = dss_feat_get_param_max(FEAT_PARAM_DOWNSCALE); unsigned long fclk = 0; - if ((ovl->caps & OMAP_DSS_OVL_CAP_SCALE) == 0) { - if (width != out_width || height != out_height) - return -EINVAL; - else - return 0; - } + if (width == out_width && height == out_height) + return 0; + + if ((ovl->caps & OMAP_DSS_OVL_CAP_SCALE) == 0) + return -EINVAL; if (out_width < width / maxdownscale || out_width > width * 8) diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c index 3262f0f1fa3..c56378c555b 100644 --- a/drivers/video/omap2/dss/hdmi.c +++ b/drivers/video/omap2/dss/hdmi.c @@ -269,7 +269,7 @@ static void update_hdmi_timings(struct hdmi_config *cfg, unsigned long hdmi_get_pixel_clock(void) { /* HDMI Pixel Clock in Mhz */ - return hdmi.ip_data.cfg.timings.timings.pixel_clock * 10000; + return hdmi.ip_data.cfg.timings.timings.pixel_clock * 1000; } static void hdmi_compute_pll(struct omap_dss_device *dssdev, int phy, diff --git a/drivers/video/omap2/omapfb/Kconfig b/drivers/video/omap2/omapfb/Kconfig index 83d3fe7ec9a..4ea17dc3258 100644 --- a/drivers/video/omap2/omapfb/Kconfig +++ b/drivers/video/omap2/omapfb/Kconfig @@ -1,6 +1,6 @@ menuconfig FB_OMAP2 tristate "OMAP2+ frame buffer support" - depends on FB && OMAP2_DSS + depends on FB && OMAP2_DSS && !DRM_OMAP select OMAP2_VRAM select OMAP2_VRFB if ARCH_OMAP2 || ARCH_OMAP3 diff --git a/drivers/video/smscufx.c b/drivers/video/smscufx.c index aaccffac67a..3c22994ea31 100644 --- a/drivers/video/smscufx.c +++ b/drivers/video/smscufx.c @@ -1792,24 +1792,7 @@ static struct usb_driver ufx_driver = { .id_table = id_table, }; -static int __init ufx_module_init(void) -{ - int res; - - res = usb_register(&ufx_driver); - if (res) - err("usb_register failed. Error number %d", res); - - return res; -} - -static void __exit ufx_module_exit(void) -{ - usb_deregister(&ufx_driver); -} - -module_init(ufx_module_init); -module_exit(ufx_module_exit); +module_usb_driver(ufx_driver); static void ufx_urb_completion(struct urb *urb) { diff --git a/drivers/video/udlfb.c b/drivers/video/udlfb.c index 3473e75ce78..1f868d0187a 100644 --- a/drivers/video/udlfb.c +++ b/drivers/video/udlfb.c @@ -1761,24 +1761,7 @@ static struct usb_driver dlfb_driver = { .id_table = id_table, }; -static int __init dlfb_module_init(void) -{ - int res; - - res = usb_register(&dlfb_driver); - if (res) - err("usb_register failed. Error number %d", res); - - return res; -} - -static void __exit dlfb_module_exit(void) -{ - usb_deregister(&dlfb_driver); -} - -module_init(dlfb_module_init); -module_exit(dlfb_module_exit); +module_usb_driver(dlfb_driver); static void dlfb_urb_completion(struct urb *urb) { diff --git a/drivers/video/via/share.h b/drivers/video/via/share.h index 69d882cbe70..c01c1c16272 100644 --- a/drivers/video/via/share.h +++ b/drivers/video/via/share.h @@ -559,8 +559,8 @@ #define M1200X720_R60_VSP POSITIVE /* 1200x900@60 Sync Polarity (DCON) */ -#define M1200X900_R60_HSP NEGATIVE -#define M1200X900_R60_VSP NEGATIVE +#define M1200X900_R60_HSP POSITIVE +#define M1200X900_R60_VSP POSITIVE /* 1280x600@60 Sync Polarity (GTF Mode) */ #define M1280x600_R60_HSP NEGATIVE diff --git a/drivers/video/xen-fbfront.c b/drivers/video/xen-fbfront.c index beac52fc1c0..cb4529c40d7 100644 --- a/drivers/video/xen-fbfront.c +++ b/drivers/video/xen-fbfront.c @@ -671,20 +671,17 @@ InitWait: } } -static struct xenbus_device_id xenfb_ids[] = { +static const struct xenbus_device_id xenfb_ids[] = { { "vfb" }, { "" } }; -static struct xenbus_driver xenfb_driver = { - .name = "vfb", - .owner = THIS_MODULE, - .ids = xenfb_ids, +static DEFINE_XENBUS_DRIVER(xenfb, , .probe = xenfb_probe, .remove = xenfb_remove, .resume = xenfb_resume, .otherend_changed = xenfb_backend_changed, -}; +); static int __init xenfb_init(void) { |