mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
drivers/video/backlight/aat2870_bl.c: fix setting max_current
- Current implementation tests wrong value for setting aat2870_bl->max_current. - In the current implementation, we cannot differentiate between 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). Fix it by setting AAT2870_CURRENT_0_45 to be 1 and adjust the equation in aat2870_brightness() accordingly. Signed-off-by: Axel Lin <[email protected]> Cc: Richard Purdie <[email protected]> Cc: Samuel Ortiz <[email protected]> Tested-by: Jin Park <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
4c4dd903e7
commit
5d6f921b42
2 changed files with 3 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
@ -175,7 +175,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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue