mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: iw3gtf@arcor.de
To: barebox@lists.infradead.org
Subject: [PATCH 2/4] video/backlight-pwm: fix the value of 'brightness_max'.
Date: Thu, 14 Jul 2016 16:17:16 +0200	[thread overview]
Message-ID: <20160714141718.20121-3-iw3gtf@arcor.de> (raw)
In-Reply-To: <20160714141718.20121-1-iw3gtf@arcor.de>
In-Reply-To: <20160713051805.GZ20657@pengutronix.de>

The field pwm_backlight->backlight.brightness_max should be the maximum
allowed brightness value for the backlight, not the max index of the
array 'pwm_backlight->levels[]'.
---
 drivers/video/backlight-pwm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/backlight-pwm.c b/drivers/video/backlight-pwm.c
index 3024ec6..53cf4e9 100644
--- a/drivers/video/backlight-pwm.c
+++ b/drivers/video/backlight-pwm.c
@@ -160,7 +160,7 @@ static int pwm_backlight_parse_dt(struct device_d *dev,
 			return ret;
 
 		pwm_backlight->backlight.brightness_default = value;
-		pwm_backlight->backlight.brightness_max--;
+		pwm_backlight->backlight.brightness_max = pwm_backlight->scale;
 	}
 
 	pwm_backlight->enable_gpio = of_get_named_gpio_flags(node, "enable-gpios", 0, &flags);
-- 
2.9.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2016-07-14 14:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-11 11:51 problem configuring backlight brightness levels in device tree giorgio.nicole
2016-07-13  5:18 ` Sascha Hauer
2016-07-14 14:17   ` [PATCH 0/4] fixes some problems found in the backligth-pwm implementation iw3gtf
2016-07-14 14:17     ` [PATCH 1/4] video/backlight-pwm: fixed a loop index going out of range iw3gtf
2016-07-14 14:17     ` iw3gtf [this message]
2016-07-14 14:17     ` [PATCH 3/4] video/backlight-pwm: code readability improvement iw3gtf
2016-07-14 14:17     ` [PATCH 4/4] video/backlight-pwm: properly handle the case of an empty 'brightness-levels' in the device tree iw3gtf
2016-07-15  6:07     ` [PATCH 0/4] fixes some problems found in the backligth-pwm implementation Sascha Hauer
2016-07-25  8:37     ` Sascha Hauer

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=20160714141718.20121-3-iw3gtf@arcor.de \
    --to=iw3gtf@arcor.de \
    --cc=barebox@lists.infradead.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