aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/backlight/hp680_bl.c
diff options
context:
space:
mode:
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>2006-12-08 02:40:49 -0800
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-08 08:29:07 -0800
commit4437cd1e98409e236a9d303fb742fdd53b3a20bb (patch)
tree461c3806fb8988d764fdb974b3dd042fd4fe7efa /drivers/video/backlight/hp680_bl.c
parent[PATCH] softcursor.c: avoid unaligned accesses (diff)
downloadlinux-dev-4437cd1e98409e236a9d303fb742fdd53b3a20bb.tar.xz
linux-dev-4437cd1e98409e236a9d303fb742fdd53b3a20bb.zip
[PATCH] backlight: do not power off backlight when unregistering
ACPI drivers like ibm-acpi are moving to the backlight sysfs infrastructure. During ibm-acpi testing, I have noticed that backlight_device_unregister() sets the display brightness and power to zero. This causes the display to be dimmed on ibm-acpi module removal. It will affect all other ACPI drivers that are being converted to use the backlight class, as well. It also affects a number of framebuffer devices that are used on desktops and laptops which might also not want such behaviour. Since working around this behaviour requires undesireable hacks, Richard Purdie decided that we would be better off reverting the changes in the sysfs class, and adding the code to dim and power off the backlight device to the drivers that want it. This patch is my attempt to do so. Patch against latest linux-2.6.git. Changes untested, as I lack the required hardware. Still, they are trivial enough that, apart from typos, there is little chance of getting them wrong. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Acked-by: Richard Purdie <rpurdie@rpsys.net> Acked-by: Pavel Machek <pavel@ucw.cz> Acked-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/video/backlight/hp680_bl.c')
-rw-r--r--drivers/video/backlight/hp680_bl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/video/backlight/hp680_bl.c b/drivers/video/backlight/hp680_bl.c
index e3993213d10e..1c569fb543ae 100644
--- a/drivers/video/backlight/hp680_bl.c
+++ b/drivers/video/backlight/hp680_bl.c
@@ -117,6 +117,10 @@ static int __init hp680bl_probe(struct platform_device *dev)
static int hp680bl_remove(struct platform_device *dev)
{
+ hp680bl_data.brightness = 0;
+ hp680bl_data.power = 0;
+ hp680bl_send_intensity(hp680_backlight_device);
+
backlight_device_unregister(hp680_backlight_device);
return 0;