blob: 365fdca1b76f6919dc3de7817e1f478a6f2a2666 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Sébastien Szymanski77f29292017-03-07 14:33:25 +01002/*
Sébastien Szymanski30754ef2018-04-17 17:29:31 +02003 * Copyright (C) 2018 Armadeus Systems
Sébastien Szymanski77f29292017-03-07 14:33:25 +01004 */
5
Simon Glass52559322019-11-14 12:57:46 -07006#include <common.h>
7#include <init.h>
Sébastien Szymanski77f29292017-03-07 14:33:25 +01008#include <asm/arch/sys_proto.h>
9#include <asm/gpio.h>
Sébastien Szymanski77f29292017-03-07 14:33:25 +010010#include <asm/io.h>
Sébastien Szymanski77f29292017-03-07 14:33:25 +010011
Sébastien Szymanski77f29292017-03-07 14:33:25 +010012#ifdef CONFIG_VIDEO_MXS
Sébastien Szymanski77f29292017-03-07 14:33:25 +010013int setup_lcd(void)
14{
15 struct gpio_desc backlight;
16 int ret;
17
Sébastien Szymanski77f29292017-03-07 14:33:25 +010018 /* Set Brightness to high */
19 ret = dm_gpio_lookup_name("GPIO4_10", &backlight);
20 if (ret) {
21 printf("Cannot get GPIO4_10\n");
22 return ret;
23 }
24
25 ret = dm_gpio_request(&backlight, "backlight");
26 if (ret) {
27 printf("Cannot request GPIO4_10\n");
28 return ret;
29 }
30
31 dm_gpio_set_dir_flags(&backlight, GPIOD_IS_OUT);
32 dm_gpio_set_value(&backlight, 1);
33
34 return 0;
35}
36#endif
37
Sébastien Szymanski77f29292017-03-07 14:33:25 +010038int opos6ul_board_late_init(void)
39{
40#ifdef CONFIG_VIDEO_MXS
41 setup_lcd();
42#endif
43
44 return 0;
45}