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