Skip to content

Commit 70d74b1

Browse files
flar2DhineshCool
authored andcommitted
drm: msm: add backlight dimmer option
Allows setting backlight all the way down to 1
1 parent 35dfee5 commit 70d74b1

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

drivers/gpu/drm/msm/dsi-staging/dsi_backlight.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
#define BL_STATE_LP2 BL_CORE_DRIVER2
3636
#define BL_HBM 1023
3737

38+
bool backlight_dimmer = 0;
39+
module_param(backlight_dimmer, bool, 0644);
40+
3841
static int hbm_enable = 0;
3942
static struct dsi_backlight_config *bl_g;
4043
static struct device *fb0_device;
@@ -192,7 +195,7 @@ static u32 dsi_backlight_calculate_normal(struct dsi_backlight_config *bl,
192195
/* map UI brightness into driver backlight level rounding it */
193196
rc = dsi_backlight_lerp(
194197
1, bl->brightness_max_level,
195-
bl->bl_min_level ? : 1, bl->bl_max_level,
198+
backlight_dimmer ? 1 : bl->bl_min_level, bl->bl_max_level,
196199
brightness, &bl_lvl);
197200
if (unlikely(rc))
198201
pr_err("failed to linearly interpolate, brightness unmodified\n");

0 commit comments

Comments
 (0)