|
41 | 41 |
|
42 | 42 |
|
43 | 43 | #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); |
46 | 46 |
|
47 | 47 | /* grouper default display board pins */
|
48 | 48 | #define grouper_lvds_avdd_en TEGRA_GPIO_PH6
|
@@ -148,19 +148,24 @@ static void grouper_backlight_exit(struct device *dev)
|
148 | 148 | static int grouper_backlight_notify(struct device *unused, int brightness)
|
149 | 149 | {
|
150 | 150 | int cur_sd_brightness = atomic_read(&sd_brightness);
|
| 151 | + int min_brightness = min_backlight; |
151 | 152 |
|
152 | 153 | /* Set the backlight GPIO pin mode to 'backlight_enable' */
|
153 | 154 | //gpio_set_value(grouper_bl_enb, !!brightness);
|
154 | 155 |
|
155 | 156 | /* SD brightness is a percentage, 8-bit value. */
|
156 | 157 | brightness = (brightness * cur_sd_brightness) / 255;
|
157 | 158 |
|
| 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 | + |
158 | 163 | /* Apply any backlight response curve */
|
159 | 164 | if (brightness > 255)
|
160 | 165 | pr_info("Error: Brightness > 255!\n");
|
161 | 166 | else
|
162 | 167 | if ((brightness > 0) && (brightness < min_brightness)) {
|
163 |
| - brightness = min_brightness; |
| 168 | + brightness = min_backlight; |
164 | 169 | } else {
|
165 | 170 | brightness = bl_output[brightness];
|
166 | 171 | }
|
|
0 commit comments