Skip to content

Commit c89efb7

Browse files
committed
mach-tegra: board-grouper-panel.c: ensure auto min and slider min are the same
1 parent 48a358a commit c89efb7

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

arch/arm/mach-tegra/board-grouper-panel.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141

4242

4343
#include <linux/module.h>
44-
static unsigned int min_brightness = 13;
45-
module_param(min_brightness, uint, 0644);
44+
static unsigned int min_backlight = 13;
45+
module_param(min_backlight, uint, 0644);
4646

4747
/* grouper default display board pins */
4848
#define grouper_lvds_avdd_en TEGRA_GPIO_PH6
@@ -148,19 +148,24 @@ static void grouper_backlight_exit(struct device *dev)
148148
static int grouper_backlight_notify(struct device *unused, int brightness)
149149
{
150150
int cur_sd_brightness = atomic_read(&sd_brightness);
151+
int min_brightness = min_backlight;
151152

152153
/* Set the backlight GPIO pin mode to 'backlight_enable' */
153154
//gpio_set_value(grouper_bl_enb, !!brightness);
154155

155156
/* SD brightness is a percentage, 8-bit value. */
156157
brightness = (brightness * cur_sd_brightness) / 255;
157158

159+
/* Ensure that min backlight goes up to at least 10 to prevent auto-min != slider-min */
160+
if (min_backlight < 10)
161+
min_brightness = 10;
162+
158163
/* Apply any backlight response curve */
159164
if (brightness > 255)
160165
pr_info("Error: Brightness > 255!\n");
161166
else
162167
if ((brightness > 0) && (brightness < min_brightness)) {
163-
brightness = min_brightness;
168+
brightness = min_backlight;
164169
} else {
165170
brightness = bl_output[brightness];
166171
}

0 commit comments

Comments
 (0)