public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Carlos Corbacho <carlos@strangeworlds.co.uk>
To: linux-acpi@vger.kernel.org
Cc: lenb@kernel.org
Subject: [PATCH 3/7] acer-wmi: Respect framebuffer blanking in backlight
Date: Sat, 21 Jun 2008 09:09:27 +0100	[thread overview]
Message-ID: <20080621080927.26920.58383.stgit@pacifica> (raw)
In-Reply-To: <20080621080903.26920.14225.stgit@pacifica>

If the framebuffer has requested blanking, turn the backlight down. Also
offer the user the option to do this.

Reported-by: Michal Pecio <michal.pecio@gmail.com>
Signed-off-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
---

 drivers/misc/acer-wmi.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)


diff --git a/drivers/misc/acer-wmi.c b/drivers/misc/acer-wmi.c
index b82ff25..e35825f 100644
--- a/drivers/misc/acer-wmi.c
+++ b/drivers/misc/acer-wmi.c
@@ -29,6 +29,7 @@
 #include <linux/init.h>
 #include <linux/types.h>
 #include <linux/dmi.h>
+#include <linux/fb.h>
 #include <linux/backlight.h>
 #include <linux/leds.h>
 #include <linux/platform_device.h>
@@ -830,7 +831,15 @@ static int read_brightness(struct backlight_device *bd)
 
 static int update_bl_status(struct backlight_device *bd)
 {
-	set_u32(bd->props.brightness, ACER_CAP_BRIGHTNESS);
+	int intensity = bd->props.brightness;
+
+	if (bd->props.power != FB_BLANK_UNBLANK)
+		intensity = 0;
+	if (bd->props.fb_blank != FB_BLANK_UNBLANK)
+		intensity = 0;
+
+	set_u32(intensity, ACER_CAP_BRIGHTNESS);
+
 	return 0;
 }
 
@@ -852,8 +861,9 @@ static int __devinit acer_backlight_init(struct device *dev)
 
 	acer_backlight_device = bd;
 
+	bd->props.power = FB_BLANK_UNBLANK;
+	bd->props.brightness = max_brightness;
 	bd->props.max_brightness = max_brightness;
-	bd->props.brightness = read_brightness(NULL);
 	backlight_update_status(bd);
 	return 0;
 }


  parent reply	other threads:[~2008-06-21  8:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-21  8:09 [PATCH 0/7] acer-wmi patches for 2.6.27 Carlos Corbacho
2008-06-21  8:09 ` [PATCH 1/7] acer-wmi: Remove LED colour comment from documentation Carlos Corbacho
2008-06-21  8:09 ` [PATCH 2/7] acer-wmi: Blacklist backlight on Acer Aspire 1520 & 1360 series Carlos Corbacho
2008-06-21  8:09 ` Carlos Corbacho [this message]
2008-06-21  8:09 ` [PATCH 4/7] acer-wmi: Add EC quirk for Fujitsu Siemens Amilo Li 1718 Carlos Corbacho
2008-06-21  8:09 ` [PATCH 5/7] acer-wmi: Disable device autodetection on Fujitsu Siemens Amilo Li2732 Carlos Corbacho
2008-06-21  8:09 ` [PATCH 6/7] acer-wmi: Add debugfs file for device detection Carlos Corbacho
2008-06-21  8:09 ` [PATCH 7/7] acer-wmi: Remove version number Carlos Corbacho
2008-06-26  4:23 ` [PATCH 0/7] acer-wmi patches for 2.6.27 Len Brown

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=20080621080927.26920.58383.stgit@pacifica \
    --to=carlos@strangeworlds.co.uk \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox