diff options
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/amifb.c | 1 | ||||
-rw-r--r-- | drivers/video/backlight/88pm860x_bl.c | 49 | ||||
-rw-r--r-- | drivers/video/backlight/apple_bl.c | 23 | ||||
-rw-r--r-- | drivers/video/bt431.h | 1 | ||||
-rw-r--r-- | drivers/video/bt455.h | 1 | ||||
-rw-r--r-- | drivers/video/console/fbcon.c | 1 | ||||
-rw-r--r-- | drivers/video/console/newport_con.c | 1 | ||||
-rw-r--r-- | drivers/video/cyber2000fb.c | 1 | ||||
-rw-r--r-- | drivers/video/dnfb.c | 1 | ||||
-rw-r--r-- | drivers/video/neofb.c | 1 | ||||
-rw-r--r-- | drivers/video/pmag-ba-fb.c | 1 | ||||
-rw-r--r-- | drivers/video/pmagb-b-fb.c | 1 | ||||
-rw-r--r-- | drivers/video/q40fb.c | 1 | ||||
-rw-r--r-- | drivers/video/savage/savagefb_driver.c | 1 |
14 files changed, 49 insertions, 35 deletions
diff --git a/drivers/video/amifb.c b/drivers/video/amifb.c index f23cae094f1b..887df9d81422 100644 --- a/drivers/video/amifb.c +++ b/drivers/video/amifb.c @@ -53,7 +53,6 @@ #include <linux/platform_device.h> #include <linux/uaccess.h> -#include <asm/system.h> #include <asm/irq.h> #include <asm/amigahw.h> #include <asm/amigaints.h> diff --git a/drivers/video/backlight/88pm860x_bl.c b/drivers/video/backlight/88pm860x_bl.c index 915943af3f21..f49181c73113 100644 --- a/drivers/video/backlight/88pm860x_bl.c +++ b/drivers/video/backlight/88pm860x_bl.c @@ -67,6 +67,28 @@ static inline int wled_idc(int port) return ret; } +static int backlight_power_set(struct pm860x_chip *chip, int port, + int on) +{ + int ret = -EINVAL; + + switch (port) { + case PM8606_BACKLIGHT1: + ret = on ? pm8606_osc_enable(chip, WLED1_DUTY) : + pm8606_osc_disable(chip, WLED1_DUTY); + break; + case PM8606_BACKLIGHT2: + ret = on ? pm8606_osc_enable(chip, WLED2_DUTY) : + pm8606_osc_disable(chip, WLED2_DUTY); + break; + case PM8606_BACKLIGHT3: + ret = on ? pm8606_osc_enable(chip, WLED3_DUTY) : + pm8606_osc_disable(chip, WLED3_DUTY); + break; + } + return ret; +} + static int pm860x_backlight_set(struct backlight_device *bl, int brightness) { struct pm860x_backlight_data *data = bl_get_data(bl); @@ -79,6 +101,9 @@ static int pm860x_backlight_set(struct backlight_device *bl, int brightness) else value = brightness; + if (brightness) + backlight_power_set(chip, data->port, 1); + ret = pm860x_reg_write(data->i2c, wled_a(data->port), value); if (ret < 0) goto out; @@ -115,6 +140,9 @@ static int pm860x_backlight_set(struct backlight_device *bl, int brightness) if (ret < 0) goto out; + if (brightness == 0) + backlight_power_set(chip, data->port, 0); + dev_dbg(chip->dev, "set brightness %d\n", value); data->current_brightness = value; return 0; @@ -170,7 +198,6 @@ static int pm860x_backlight_probe(struct platform_device *pdev) struct backlight_device *bl; struct resource *res; struct backlight_properties props; - unsigned char value; char name[MFD_NAME_SIZE]; int ret; @@ -217,26 +244,6 @@ static int pm860x_backlight_probe(struct platform_device *pdev) platform_set_drvdata(pdev, bl); - /* Enable reference VSYS */ - ret = pm860x_reg_read(data->i2c, PM8606_VSYS); - if (ret < 0) - goto out; - if ((ret & PM8606_VSYS_EN) == 0) { - value = ret | PM8606_VSYS_EN; - ret = pm860x_reg_write(data->i2c, PM8606_VSYS, value); - if (ret < 0) - goto out; - } - /* Enable reference OSC */ - ret = pm860x_reg_read(data->i2c, PM8606_MISC); - if (ret < 0) - goto out; - if ((ret & PM8606_MISC_OSC_EN) == 0) { - value = ret | PM8606_MISC_OSC_EN; - ret = pm860x_reg_write(data->i2c, PM8606_MISC, value); - if (ret < 0) - goto out; - } /* read current backlight */ ret = pm860x_backlight_get_brightness(bl); if (ret < 0) diff --git a/drivers/video/backlight/apple_bl.c b/drivers/video/backlight/apple_bl.c index be98d152b7fd..a523b255e124 100644 --- a/drivers/video/backlight/apple_bl.c +++ b/drivers/video/backlight/apple_bl.c @@ -24,6 +24,7 @@ #include <linux/io.h> #include <linux/pci.h> #include <linux/acpi.h> +#include <linux/atomic.h> static struct backlight_device *apple_backlight_device; @@ -221,14 +222,32 @@ static struct acpi_driver apple_bl_driver = { }, }; +static atomic_t apple_bl_registered = ATOMIC_INIT(0); + +int apple_bl_register(void) +{ + if (atomic_xchg(&apple_bl_registered, 1) == 0) + return acpi_bus_register_driver(&apple_bl_driver); + + return 0; +} +EXPORT_SYMBOL_GPL(apple_bl_register); + +void apple_bl_unregister(void) +{ + if (atomic_xchg(&apple_bl_registered, 0) == 1) + acpi_bus_unregister_driver(&apple_bl_driver); +} +EXPORT_SYMBOL_GPL(apple_bl_unregister); + static int __init apple_bl_init(void) { - return acpi_bus_register_driver(&apple_bl_driver); + return apple_bl_register(); } static void __exit apple_bl_exit(void) { - acpi_bus_unregister_driver(&apple_bl_driver); + apple_bl_unregister(); } module_init(apple_bl_init); diff --git a/drivers/video/bt431.h b/drivers/video/bt431.h index c826f2787bad..04e0cfbba538 100644 --- a/drivers/video/bt431.h +++ b/drivers/video/bt431.h @@ -8,7 +8,6 @@ * archive for more details. */ #include <linux/types.h> -#include <asm/system.h> /* * Bt431 cursor generator registers, 32-bit aligned. diff --git a/drivers/video/bt455.h b/drivers/video/bt455.h index b7591fea7add..80f61b03e9ae 100644 --- a/drivers/video/bt455.h +++ b/drivers/video/bt455.h @@ -8,7 +8,6 @@ * archive for more details. */ #include <linux/types.h> -#include <asm/system.h> /* * Bt455 byte-wide registers, 32-bit aligned. diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index 8745637e4b7e..2e471c22abf5 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c @@ -77,7 +77,6 @@ #include <linux/crc32.h> /* For counting font checksums */ #include <asm/fb.h> #include <asm/irq.h> -#include <asm/system.h> #include "fbcon.h" diff --git a/drivers/video/console/newport_con.c b/drivers/video/console/newport_con.c index a122d9287d16..6d1596629040 100644 --- a/drivers/video/console/newport_con.c +++ b/drivers/video/console/newport_con.c @@ -22,7 +22,6 @@ #include <asm/io.h> #include <asm/uaccess.h> -#include <asm/system.h> #include <asm/page.h> #include <asm/pgtable.h> #include <asm/gio_device.h> diff --git a/drivers/video/cyber2000fb.c b/drivers/video/cyber2000fb.c index 850380795b05..c1527f5b47ee 100644 --- a/drivers/video/cyber2000fb.c +++ b/drivers/video/cyber2000fb.c @@ -51,7 +51,6 @@ #include <linux/i2c-algo-bit.h> #include <asm/pgtable.h> -#include <asm/system.h> #ifdef __arm__ #include <asm/mach-types.h> diff --git a/drivers/video/dnfb.c b/drivers/video/dnfb.c index ec56d2544c73..49e3dda1a361 100644 --- a/drivers/video/dnfb.c +++ b/drivers/video/dnfb.c @@ -7,7 +7,6 @@ #include <linux/platform_device.h> #include <asm/setup.h> -#include <asm/system.h> #include <asm/irq.h> #include <asm/amigahw.h> #include <asm/amigaints.h> diff --git a/drivers/video/neofb.c b/drivers/video/neofb.c index fb3f67391105..afc9521173ef 100644 --- a/drivers/video/neofb.c +++ b/drivers/video/neofb.c @@ -71,7 +71,6 @@ #include <asm/io.h> #include <asm/irq.h> #include <asm/pgtable.h> -#include <asm/system.h> #ifdef CONFIG_MTRR #include <asm/mtrr.h> diff --git a/drivers/video/pmag-ba-fb.c b/drivers/video/pmag-ba-fb.c index 0c69fa20251b..9b4a60b52a4c 100644 --- a/drivers/video/pmag-ba-fb.c +++ b/drivers/video/pmag-ba-fb.c @@ -33,7 +33,6 @@ #include <linux/types.h> #include <asm/io.h> -#include <asm/system.h> #include <video/pmag-ba-fb.h> diff --git a/drivers/video/pmagb-b-fb.c b/drivers/video/pmagb-b-fb.c index 22fcb9a3d5c0..4e7a9c46e112 100644 --- a/drivers/video/pmagb-b-fb.c +++ b/drivers/video/pmagb-b-fb.c @@ -29,7 +29,6 @@ #include <linux/types.h> #include <asm/io.h> -#include <asm/system.h> #include <video/pmagb-b-fb.h> diff --git a/drivers/video/q40fb.c b/drivers/video/q40fb.c index f5a39f5aa900..a104e8cd2f54 100644 --- a/drivers/video/q40fb.c +++ b/drivers/video/q40fb.c @@ -20,7 +20,6 @@ #include <asm/uaccess.h> #include <asm/setup.h> -#include <asm/system.h> #include <asm/q40_master.h> #include <linux/fb.h> #include <linux/module.h> diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c index beb495044b24..cee7803a0a1c 100644 --- a/drivers/video/savage/savagefb_driver.c +++ b/drivers/video/savage/savagefb_driver.c @@ -56,7 +56,6 @@ #include <asm/io.h> #include <asm/irq.h> #include <asm/pgtable.h> -#include <asm/system.h> #ifdef CONFIG_MTRR #include <asm/mtrr.h> |