LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Jiri Kosina <jikos@jikos.cz>
To: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Richard Purdie <rpurdie@rpsys.net>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ACPI: ibm-acpi: improve backlight power handling
Date: Mon, 26 Feb 2007 18:21:59 +0100 (CET) [thread overview]
Message-ID: <Pine.LNX.4.64.0702261752050.10496@twin.jikos.cz> (raw)
In-Reply-To: <20070226161203.GD2909@khazad-dum.debian.net>
On Mon, 26 Feb 2007, Henrique de Moraes Holschuh wrote:
> Improve the backlight code to emulate as much as possible the power
> management events, as we are unable to really power on or power off the
> backlight.
This still easily leads to confusing behavior, doesn't it? As there are
power-related calls from backlight driver, which won't get handled
properly by your code, in result confusing the brightness status.
I would suggest applying something like the patch below instead, if you
find it OK.
From: Jiri Kosina <jkosina@suse.cz>
[PATCH] ibm-acpi: handle power calls from backlight class
Don't ignore the power-related calls from backlight class driver
and always adjust the brightness accordingly.
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
---
drivers/acpi/ibm_acpi.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/drivers/acpi/ibm_acpi.c b/drivers/acpi/ibm_acpi.c
index 7c1b418..4cfa5f8 100644
--- a/drivers/acpi/ibm_acpi.c
+++ b/drivers/acpi/ibm_acpi.c
@@ -87,6 +87,7 @@
#include <linux/proc_fs.h>
#include <linux/backlight.h>
#include <asm/uaccess.h>
+#include <linux/fb.h>
#include <linux/dmi.h>
#include <linux/jiffies.h>
@@ -1701,7 +1702,12 @@ static int brightness_write(char *buf)
static int brightness_update_status(struct backlight_device *bd)
{
- return brightness_set(bd->props.brightness);
+ int brightness = 0;
+
+ if (bd->props.fb_blank == FB_BLANK_UNBLANK || bd->props.power == FB_BLANK_UNBLANK)
+ brightness = bd->props.brightness;
+ return brightness_set(brightness);
+
}
static struct backlight_ops ibm_backlight_data = {
next prev parent reply other threads:[~2007-02-26 17:22 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-26 0:59 2.6.21-rc1 dims my LCD Jiri Kosina
2007-02-26 11:41 ` Richard Purdie
2007-02-26 12:35 ` Jiri Kosina
2007-02-26 14:21 ` Henrique de Moraes Holschuh
2007-02-26 14:49 ` Richard Purdie
2007-02-26 15:20 ` Henrique de Moraes Holschuh
2007-02-26 16:12 ` [PATCH] ACPI: ibm-acpi: improve backlight power handling Henrique de Moraes Holschuh
2007-02-26 16:38 ` Richard Purdie
2007-02-26 18:12 ` Henrique de Moraes Holschuh
2007-02-26 18:26 ` [PATCH] ACPI: ibm-acpi: improve backlight power handling (v2) Henrique de Moraes Holschuh
2007-02-26 21:25 ` Jiri Kosina
2007-02-26 21:42 ` Richard Purdie
2007-02-26 21:46 ` Henrique de Moraes Holschuh
2007-02-26 21:53 ` Richard Purdie
2007-02-26 17:21 ` Jiri Kosina [this message]
2007-02-26 18:17 ` [PATCH] ACPI: ibm-acpi: improve backlight power handling Henrique de Moraes Holschuh
2007-02-26 15:24 ` 2.6.21-rc1 dims my LCD Jiri Kosina
2007-02-26 15:43 ` Richard Purdie
2007-02-26 17:13 ` [Linux-fbdev-devel] " Antonino A. Daplas
2007-02-26 16:03 ` Henrique de Moraes Holschuh
2007-02-26 17:01 ` Richard Purdie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.64.0702261752050.10496@twin.jikos.cz \
--to=jikos@jikos.cz \
--cc=hmh@hmh.eng.br \
--cc=linux-kernel@vger.kernel.org \
--cc=rpurdie@rpsys.net \
--subject='Re: [PATCH] ACPI: ibm-acpi: improve backlight power handling' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).