* [U-Boot] [PATCHv1] board: ge: bx50v3: enable backlight on demand
@ 2018-03-09 14:41 Sebastian Reichel
2018-03-29 15:54 ` Stefano Babic
0 siblings, 1 reply; 2+ messages in thread
From: Sebastian Reichel @ 2018-03-09 14:41 UTC (permalink / raw)
To: u-boot
From: Ian Ray <ian.ray@ge.com>
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>
---
board/ge/bx50v3/bx50v3.c | 43 ++++++++++++++++++++++++++-----------------
include/configs/ge_bx50v3.h | 1 +
2 files changed, 27 insertions(+), 17 deletions(-)
diff --git a/board/ge/bx50v3/bx50v3.c b/board/ge/bx50v3/bx50v3.c
index c7a29185bf49..35efe159d598 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,29 @@ int checkboard(void)
printf("BOARD: %s\n", CONFIG_BOARD_NAME);
return 0;
}
+
+static int do_backlight_enable(void)
+{
+#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
+}
+
+U_BOOT_CMD(
+ bx50_backlight_enable, 1, 1, do_backlight_enable,
+ "enable Bx50 backlight",
+ "no parameters"
+);
diff --git a/include/configs/ge_bx50v3.h b/include/configs/ge_bx50v3.h
index cbfe30d536d0..925507fe81f1 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; " \
--
2.16.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [U-Boot] [PATCHv1] board: ge: bx50v3: enable backlight on demand
2018-03-09 14:41 [U-Boot] [PATCHv1] board: ge: bx50v3: enable backlight on demand Sebastian Reichel
@ 2018-03-29 15:54 ` Stefano Babic
0 siblings, 0 replies; 2+ messages in thread
From: Stefano Babic @ 2018-03-29 15:54 UTC (permalink / raw)
To: u-boot
On 09/03/2018 15:41, Sebastian Reichel wrote:
> From: Ian Ray <ian.ray@ge.com>
>
> 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>
> ---
> board/ge/bx50v3/bx50v3.c | 43 ++++++++++++++++++++++++++-----------------
> include/configs/ge_bx50v3.h | 1 +
> 2 files changed, 27 insertions(+), 17 deletions(-)
>
> diff --git a/board/ge/bx50v3/bx50v3.c b/board/ge/bx50v3/bx50v3.c
> index c7a29185bf49..35efe159d598 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,29 @@ int checkboard(void)
> printf("BOARD: %s\n", CONFIG_BOARD_NAME);
> return 0;
> }
> +
> +static int do_backlight_enable(void)
Function must return an int
> +{
> +#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);
No return value. This generates warning, please fix and repost - thanks.
Best regards,
Stefano Babic
> +#endif
> +}
> +
> +U_BOOT_CMD(
> + bx50_backlight_enable, 1, 1, do_backlight_enable,
> + "enable Bx50 backlight",
> + "no parameters"
> +);
> diff --git a/include/configs/ge_bx50v3.h b/include/configs/ge_bx50v3.h
> index cbfe30d536d0..925507fe81f1 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; " \
>
--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-03-29 15:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-09 14:41 [U-Boot] [PATCHv1] board: ge: bx50v3: enable backlight on demand Sebastian Reichel
2018-03-29 15:54 ` Stefano Babic
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.