From: Jinyoung Park <jinyoungp@nvidia.com>
To: Axel Lin <axel.lin@gmail.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Richard Purdie <rpurdie@rpsys.net>
Subject: Re: backlight: aat2870_bl: questions about setting max_current
Date: Wed, 6 Jul 2011 16:41:37 +0900 [thread overview]
Message-ID: <4E1411B1.8020102@nvidia.com> (raw)
In-Reply-To: <1309935342.6088.5.camel@phoenix>
Hi, Axel
> 1. Seems the implementation tests wrong value for setting
aat2870_bl->max_current.
> I think you mean:
Right, that's my mean. This is my mistyping bug.
> 2. Even above issue is fixed, you still cannot differentiate below 2
cases:
> a) if pdata->max_current is not set , or
> b) pdata->max_current is set to AAT2870_CURRENT_0_45 ( which
is also 0 ).
> In either case, current implementation will set max_current to
AAT2870_CURRENT_27_9.
I didn't find it when verifying driver on real device and my self review.
Thanks for your kindly review.
Below is fixed codes. How about this change?
If there is no problem, could you submit this change with first change
as one patch?
because two changes are related.
diff --git a/drivers/video/backlight/aat2870_bl.c
b/drivers/video/backlight/aat2870_bl.c
index 4952a61..c0e2ce7 100644
--- a/drivers/video/backlight/aat2870_bl.c
+++ b/drivers/video/backlight/aat2870_bl.c
@@ -44,7 +44,7 @@ static inline int aat2870_brightness(struct
aat2870_bl_driver_data *aat2870_bl,
struct backlight_device *bd = aat2870_bl->bd;
int val;
- val = brightness * aat2870_bl->max_current;
+ val = brightness * (aat2870_bl->max_current - 1);
val /= bd->props.max_brightness;
return val;
diff --git a/include/linux/mfd/aat2870.h b/include/linux/mfd/aat2870.h
index 89212df..f8b7e8e 100644
--- a/include/linux/mfd/aat2870.h
+++ b/include/linux/mfd/aat2870.h
@@ -89,6 +89,7 @@ enum aat2870_id {
/* Backlight current magnitude (mA) */
enum aat2870_current {
+ AAT2870_CURRENT_0_00,
AAT2870_CURRENT_0_45,
AAT2870_CURRENT_0_90,
AAT2870_CURRENT_1_80,
Thanks,
Jin.
next prev parent reply other threads:[~2011-07-06 7:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-06 6:55 backlight: aat2870_bl: questions about setting max_current Axel Lin
2011-07-06 7:41 ` Jinyoung Park [this message]
2011-07-06 7:50 ` Axel Lin
2011-07-06 8:19 ` Jinyoung Park
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=4E1411B1.8020102@nvidia.com \
--to=jinyoungp@nvidia.com \
--cc=axel.lin@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rpurdie@rpsys.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