arm: tegra: panels: sd update bl after linear bl adjustments
Mitch Luban [Wed, 17 Oct 2012 17:47:29 +0000 (10:47 -0700)]
Smart dimmer assumes a linear backlight. Therefore,
we should be applying smart dimmer backlight adjustments
after we do linear backlight correction.

Bug 1047558

Change-Id: I9a4705b752fddaf647ac566e9dc07636a2069dbc
Signed-off-by: Mitch Luban <mluban@nvidia.com>
Reviewed-on: http://git-master/r/161818
Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>

arch/arm/mach-tegra/board-cardhu-panel.c
arch/arm/mach-tegra/board-dalmore-panel.c
arch/arm/mach-tegra/board-enterprise-panel.c
arch/arm/mach-tegra/board-kai-panel.c
arch/arm/mach-tegra/board-pluto-panel.c

index 419d995..9b6ebdd 100644 (file)
@@ -244,9 +244,6 @@ static int cardhu_backlight_notify(struct device *unused, int brightness)
                gpio_set_value(e1506_bl_enb, !!brightness);
        }
 
-       /* SD brightness is a percentage, 8-bit value. */
-       brightness = (brightness * cur_sd_brightness) / 255;
-
        /* Apply any backlight response curve */
        if (brightness > 255) {
                pr_info("Error: Brightness > 255!\n");
@@ -254,6 +251,9 @@ static int cardhu_backlight_notify(struct device *unused, int brightness)
                brightness = bl_output[brightness];
        }
 
+       /* SD brightness is a percentage, 8-bit value. */
+       brightness = (brightness * cur_sd_brightness) / 255;
+
        return brightness;
 }
 
index 92b2d8e..f227a6f 100644 (file)
@@ -834,15 +834,15 @@ static int dalmore_disp1_bl_notify(struct device *unused, int brightness)
 {
        int cur_sd_brightness = atomic_read(&sd_brightness);
 
-       /* SD brightness is a percentage */
-       brightness = (brightness * cur_sd_brightness) / 255;
-
        /* Apply any backlight response curve */
        if (brightness > 255)
                pr_info("Error: Brightness > 255!\n");
        else
                brightness = bl_output[brightness];
 
+       /* SD brightness is a percentage */
+       brightness = (brightness * cur_sd_brightness) / 255;
+
        return brightness;
 }
 
index bb4612e..4ecc60e 100644 (file)
@@ -193,15 +193,15 @@ static int enterprise_backlight_notify(struct device *unused, int brightness)
 {
        int cur_sd_brightness = atomic_read(&sd_brightness);
 
-       /* SD brightness is a percentage, 8-bit value. */
-       brightness = (brightness * cur_sd_brightness) / 255;
-
        /* Apply any backlight response curve */
        if (brightness > 255)
                pr_info("Error: Brightness > 255!\n");
        else
                brightness = bl_output[brightness];
 
+       /* SD brightness is a percentage, 8-bit value. */
+       brightness = (brightness * cur_sd_brightness) / 255;
+
        return brightness;
 }
 
index ec73d2f..6da8581 100644 (file)
@@ -139,15 +139,15 @@ static int kai_backlight_notify(struct device *unused, int brightness)
        /* Set the backlight GPIO pin mode to 'backlight_enable' */
        gpio_set_value(kai_bl_enb, !!brightness);
 
-       /* SD brightness is a percentage, 8-bit value. */
-       brightness = (brightness * cur_sd_brightness) / 255;
-
        /* Apply any backlight response curve */
        if (brightness > 255)
                pr_info("Error: Brightness > 255!\n");
        else
                brightness = bl_output[brightness];
 
+       /* SD brightness is a percentage, 8-bit value. */
+       brightness = (brightness * cur_sd_brightness) / 255;
+
        return brightness;
 }
 
index dd5ea21..173c1f2 100644 (file)
@@ -906,15 +906,15 @@ static int __maybe_unused pluto_disp1_bl_notify(struct device *unused,
 {
        int cur_sd_brightness = atomic_read(&sd_brightness);
 
-       /* SD brightness is a percentage */
-       brightness = (brightness * cur_sd_brightness) / 255;
-
        /* Apply any backlight response curve */
        if (brightness > 255)
                pr_info("Error: Brightness > 255!\n");
        else
                brightness = bl_output[brightness];
 
+       /* SD brightness is a percentage */
+       brightness = (brightness * cur_sd_brightness) / 255;
+
        return brightness;
 }