blob: 82f607b24d9ae44f248fda7b4cad894f96e7b374 [file] [log] [blame]
Rajeshwari Birje5b475ae2013-12-26 09:44:24 +05301/*
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 Simonse6f55502014-12-05 18:12:22 +010012#include <parade.h>
Rajeshwari Birje5b475ae2013-12-26 09:44:24 +053013#include <spi.h>
Ajay Kumar222e1442014-09-05 16:53:36 +053014#include <errno.h>
Simon Glass37f11622014-10-20 19:48:37 -060015#include <asm/gpio.h>
Rajeshwari Birje5b475ae2013-12-26 09:44:24 +053016#include <asm/arch/board.h>
17#include <asm/arch/cpu.h>
Rajeshwari Birje5b475ae2013-12-26 09:44:24 +053018#include <asm/arch/pinmux.h>
Ajay Kumar222e1442014-09-05 16:53:36 +053019#include <asm/arch/system.h>
Rajeshwari Birje5b475ae2013-12-26 09:44:24 +053020#include <asm/arch/dp_info.h>
Ajay Kumar222e1442014-09-05 16:53:36 +053021#include <power/tps65090_pmic.h>
Rajeshwari Birje5b475ae2013-12-26 09:44:24 +053022
23DECLARE_GLOBAL_DATA_PTR;
24
Rajeshwari Birje5b475ae2013-12-26 09:44:24 +053025int exynos_init(void)
26{
Rajeshwari Birje5b475ae2013-12-26 09:44:24 +053027 return 0;
28}
29
30#ifdef CONFIG_LCD
Ajay Kumar222e1442014-09-05 16:53:36 +053031static int has_edp_bridge(void)
Rajeshwari Birje5b475ae2013-12-26 09:44:24 +053032{
Ajay Kumar222e1442014-09-05 16:53:36 +053033 int node;
Rajeshwari Birje5b475ae2013-12-26 09:44:24 +053034
Ajay Kumar222e1442014-09-05 16:53:36 +053035 node = fdtdec_next_compatible(gd->fdt_blob, 0, COMPAT_PARADE_PS8625);
Rajeshwari Birje5b475ae2013-12-26 09:44:24 +053036
Ajay Kumar222e1442014-09-05 16:53:36 +053037 /* No node for bridge in device tree. */
38 if (node <= 0)
39 return 0;
Rajeshwari Birje5b475ae2013-12-26 09:44:24 +053040
Ajay Kumar222e1442014-09-05 16:53:36 +053041 /* Default is with bridge ic */
42 return 1;
43}
Rajeshwari Birje5b475ae2013-12-26 09:44:24 +053044
Ajay Kumar222e1442014-09-05 16:53:36 +053045void exynos_lcd_power_on(void)
46{
47 int ret;
Rajeshwari Birje5b475ae2013-12-26 09:44:24 +053048
Ajay Kumar222e1442014-09-05 16:53:36 +053049#ifdef CONFIG_POWER_TPS65090
50 ret = tps65090_init();
51 if (ret < 0) {
52 printf("%s: tps65090_init() failed\n", __func__);
53 return;
54 }
Rajeshwari Birje5b475ae2013-12-26 09:44:24 +053055
Ajay Kumar222e1442014-09-05 16:53:36 +053056 tps65090_fet_enable(6);
57#endif
Rajeshwari Birje5b475ae2013-12-26 09:44:24 +053058
Ajay Kumar222e1442014-09-05 16:53:36 +053059 mdelay(5);
Rajeshwari Birje5b475ae2013-12-26 09:44:24 +053060
Ajay Kumar222e1442014-09-05 16:53:36 +053061 if (has_edp_bridge())
62 if (parade_init(gd->fdt_blob))
63 printf("%s: ps8625_init() failed\n", __func__);
64}
Rajeshwari Birje5b475ae2013-12-26 09:44:24 +053065
Ajay Kumar222e1442014-09-05 16:53:36 +053066void exynos_backlight_on(unsigned int onoff)
Rajeshwari Birje5b475ae2013-12-26 09:44:24 +053067{
Ajay Kumar222e1442014-09-05 16:53:36 +053068#ifdef CONFIG_POWER_TPS65090
69 tps65090_fet_enable(1);
70#endif
Rajeshwari Birje5b475ae2013-12-26 09:44:24 +053071}
72#endif
73
74int board_get_revision(void)
75{
76 return 0;
77}