LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
To: Richard Purdie <rpurdie@rpsys.net>
Cc: linux-kernel@vger.kernel.org,
	linux-fbdev-devel@lists.sourceforge.net,
	linux-acpi@vger.kernel.org
Subject: ACPI: ibm-acpi: fix initial status of backlight device
Date: Thu, 22 Feb 2007 12:45:11 -0200	[thread overview]
Message-ID: <20070222144511.GC25887@khazad-dum.debian.net> (raw)
In-Reply-To: <1172138587.5837.37.camel@localhost.localdomain>

The brightness class core does not update the initial status of the
device's brightness at register time.  Do it by ourselves.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Richard Purdie <rpurdie@rpsys.net>
---

Waiting ACK from Richard Purdie, applies on top of 2.6.21-rc1.  Also fixes a
whitespace problem.

 drivers/acpi/ibm_acpi.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/acpi/ibm_acpi.c b/drivers/acpi/ibm_acpi.c
index 4cc534e..c59ebff 100644
--- a/drivers/acpi/ibm_acpi.c
+++ b/drivers/acpi/ibm_acpi.c
@@ -1711,6 +1711,12 @@ static struct backlight_ops ibm_backlight_data = {
 
 static int brightness_init(void)
 {
+	int b;
+
+	b = brightness_get(NULL);
+	if (b < 0)
+		return b;
+
 	ibm_backlight_device = backlight_device_register("ibm", NULL, NULL,
 							 &ibm_backlight_data);
 	if (IS_ERR(ibm_backlight_device)) {
@@ -1718,7 +1724,8 @@ static int brightness_init(void)
 		return PTR_ERR(ibm_backlight_device);
 	}
 
-        ibm_backlight_device->props.max_brightness = 7;
+	ibm_backlight_device->props.max_brightness = 7;
+	ibm_backlight_device->props.brightness = b;
 
 	return 0;
 }
-- 
1.4.4.4

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

  reply	other threads:[~2007-02-22 14:45 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-19  4:46 no backlight on radeon after recent kernel "upgrade"s Yaroslav Halchenko
2007-02-19  8:04 ` Andrew Morton
2007-02-19  9:19   ` Richard Purdie
2007-02-21  5:56     ` Yaroslav Halchenko
2007-02-22  0:34       ` Richard Purdie
2007-02-22  1:07         ` James Simmons
2007-02-22  9:46           ` Richard Purdie
2007-02-22 15:18             ` James Simmons
2007-02-22  1:11       ` [Linux-fbdev-devel] " James Simmons
2007-02-22  2:09         ` Joel Becker
2007-02-22 15:55           ` James Simmons
2007-02-22 17:28             ` David Miller
2007-02-28 16:55               ` James Simmons
2007-03-01 10:57                 ` Richard Purdie
2007-03-01 21:08                   ` James Simmons
2007-02-21 22:18     ` Alex Romosan
2007-02-21 22:41       ` Richard Purdie
2007-02-21 23:17         ` Henrique de Moraes Holschuh
2007-02-22  0:12           ` Richard Purdie
2007-02-22  0:51             ` Henrique de Moraes Holschuh
2007-02-22  1:10               ` Richard Purdie
2007-02-22  2:13                 ` Henrique de Moraes Holschuh
2007-02-22  1:10               ` Henrique de Moraes Holschuh
2007-02-22  1:16                 ` ACPI: ibm-acpi: fix initial status of backlight device Henrique de Moraes Holschuh
2007-02-22 10:03                   ` Richard Purdie
2007-02-22 14:45                     ` Henrique de Moraes Holschuh [this message]
2007-02-22 18:19                       ` Henrique de Moraes Holschuh
2007-02-22 10:00                 ` no backlight on radeon after recent kernel "upgrade"s Richard Purdie
2007-02-22 14:56                   ` Henrique de Moraes Holschuh
2007-02-22 15:19                     ` Richard Purdie
2007-02-22 16:00                       ` James Simmons
2007-02-22 16:34                       ` Henrique de Moraes Holschuh
2007-02-22 17:08                         ` Richard Purdie
2007-02-21 23:51         ` Alex Romosan
2007-02-22  1:13           ` James Simmons
2007-02-22  9:56             ` Richard Purdie
2007-02-22 14:38               ` Henrique de Moraes Holschuh
2007-02-22  4:03         ` Alex Romosan
2007-02-22  4:58         ` Alex Romosan

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=20070222144511.GC25887@khazad-dum.debian.net \
    --to=hmh@hmh.eng.br \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rpurdie@rpsys.net \
    --subject='Re: ACPI: ibm-acpi: fix initial status of backlight device' \
    /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).