backlight: pwm_bl: set bl brightness 0 when reboot quiescent

Signed-off-by: Zorro Liu <lyx@rock-chips.com>
Change-Id: Idf24ba57198dfb404d36507e207069c542924eea
This commit is contained in:
Zorro Liu 2023-03-21 09:46:13 +08:00 committed by Tao Huang
parent c9e25627a9
commit 535756b972
1 changed files with 11 additions and 1 deletions

View File

@ -19,6 +19,11 @@
#include <linux/regulator/consumer.h>
#include <linux/slab.h>
static bool bl_quiescent;
module_param_named(quiescent, bl_quiescent, bool, 0600);
MODULE_PARM_DESC(quiescent,
"pwm bl quiescent when reboot quiescent [default=false]");
struct pwm_bl_data {
struct pwm_device *pwm;
struct device *dev;
@ -627,7 +632,12 @@ static int pwm_backlight_probe(struct platform_device *pdev)
data->dft_brightness = data->max_brightness;
}
bl->props.brightness = data->dft_brightness;
/* set brightness 0, when boot quiescent */
if (bl_quiescent)
bl->props.brightness = 0;
else
bl->props.brightness = data->dft_brightness;
bl->props.power = pwm_backlight_initial_power_state(pb);
backlight_update_status(bl);