blob: 5b25545cdb8839845599c81bfaadc7622c0004e3 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Sébastien Szymanskia7762e42017-03-07 14:33:25 +01002/*
Sébastien Szymanski1f29ce52018-04-17 17:29:31 +02003 * Copyright (C) 2018 Armadeus Systems
Sébastien Szymanskia7762e42017-03-07 14:33:25 +01004 */
5
Simon Glassa7b51302019-11-14 12:57:46 -07006#include <init.h>
Sébastien Szymanskia7762e42017-03-07 14:33:25 +01007#include <asm/arch/sys_proto.h>
8#include <asm/gpio.h>
Sébastien Szymanskia7762e42017-03-07 14:33:25 +01009#include <asm/io.h>
Sébastien Szymanskia7762e42017-03-07 14:33:25 +010010
Sébastien Szymanskia7762e42017-03-07 14:33:25 +010011#ifdef CONFIG_VIDEO_MXS
Sébastien Szymanskia7762e42017-03-07 14:33:25 +010012int setup_lcd(void)
13{
14 struct gpio_desc backlight;
15 int ret;
16
Sébastien Szymanskia7762e42017-03-07 14:33:25 +010017 /* 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
Sébastien Szymanskia7762e42017-03-07 14:33:25 +010037int opos6ul_board_late_init(void)
38{
39#ifdef CONFIG_VIDEO_MXS
40 setup_lcd();
41#endif
42
43 return 0;
44}