]>
Commit | Line | Data |
---|---|---|
e106bd9b RS |
1 | /* |
2 | * Copyright (C) 2013 Samsung Electronics | |
3 | * | |
4 | * SPDX-License-Identifier: GPL-2.0+ | |
5 | */ | |
6 | ||
7 | #include <common.h> | |
8 | #include <fdtdec.h> | |
9 | #include <asm/io.h> | |
10 | #include <i2c.h> | |
11 | #include <lcd.h> | |
a7b99204 | 12 | #include <parade.h> |
e106bd9b | 13 | #include <spi.h> |
a99cea03 | 14 | #include <errno.h> |
903fd795 | 15 | #include <asm/gpio.h> |
e106bd9b RS |
16 | #include <asm/arch/board.h> |
17 | #include <asm/arch/cpu.h> | |
e106bd9b | 18 | #include <asm/arch/pinmux.h> |
a99cea03 | 19 | #include <asm/arch/system.h> |
e106bd9b | 20 | #include <asm/arch/dp_info.h> |
a99cea03 | 21 | #include <power/tps65090_pmic.h> |
e106bd9b RS |
22 | |
23 | DECLARE_GLOBAL_DATA_PTR; | |
24 | ||
e106bd9b RS |
25 | int exynos_init(void) |
26 | { | |
e106bd9b RS |
27 | return 0; |
28 | } | |
29 | ||
30 | #ifdef CONFIG_LCD | |
a99cea03 | 31 | static int has_edp_bridge(void) |
e106bd9b | 32 | { |
a99cea03 AK |
33 | int node; |
34 | ||
35 | node = fdtdec_next_compatible(gd->fdt_blob, 0, COMPAT_PARADE_PS8625); | |
e106bd9b | 36 | |
a99cea03 AK |
37 | /* No node for bridge in device tree. */ |
38 | if (node <= 0) | |
39 | return 0; | |
e106bd9b | 40 | |
a99cea03 AK |
41 | /* Default is with bridge ic */ |
42 | return 1; | |
e106bd9b RS |
43 | } |
44 | ||
a99cea03 | 45 | void exynos_lcd_power_on(void) |
e106bd9b | 46 | { |
a99cea03 AK |
47 | int ret; |
48 | ||
49 | #ifdef CONFIG_POWER_TPS65090 | |
50 | ret = tps65090_init(); | |
51 | if (ret < 0) { | |
52 | printf("%s: tps65090_init() failed\n", __func__); | |
53 | return; | |
54 | } | |
55 | ||
56 | tps65090_fet_enable(6); | |
57 | #endif | |
58 | ||
59 | mdelay(5); | |
60 | ||
61 | /* TODO(ajaykumar.rs@samsung.com): Use device tree */ | |
7f196101 | 62 | gpio_request(EXYNOS5420_GPIO_X35, "edp_slp#"); |
a99cea03 AK |
63 | gpio_direction_output(EXYNOS5420_GPIO_X35, 1); /* EDP_SLP# */ |
64 | mdelay(10); | |
7f196101 | 65 | gpio_request(EXYNOS5420_GPIO_Y77, "edp_rst#"); |
a99cea03 | 66 | gpio_direction_output(EXYNOS5420_GPIO_Y77, 1); /* EDP_RST# */ |
7f196101 | 67 | gpio_request(EXYNOS5420_GPIO_X26, "edp_hpd"); |
a99cea03 AK |
68 | gpio_direction_input(EXYNOS5420_GPIO_X26); /* EDP_HPD */ |
69 | gpio_set_pull(EXYNOS5420_GPIO_X26, S5P_GPIO_PULL_NONE); | |
e106bd9b | 70 | |
a99cea03 AK |
71 | if (has_edp_bridge()) |
72 | if (parade_init(gd->fdt_blob)) | |
73 | printf("%s: ps8625_init() failed\n", __func__); | |
74 | } | |
75 | ||
76 | void exynos_backlight_on(unsigned int onoff) | |
77 | { | |
78 | /* For PWM */ | |
7f196101 | 79 | gpio_request(EXYNOS5420_GPIO_B20, "backlight_on"); |
a99cea03 AK |
80 | gpio_cfg_pin(EXYNOS5420_GPIO_B20, S5P_GPIO_FUNC(0x1)); |
81 | gpio_set_value(EXYNOS5420_GPIO_B20, 1); | |
82 | ||
83 | #ifdef CONFIG_POWER_TPS65090 | |
84 | tps65090_fet_enable(1); | |
85 | #endif | |
e106bd9b RS |
86 | } |
87 | #endif | |
88 | ||
89 | int board_get_revision(void) | |
90 | { | |
91 | return 0; | |
92 | } |