import PULS_20160108
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / arch / arm / mach-mt8127 / tcl8127_tb_c_l / hdmi / hdmi_cust.c
1 /*
2 * Copyright (C) 2009 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 /*******************************************************************************
18 *
19 * Filename:
20 * ---------
21 * hdmi_customization.h
22 *
23 * Project:
24 * --------
25 * Android
26 *
27 * Description:
28 * ------------
29 * This file implements Customization base function
30 *
31 *******************************************************************************/
32
33 #include <cust_gpio_usage.h>
34 #include <hdmi_cust.h>
35 #include <mach/mt_gpio.h>
36
37 /******************************************************************
38 ** Basic define
39 ******************************************************************/
40 #ifndef s32
41 #define s32 signed int
42 #endif
43 #ifndef s64
44 #define s64 signed long long
45 #endif
46
47 static bool cust_power_on = false;
48 int cust_hdmi_power_on(int on)
49 {
50 /*
51 if(on > 0)
52 {
53 printk("MHL_Power power %x, rst %x \n" ,GPIO_MHL_POWER_CTRL_PIN, GPIO_MHL_RST_B_PIN);
54 mt_set_gpio_mode(GPIO_MHL_POWER_CTRL_PIN, GPIO_MODE_00);
55 mt_set_gpio_dir(GPIO_MHL_POWER_CTRL_PIN, GPIO_DIR_OUT);
56 mt_set_gpio_out(GPIO_MHL_POWER_CTRL_PIN, GPIO_OUT_ONE);
57 #ifdef PMIC_APP_MHL_POWER_LDO1
58 if(cust_power_on == false)
59 {
60 hwPowerOn(PMIC_APP_MHL_POWER_LDO1, VOL_1200,"MHL");
61 cust_power_on = true;
62 }
63 #else
64 printk("Error: PMIC_APP_MHL_POWER_LDO1 not defined -\n" );
65 #endif
66 }
67 else
68 {
69 #ifdef PMIC_APP_MHL_POWER_LDO1
70 if(cust_power_on == true)
71 {
72 hwPowerDown(PMIC_APP_MHL_POWER_LDO1, "MHL");
73 cust_power_on = false;
74 }
75 #endif
76 }
77 */
78 return 0;
79 }
80
81
82 int cust_hdmi_dpi_gpio_on(int on)
83 {
84 /*
85 unsigned int dpi_pin_start = 0;
86 if(on > 0)
87 {
88 #ifdef GPIO_EXT_DISP_DPI0_PIN
89 for(dpi_pin_start = GPIO_EXT_DISP_DPI0_PIN; dpi_pin_start < GPIO_EXT_DISP_DPI0_PIN + 16; dpi_pin_start++)
90 {
91 mt_set_gpio_mode(dpi_pin_start, GPIO_MODE_01);
92 }
93 printk("%s, %d GPIO_EXT_DISP_DPI0_PIN is defined+ %x\n", __func__, __LINE__, GPIO_EXT_DISP_DPI0_PIN);
94 #else
95 printk("%s,%d Error: GPIO_EXT_DISP_DPI0_PIN is not defined\n", __func__, __LINE__);
96 #endif
97
98 }
99 else
100 {
101 #ifdef GPIO_EXT_DISP_DPI0_PIN
102 for(dpi_pin_start = GPIO_EXT_DISP_DPI0_PIN; dpi_pin_start < GPIO_EXT_DISP_DPI0_PIN + 16; dpi_pin_start++)
103 {
104 mt_set_gpio_mode(dpi_pin_start, GPIO_MODE_00);
105 mt_set_gpio_dir(dpi_pin_start, GPIO_DIR_IN);
106 mt_set_gpio_pull_enable(dpi_pin_start, GPIO_PULL_ENABLE);
107 mt_set_gpio_pull_select(dpi_pin_start, GPIO_PULL_DOWN);
108 }
109 printk("%s, %d GPIO_EXT_DISP_DPI0_PIN is defined- %x\n", __func__, __LINE__, GPIO_EXT_DISP_DPI0_PIN);
110 #endif
111 }
112 */
113 return 0;
114 }
115
116 int cust_hdmi_i2s_gpio_on(int on)
117 {
118 /*
119 if(on > 0)
120 {
121 #ifdef GPIO_MHL_I2S_OUT_WS_PIN
122 mt_set_gpio_mode(GPIO_MHL_I2S_OUT_WS_PIN, GPIO_MHL_I2S_OUT_WS_PIN_M_I2S3_WS);
123 mt_set_gpio_mode(GPIO_MHL_I2S_OUT_CK_PIN, GPIO_MHL_I2S_OUT_CK_PIN_M_I2S3_BCK);
124 mt_set_gpio_mode(GPIO_MHL_I2S_OUT_DAT_PIN, GPIO_MHL_I2S_OUT_DAT_PIN_M_I2S3_DO);
125 #else
126 printk("%s,%d Error. GPIO_MHL_I2S_OUT_WS_PIN is not defined\n", __func__, __LINE__);
127 #endif
128 }
129 else
130 {
131 #ifdef GPIO_MHL_I2S_OUT_WS_PIN
132 mt_set_gpio_pull_enable(GPIO_MHL_I2S_OUT_WS_PIN, GPIO_PULL_DISABLE);
133 mt_set_gpio_pull_enable(GPIO_MHL_I2S_OUT_CK_PIN, GPIO_PULL_DISABLE);
134 mt_set_gpio_pull_enable(GPIO_MHL_I2S_OUT_DAT_PIN, GPIO_PULL_DISABLE);
135 #endif
136 }
137 */
138 return 0;
139 }
140
141 int get_hdmi_i2c_addr(void)
142 {
143 // return (SII_I2C_ADDR);
144 return 0;
145 }
146
147 int get_hdmi_i2c_channel(void)
148 {
149 // return (HDMI_I2C_CHANNEL);
150 return 0;
151 }