Merge tag 'u-boot-imx-20191104' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
[oweals/u-boot.git] / board / armadeus / opos6uldev / board.c
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * Copyright (C) 2018 Armadeus Systems
4  */
5
6 #include <asm/arch/sys_proto.h>
7 #include <asm/gpio.h>
8 #include <asm/io.h>
9 #include <common.h>
10
11 #ifdef CONFIG_VIDEO_MXS
12 int setup_lcd(void)
13 {
14         struct gpio_desc backlight;
15         int ret;
16
17         /* Set Brightness to high */
18         ret = dm_gpio_lookup_name("GPIO4_10", &backlight);
19         if (ret) {
20                 printf("Cannot get GPIO4_10\n");
21                 return ret;
22         }
23
24         ret = dm_gpio_request(&backlight, "backlight");
25         if (ret) {
26                 printf("Cannot request GPIO4_10\n");
27                 return ret;
28         }
29
30         dm_gpio_set_dir_flags(&backlight, GPIOD_IS_OUT);
31         dm_gpio_set_value(&backlight, 1);
32
33         return 0;
34 }
35 #endif
36
37 int opos6ul_board_late_init(void)
38 {
39 #ifdef CONFIG_VIDEO_MXS
40         setup_lcd();
41 #endif
42
43         return 0;
44 }