summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJin Park <jinyoungp@nvidia.com>2011-08-19 20:34:53 +0900
committerVarun Colbert <vcolbert@nvidia.com>2011-08-19 15:43:39 -0700
commitef5ba3b908b45daf37076bc33b9815660bb420c5 (patch)
tree88c36c0ef6d4f6e491f5a94b6a25cd29d637268a
parent9d9d681ecdabd68ff4636b391e478423292e5112 (diff)
backlight: aat2870: Fix max_current setting
In the current implementation, if pdata->max_current is not set or AAT2870_CURRENT_0_45, it makes same result. Signed-off-by: Jin Park <jinyoungp@nvidia.com> Change-Id: I8ba17e92b81cd0e5668e583da48eaa56a57a09cf Reviewed-on: http://git-master/r/48138 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com>
-rw-r--r--drivers/video/backlight/aat2870_bl.c4
-rw-r--r--include/linux/mfd/aat2870.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/video/backlight/aat2870_bl.c b/drivers/video/backlight/aat2870_bl.c
index 8b683858e924..305c57528eee 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;
@@ -174,7 +174,7 @@ static int aat2870_bl_probe(struct platform_device *pdev)
else
aat2870_bl->channels = AAT2870_BL_CH_ALL;
- if (pdata->max_brightness > 0)
+ if (pdata->max_current > 0)
aat2870_bl->max_current = pdata->max_current;
else
aat2870_bl->max_current = AAT2870_CURRENT_27_9;
diff --git a/include/linux/mfd/aat2870.h b/include/linux/mfd/aat2870.h
index 89212df05622..f7316c29bdec 100644
--- a/include/linux/mfd/aat2870.h
+++ b/include/linux/mfd/aat2870.h
@@ -89,7 +89,7 @@ enum aat2870_id {
/* Backlight current magnitude (mA) */
enum aat2870_current {
- AAT2870_CURRENT_0_45,
+ AAT2870_CURRENT_0_45 = 1,
AAT2870_CURRENT_0_90,
AAT2870_CURRENT_1_80,
AAT2870_CURRENT_2_70,