mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Borislav Deianov <borislav@users.sourceforge.net>
To: David Zeuthen <david@fubar.dk>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ibm-acpi brightness fix
Date: Sun, 29 Jan 2006 19:28:44 -0800	[thread overview]
Message-ID: <20060130032844.GF2271@aero.ensim.com> (raw)
In-Reply-To: <1138558472.9858.23.camel@daxter.boston.redhat.com>

Hi David,

On Sun, Jan 29, 2006 at 01:14:31PM -0500, David Zeuthen wrote:
> 
> The ibm-acpi driver allows user space to set the brightness of the
> display but the way it currently works is by fading from one of the
> eight levels to the other. While this effect is visually pleasing it's
> probably best taken care of by user space itself (and users of
> gnome-power-manager will notice that this is exactly what it does).

Thanks for the patch. Unfortunately, the fading is required on my X40 -
setting a random brightness value just doesn't work without it. The
EC probably expects it to happen that way since you can only go one
step up or down with the hot keys.

Wishes,
Boris



> 
> This patch removes the fading. Patch is against ibm-acpi 0.11 but it
> also applies to the drivers/acpi/ibm_acpi.c file in Linus' tree. I've
> tested this on a IBM Thinkpad T41. Please apply.
> 
> (Please keep me in the Cc - I'm not subscribed to the LKML)
> 
>     David
> 
> Signed-Off-By: David Zeuthen <david@fubar.dk>
> 
> --- ibm-acpi-0.11.orig/ibm_acpi.c	2005-03-17 05:06:16.000000000 -0500
> +++ ibm-acpi-0.11/ibm_acpi.c	2006-01-29 12:55:53.000000000 -0500
> @@ -1351,7 +1351,7 @@ static int brightness_read(char *p)
>  
>  static int brightness_write(char *buf)
>  {
> -	int cmos_cmd, inc, i;
> +	int cmos_cmd;
>  	u8 level;
>  	int new_level;
>  	char *cmd;
> @@ -1372,13 +1372,11 @@ static int brightness_write(char *buf)
>  			return -EINVAL;
>  
>  		cmos_cmd = new_level > level ? BRIGHTNESS_UP : BRIGHTNESS_DOWN;
> -		inc = new_level > level ? 1 : -1;
> -		for (i = level; i != new_level; i += inc) {
> -			if (!cmos_eval(cmos_cmd))
> -				return -EIO;
> -			if (!acpi_ec_write(brightness_offset, i + inc))
> -				return -EIO;
> -		}
> +
> +		if (!cmos_eval(cmos_cmd))
> +			return -EIO;
> +		if (!acpi_ec_write(brightness_offset, new_level))
> +			return -EIO;
>  	}
>  
>  	return 0;

      reply	other threads:[~2006-01-30  3:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-29 18:14 David Zeuthen
2006-01-30  3:28 ` Borislav Deianov [this message]

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=20060130032844.GF2271@aero.ensim.com \
    --to=borislav@users.sourceforge.net \
    --cc=david@fubar.dk \
    --cc=linux-kernel@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

Powered by JetHome