Rajeshwari Birje | 5b475ae | 2013-12-26 09:44:24 +0530 | [diff] [blame] | 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> | ||||
Sjoerd Simons | e6f5550 | 2014-12-05 18:12:22 +0100 | [diff] [blame] | 12 | #include <parade.h> |
Rajeshwari Birje | 5b475ae | 2013-12-26 09:44:24 +0530 | [diff] [blame] | 13 | #include <spi.h> |
Ajay Kumar | 222e144 | 2014-09-05 16:53:36 +0530 | [diff] [blame] | 14 | #include <errno.h> |
Simon Glass | 37f1162 | 2014-10-20 19:48:37 -0600 | [diff] [blame] | 15 | #include <asm/gpio.h> |
Rajeshwari Birje | 5b475ae | 2013-12-26 09:44:24 +0530 | [diff] [blame] | 16 | #include <asm/arch/board.h> |
17 | #include <asm/arch/cpu.h> | ||||
Rajeshwari Birje | 5b475ae | 2013-12-26 09:44:24 +0530 | [diff] [blame] | 18 | #include <asm/arch/pinmux.h> |
Ajay Kumar | 222e144 | 2014-09-05 16:53:36 +0530 | [diff] [blame] | 19 | #include <asm/arch/system.h> |
Rajeshwari Birje | 5b475ae | 2013-12-26 09:44:24 +0530 | [diff] [blame] | 20 | #include <asm/arch/dp_info.h> |
Ajay Kumar | 222e144 | 2014-09-05 16:53:36 +0530 | [diff] [blame] | 21 | #include <power/tps65090_pmic.h> |
Rajeshwari Birje | 5b475ae | 2013-12-26 09:44:24 +0530 | [diff] [blame] | 22 | |
23 | DECLARE_GLOBAL_DATA_PTR; | ||||
24 | |||||
Rajeshwari Birje | 5b475ae | 2013-12-26 09:44:24 +0530 | [diff] [blame] | 25 | int exynos_init(void) |
26 | { | ||||
Rajeshwari Birje | 5b475ae | 2013-12-26 09:44:24 +0530 | [diff] [blame] | 27 | return 0; |
28 | } | ||||
29 | |||||
30 | #ifdef CONFIG_LCD | ||||
Ajay Kumar | 222e144 | 2014-09-05 16:53:36 +0530 | [diff] [blame] | 31 | static int has_edp_bridge(void) |
Rajeshwari Birje | 5b475ae | 2013-12-26 09:44:24 +0530 | [diff] [blame] | 32 | { |
Ajay Kumar | 222e144 | 2014-09-05 16:53:36 +0530 | [diff] [blame] | 33 | int node; |
Rajeshwari Birje | 5b475ae | 2013-12-26 09:44:24 +0530 | [diff] [blame] | 34 | |
Ajay Kumar | 222e144 | 2014-09-05 16:53:36 +0530 | [diff] [blame] | 35 | node = fdtdec_next_compatible(gd->fdt_blob, 0, COMPAT_PARADE_PS8625); |
Rajeshwari Birje | 5b475ae | 2013-12-26 09:44:24 +0530 | [diff] [blame] | 36 | |
Ajay Kumar | 222e144 | 2014-09-05 16:53:36 +0530 | [diff] [blame] | 37 | /* No node for bridge in device tree. */ |
38 | if (node <= 0) | ||||
39 | return 0; | ||||
Rajeshwari Birje | 5b475ae | 2013-12-26 09:44:24 +0530 | [diff] [blame] | 40 | |
Ajay Kumar | 222e144 | 2014-09-05 16:53:36 +0530 | [diff] [blame] | 41 | /* Default is with bridge ic */ |
42 | return 1; | ||||
43 | } | ||||
Rajeshwari Birje | 5b475ae | 2013-12-26 09:44:24 +0530 | [diff] [blame] | 44 | |
Ajay Kumar | 222e144 | 2014-09-05 16:53:36 +0530 | [diff] [blame] | 45 | void exynos_lcd_power_on(void) |
46 | { | ||||
47 | int ret; | ||||
Rajeshwari Birje | 5b475ae | 2013-12-26 09:44:24 +0530 | [diff] [blame] | 48 | |
Ajay Kumar | 222e144 | 2014-09-05 16:53:36 +0530 | [diff] [blame] | 49 | #ifdef CONFIG_POWER_TPS65090 |
50 | ret = tps65090_init(); | ||||
51 | if (ret < 0) { | ||||
52 | printf("%s: tps65090_init() failed\n", __func__); | ||||
53 | return; | ||||
54 | } | ||||
Rajeshwari Birje | 5b475ae | 2013-12-26 09:44:24 +0530 | [diff] [blame] | 55 | |
Ajay Kumar | 222e144 | 2014-09-05 16:53:36 +0530 | [diff] [blame] | 56 | tps65090_fet_enable(6); |
57 | #endif | ||||
Rajeshwari Birje | 5b475ae | 2013-12-26 09:44:24 +0530 | [diff] [blame] | 58 | |
Ajay Kumar | 222e144 | 2014-09-05 16:53:36 +0530 | [diff] [blame] | 59 | mdelay(5); |
Rajeshwari Birje | 5b475ae | 2013-12-26 09:44:24 +0530 | [diff] [blame] | 60 | |
Ajay Kumar | 222e144 | 2014-09-05 16:53:36 +0530 | [diff] [blame] | 61 | if (has_edp_bridge()) |
62 | if (parade_init(gd->fdt_blob)) | ||||
63 | printf("%s: ps8625_init() failed\n", __func__); | ||||
64 | } | ||||
Rajeshwari Birje | 5b475ae | 2013-12-26 09:44:24 +0530 | [diff] [blame] | 65 | |
Ajay Kumar | 222e144 | 2014-09-05 16:53:36 +0530 | [diff] [blame] | 66 | void exynos_backlight_on(unsigned int onoff) |
Rajeshwari Birje | 5b475ae | 2013-12-26 09:44:24 +0530 | [diff] [blame] | 67 | { |
Ajay Kumar | 222e144 | 2014-09-05 16:53:36 +0530 | [diff] [blame] | 68 | #ifdef CONFIG_POWER_TPS65090 |
69 | tps65090_fet_enable(1); | ||||
70 | #endif | ||||
Rajeshwari Birje | 5b475ae | 2013-12-26 09:44:24 +0530 | [diff] [blame] | 71 | } |
72 | #endif | ||||
73 | |||||
74 | int board_get_revision(void) | ||||
75 | { | ||||
76 | return 0; | ||||
77 | } |