public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Stubbs <jasonbstubbs@gmail.com>
To: John Serock <john.serock@gmail.com>
Cc: gregkh@suse.de, platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Platform: Detect samsung laptop quirk when initial level is zero
Date: Thu, 13 Oct 2011 21:59:47 +1100	[thread overview]
Message-ID: <4E96C4A3.4070504@gmail.com> (raw)
In-Reply-To: <CAPjEYUJ6YtJGdhgxZioDaUbBm0-GWe4j1D5viE3S1zY+Pp+fjA@mail.gmail.com>

On 13/10/11 9:42 PM, John Serock wrote:
> From: John Serock <john.serock@gmail.com>
> 
> This patch depends on the "Platform: Brightness quirk for samsung
> laptop driver" patch from Jason Stubbs. This patch adds a check for an
> initial brightness level of 0; if the level is 0, this patch changes
> the brightness level to 1 before the driver attempts to detect the
> brightness quirk.
> 
> The Samsung N150 netbook experiences the brightness quirk. Without
> Jason's patch, the only brightness levels available on the N150 are 0,
> 1, and 8. This patch ensures that, when the initial brightness level
> is 0, the samsang-laptop driver detects the brightness quirk on the
> N150, thereby making brightness levels 0 through 8 available.
> 
> Signed-off-by: John Serock <john.serock@gmail.com>
> 
> ---
> diff -uprN a/drivers/platform/x86/samsung-laptop.c
> b/drivers/platform/x86/samsung-laptop.c
> --- a/drivers/platform/x86/samsung-laptop.c	2011-10-12 13:51:15.030779179 -0400
> +++ b/drivers/platform/x86/samsung-laptop.c	2011-10-12 13:51:32.746867045 -0400
> @@ -404,8 +404,9 @@ static int get_brightness(struct backlig
> 
>  static void check_for_stepping_quirk(void)
>  {
> -	u8 initial_level = read_brightness();
> +	u8 initial_level;
>  	u8 check_level;
> +	u8 orig_level = read_brightness();
> 
>  	/*
>  	 * Some laptops exhibit the strange behaviour of stepping toward
> @@ -414,6 +415,11 @@ static void check_for_stepping_quirk(voi
>  	 * around in set_brightness.
>  	 */
> 
> +	if (orig_level == 0)
> +		set_brightness(1);
> +
> +	initial_level = read_brightness();
> +
>  	if (initial_level <= 2)
>  		check_level = initial_level + 2;
>  	else
> @@ -427,7 +433,7 @@ static void check_for_stepping_quirk(voi
>  		pr_info("enabled workaround for brightness stepping quirk\n");
>  	}
> 
> -	set_brightness(initial_level);
> +	set_brightness(orig_level);
>  }
> 
>  static int update_status(struct backlight_device *bd)

Acked-by: Jason Stubbs <jasonbstubbs@gmail.com>

Thanks!

Regards,
Jason Stubbs

      reply	other threads:[~2011-10-13 10:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-13 10:42 [PATCH] Platform: Detect samsung laptop quirk when initial level is zero John Serock
2011-10-13 10:59 ` Jason Stubbs [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=4E96C4A3.4070504@gmail.com \
    --to=jasonbstubbs@gmail.com \
    --cc=gregkh@suse.de \
    --cc=john.serock@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@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