diff options
author | Ian Ray <ian.ray@ge.com> | 2018-04-04 10:50:17 +0200 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2018-04-15 11:46:20 +0200 |
commit | 6c0e6b45f9bd4fdc795f4aec72dd13fd6fc6f617 (patch) | |
tree | add5c93cf1f6994dda2a59bb21a7ea4b0b788d11 | |
parent | 7a0ce1f7977b0ef8d853fee73238d0b3b34fbfed (diff) |
board: ge: bx50v3: enable backlight on demand
Enable display backlight only if a message needs to be displayed.
The kernel re-initializes the backlight, which results in some
unwanted artifacts.
Signed-off-by: Ian Ray <ian.ray@ge.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
-rw-r--r-- | board/ge/bx50v3/bx50v3.c | 45 | ||||
-rw-r--r-- | include/configs/ge_bx50v3.h | 1 |
2 files changed, 29 insertions, 17 deletions
diff --git a/board/ge/bx50v3/bx50v3.c b/board/ge/bx50v3/bx50v3.c index c7a29185bf..46321ae666 100644 --- a/board/ge/bx50v3/bx50v3.c +++ b/board/ge/bx50v3/bx50v3.c @@ -786,23 +786,6 @@ int board_late_init(void) add_board_boot_modes(board_boot_modes); #endif -#ifdef CONFIG_VIDEO_IPUV3 - /* We need at least 200ms between power on and backlight on - * as per specifications from CHI MEI */ - mdelay(250); - - /* enable backlight PWM 1 */ - pwm_init(0, 0, 0); - - /* duty cycle 5000000ns, period: 5000000ns */ - pwm_config(0, 5000000, 5000000); - - /* Backlight Power */ - gpio_direction_output(LVDS_BACKLIGHT_GP, 1); - - pwm_enable(0); -#endif - /* board specific pmic init */ pmic_init(); @@ -843,3 +826,31 @@ int checkboard(void) printf("BOARD: %s\n", CONFIG_BOARD_NAME); return 0; } + +static int do_backlight_enable(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +{ +#ifdef CONFIG_VIDEO_IPUV3 + /* We need at least 200ms between power on and backlight on + * as per specifications from CHI MEI */ + mdelay(250); + + /* enable backlight PWM 1 */ + pwm_init(0, 0, 0); + + /* duty cycle 5000000ns, period: 5000000ns */ + pwm_config(0, 5000000, 5000000); + + /* Backlight Power */ + gpio_direction_output(LVDS_BACKLIGHT_GP, 1); + + pwm_enable(0); +#endif + + return 0; +} + +U_BOOT_CMD( + bx50_backlight_enable, 1, 1, do_backlight_enable, + "enable Bx50 backlight", + "" +); diff --git a/include/configs/ge_bx50v3.h b/include/configs/ge_bx50v3.h index cbfe30d536..925507fe81 100644 --- a/include/configs/ge_bx50v3.h +++ b/include/configs/ge_bx50v3.h @@ -128,6 +128,7 @@ "swappartitions=" \ "setexpr partnum 3 - ${partnum}\0" \ "failbootcmd=" \ + "bx50_backlight_enable; " \ "msg=\"Monitor failed to start. Try again, or contact GE Service for support.\"; " \ "echo $msg; " \ "setenv stdout vga; " \ |