Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Sébastien Szymanski | 77f2929 | 2017-03-07 14:33:25 +0100 | [diff] [blame] | 2 | /* |
Sébastien Szymanski | 30754ef | 2018-04-17 17:29:31 +0200 | [diff] [blame] | 3 | * Copyright (C) 2018 Armadeus Systems |
Sébastien Szymanski | 77f2929 | 2017-03-07 14:33:25 +0100 | [diff] [blame] | 4 | */ |
| 5 | |
Simon Glass | 5255932 | 2019-11-14 12:57:46 -0700 | [diff] [blame] | 6 | #include <common.h> |
| 7 | #include <init.h> |
Sébastien Szymanski | 77f2929 | 2017-03-07 14:33:25 +0100 | [diff] [blame] | 8 | #include <asm/arch/sys_proto.h> |
| 9 | #include <asm/gpio.h> |
Sébastien Szymanski | 77f2929 | 2017-03-07 14:33:25 +0100 | [diff] [blame] | 10 | #include <asm/io.h> |
Sébastien Szymanski | 77f2929 | 2017-03-07 14:33:25 +0100 | [diff] [blame] | 11 | |
Sébastien Szymanski | 77f2929 | 2017-03-07 14:33:25 +0100 | [diff] [blame] | 12 | #ifdef CONFIG_VIDEO_MXS |
Sébastien Szymanski | 77f2929 | 2017-03-07 14:33:25 +0100 | [diff] [blame] | 13 | int setup_lcd(void) |
| 14 | { |
| 15 | struct gpio_desc backlight; |
| 16 | int ret; |
| 17 | |
Sébastien Szymanski | 77f2929 | 2017-03-07 14:33:25 +0100 | [diff] [blame] | 18 | /* 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 Szymanski | 77f2929 | 2017-03-07 14:33:25 +0100 | [diff] [blame] | 38 | int opos6ul_board_late_init(void) |
| 39 | { |
| 40 | #ifdef CONFIG_VIDEO_MXS |
| 41 | setup_lcd(); |
| 42 | #endif |
| 43 | |
| 44 | return 0; |
| 45 | } |