linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Aristeu Sergio Rozanski Filho <aris@valeta.org>
To: linux-fbdev-devel@lists.sourceforge.net
Subject: [PATCH] nvidiafb: fix nvidia_bl_get_level_brightness() calc
Date: Mon, 3 Jul 2006 22:39:37 -0300	[thread overview]
Message-ID: <20060704013937.GH27596@cathedrallabs.org> (raw)

nvidiafb: fix nvidia_bl_get_level_brightness() level calc

Signed-off-by: Aristeu S. Rozanski F. <aris@valeta.org>

Index: ppc-2.6/drivers/video/nvidia/nv_backlight.c
===================================================================
--- ppc-2.6.orig/drivers/video/nvidia/nv_backlight.c	2006-07-03 17:38:06.000000000 -0300
+++ ppc-2.6/drivers/video/nvidia/nv_backlight.c	2006-07-03 20:11:08.000000000 -0300
@@ -26,6 +26,7 @@
  */
 #define MIN_LEVEL 0x158
 #define MAX_LEVEL 0x534
+#define LEVEL_STEP ((MAX_LEVEL - MIN_LEVEL) / FB_BACKLIGHT_MAX)
 
 static struct backlight_properties nvidia_bl_data;
 
@@ -37,7 +38,7 @@
 
 	/* Get and convert the value */
 	mutex_lock(&info->bl_mutex);
-	nlevel = info->bl_curve[level] * FB_BACKLIGHT_MAX / MAX_LEVEL;
+	nlevel = MIN_LEVEL + info->bl_curve[level] * LEVEL_STEP;
 	mutex_unlock(&info->bl_mutex);
 
 	if (nlevel < 0)


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

             reply	other threads:[~2006-07-04  1:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-04  1:39 Aristeu Sergio Rozanski Filho [this message]
2006-07-08 11:51 ` [PATCH] nvidiafb: fix nvidia_bl_get_level_brightness() calc Michael Hanselmann

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=20060704013937.GH27596@cathedrallabs.org \
    --to=aris@valeta.org \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    /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;
as well as URLs for NNTP newsgroup(s).