diff mbox series

[U-Boot,v2,02/41] board: ge: bx50v3: Fix run-time warning

Message ID 5c1ebe26065fa97ad00a006c40a18f40a56bb771.1571853833.git.bob.beckett@collabora.com
State Changes Requested
Delegated to: Stefano Babic
Headers show
Series convert GE boards to DM | expand

Commit Message

Robert Beckett Oct. 23, 2019, 6:21 p.m. UTC
From: Ian Ray <ian.ray@ge.com>

Fix GPIO reservation warning on code paths that do not need LVDS power.

Signed-off-by: Ian Ray <ian.ray@ge.com>
Signed-off-by: Robert Beckett <bob.beckett@collabora.com>
---
 board/ge/bx50v3/bx50v3.c | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)
diff mbox series

Patch

diff --git a/board/ge/bx50v3/bx50v3.c b/board/ge/bx50v3/bx50v3.c
index 917ecc4c18..499dcb3a61 100644
--- a/board/ge/bx50v3/bx50v3.c
+++ b/board/ge/bx50v3/bx50v3.c
@@ -704,20 +704,23 @@  int ft_board_setup(void *blob, bd_t *bd)
 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);
+	if (!is_b850v3()) {
+		/* 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);
+		/* enable backlight PWM 1 */
+		pwm_init(0, 0, 0);
 
-	/* duty cycle 5000000ns, period: 5000000ns */
-	pwm_config(0, 5000000, 5000000);
+		/* duty cycle 5000000ns, period: 5000000ns */
+		pwm_config(0, 5000000, 5000000);
 
-	/* Backlight Power */
-	gpio_direction_output(LVDS_BACKLIGHT_GP, 1);
+		/* Backlight Power */
+		gpio_direction_output(LVDS_BACKLIGHT_GP, 1);
 
-	pwm_enable(0);
+		pwm_enable(0);
+	}
 #endif
 
 	return 0;