[u-boot] backlight: get rid of rk_backlight_ctrl

Change-Id: Iac83d46428a93716d1e35ee512a9b53b2fb70f37
Signed-off-by: Firefly <service@t-firefly.com>
(cherry picked from commit b59e2c7f2188a8cd49e011aeb703459cc5abdfde)
This commit is contained in:
Firefly
2016-06-29 09:10:26 +08:00
committed by cjp
parent dac1c10703
commit 0867305d24
3 changed files with 25 additions and 14 deletions

View File

@ -26,8 +26,11 @@ extern void fbt_fastboot_init(void);
extern uint32 GetVbus(void);
extern void rkloader_change_cmd_for_recovery(PBootInfo boot_info , char * rec_cmd );
extern int checkKey(uint32* boot_rockusb, uint32* boot_recovery, uint32* boot_fastboot);
#ifdef CONFIG_RK_PWM_BL
extern int rk_pwm_bl_config(int brightness);
#endif
#ifdef CONFIG_LCD
extern void rk_backlight_ctrl(int brightness);
extern int lcd_enable_logo(bool enable);
extern int drv_lcd_init(void);
extern void lcd_standby(int enable);
@ -366,11 +369,16 @@ static void board_fbt_low_power_off(void)
lcd_standby(0);
//TODO: set backlight in better way.
rk_backlight_ctrl(CONFIG_BRIGHTNESS_DIM);
#ifdef CONFIG_RK_PWM_BL
rk_pwm_bl_config(CONFIG_BRIGHTNESS_DIM);
#endif
udelay(1000000);//1 sec
rk_backlight_ctrl(0);
#ifdef CONFIG_RK_PWM_BL
rk_pwm_bl_config(0);
#endif
lcd_standby(1);
#endif
shut_down();
@ -457,7 +465,10 @@ void board_fbt_preboot(void)
//lcd_enable_logo(true);
lcd_standby(0);
//mdelay(100);
rk_backlight_ctrl(-1); /*use defaut brightness in dts*/
#ifdef CONFIG_RK_PWM_BL
/* use defaut brightness in dts */
rk_pwm_bl_config(-1);
#endif
}
#endif

View File

@ -59,7 +59,9 @@
extern int rkkey_power_state(void);
extern int is_charging(void);
extern int pmic_charger_setting(int current);
extern void rk_backlight_ctrl(int brightness);
#ifdef CONFIG_RK_PWM_BL
extern int rk_pwm_bl_config(int brightness);
#endif
extern void lcd_standby(int enable);
extern uint32 rk_timer1_get_curr_count(void);
extern int rk818_regulator_enable(int num_regulator);
@ -173,9 +175,14 @@ void do_set_brightness(int brightness, int old_brightness) {
lcd_standby(0);
mdelay(100);
}
rk_backlight_ctrl(brightness == SCREEN_BRIGHT ? -1 : CONFIG_BRIGHTNESS_DIM);
#ifdef CONFIG_RK_PWM_BL
rk_pwm_bl_config(brightness == SCREEN_BRIGHT ? -1 : CONFIG_BRIGHTNESS_DIM);
#endif
} else {
rk_backlight_ctrl(0);
#ifdef CONFIG_RK_PWM_BL
rk_pwm_bl_config(0);
#endif
if (IS_BRIGHT(old_brightness)) {
lcd_standby(1);
}

View File

@ -143,13 +143,6 @@ void rk_fb_vidinfo_to_screen(vidinfo_t *vid, struct rk_screen *screen)
screen->y_mirror = 0;
}
void rk_backlight_ctrl(int brightness)
{
#ifdef CONFIG_RK_PWM_BL
rk_pwm_bl_config(brightness);
#endif
}
#ifdef CONFIG_OF_LIBFDT
int rk_fb_find_lcdc_node_dt(struct rockchip_fb *fb,
const void *blob)