blob: 58821c41a41b0337ee50daf37119e1514f52dfed [file] [log] [blame]
Amar752f4c42013-04-27 11:42:57 +05301/*
2 * Copyright (C) 2012 Samsung Electronics
3 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02004 * SPDX-License-Identifier: GPL-2.0+
Amar752f4c42013-04-27 11:42:57 +05305 */
6
7#include <common.h>
8#include <fdtdec.h>
9#include <asm/io.h>
10#include <errno.h>
11#include <i2c.h>
12#include <netdev.h>
13#include <spi.h>
14#include <asm/arch/cpu.h>
15#include <asm/arch/dwmmc.h>
16#include <asm/arch/gpio.h>
17#include <asm/arch/mmc.h>
18#include <asm/arch/pinmux.h>
19#include <asm/arch/power.h>
20#include <asm/arch/sromc.h>
21#include <power/pmic.h>
22#include <power/max77686_pmic.h>
23#include <tmu.h>
24
25DECLARE_GLOBAL_DATA_PTR;
26
Amar752f4c42013-04-27 11:42:57 +053027#ifdef CONFIG_SOUND_MAX98095
Rajeshwari Birje71ebb332013-12-26 09:44:17 +053028static void board_enable_audio_codec(void)
Amar752f4c42013-04-27 11:42:57 +053029{
Amar752f4c42013-04-27 11:42:57 +053030 /* Enable MAX98095 Codec */
Akshay Saraswatf6ae1ca2014-05-13 10:30:14 +053031 gpio_direction_output(EXYNOS5_GPIO_X17, 1);
32 gpio_set_pull(EXYNOS5_GPIO_X17, S5P_GPIO_PULL_NONE);
Amar752f4c42013-04-27 11:42:57 +053033}
34#endif
35
Rajeshwari Birje71ebb332013-12-26 09:44:17 +053036int exynos_init(void)
Hung-ying Tyaneb28fda2013-05-15 18:27:34 +080037{
Amar752f4c42013-04-27 11:42:57 +053038#ifdef CONFIG_SOUND_MAX98095
39 board_enable_audio_codec();
40#endif
41 return 0;
42}
43
Amar752f4c42013-04-27 11:42:57 +053044#ifdef CONFIG_LCD
45void exynos_cfg_lcd_gpio(void)
46{
Amar752f4c42013-04-27 11:42:57 +053047 /* For Backlight */
Akshay Saraswatf6ae1ca2014-05-13 10:30:14 +053048 gpio_cfg_pin(EXYNOS5_GPIO_B20, S5P_GPIO_OUTPUT);
49 gpio_set_value(EXYNOS5_GPIO_B20, 1);
Amar752f4c42013-04-27 11:42:57 +053050
51 /* LCD power on */
Akshay Saraswatf6ae1ca2014-05-13 10:30:14 +053052 gpio_cfg_pin(EXYNOS5_GPIO_X15, S5P_GPIO_OUTPUT);
53 gpio_set_value(EXYNOS5_GPIO_X15, 1);
Amar752f4c42013-04-27 11:42:57 +053054
55 /* Set Hotplug detect for DP */
Akshay Saraswatf6ae1ca2014-05-13 10:30:14 +053056 gpio_cfg_pin(EXYNOS5_GPIO_X07, S5P_GPIO_FUNC(0x3));
Amar752f4c42013-04-27 11:42:57 +053057}
58
59void exynos_set_dp_phy(unsigned int onoff)
60{
61 set_dp_phy_ctrl(onoff);
62}
63#endif