2 * Copyright (C) 2009 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 /*******************************************************************************
21 * hdmi_customization.h
29 * This file implements Customization base function
31 *******************************************************************************/
33 #include <cust_gpio_usage.h>
34 #include <hdmi_cust.h>
35 #include <mach/mt_gpio.h>
37 /******************************************************************
39 ******************************************************************/
41 #define s32 signed int
44 #define s64 signed long long
47 static bool cust_power_on
= false;
48 int cust_hdmi_power_on(int on
)
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)
60 hwPowerOn(PMIC_APP_MHL_POWER_LDO1, VOL_1200,"MHL");
64 printk("Error: PMIC_APP_MHL_POWER_LDO1 not defined -\n" );
69 #ifdef PMIC_APP_MHL_POWER_LDO1
70 if(cust_power_on == true)
72 hwPowerDown(PMIC_APP_MHL_POWER_LDO1, "MHL");
73 cust_power_on = false;
82 int cust_hdmi_dpi_gpio_on(int on
)
85 unsigned int dpi_pin_start = 0;
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++)
91 mt_set_gpio_mode(dpi_pin_start, GPIO_MODE_01);
93 printk("%s, %d GPIO_EXT_DISP_DPI0_PIN is defined+ %x\n", __func__, __LINE__, GPIO_EXT_DISP_DPI0_PIN);
95 printk("%s,%d Error: GPIO_EXT_DISP_DPI0_PIN is not defined\n", __func__, __LINE__);
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++)
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);
109 printk("%s, %d GPIO_EXT_DISP_DPI0_PIN is defined- %x\n", __func__, __LINE__, GPIO_EXT_DISP_DPI0_PIN);
116 int cust_hdmi_i2s_gpio_on(int on
)
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);
126 printk("%s,%d Error. GPIO_MHL_I2S_OUT_WS_PIN is not defined\n", __func__, __LINE__);
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);
141 int get_hdmi_i2c_addr(void)
143 // return (SII_I2C_ADDR);
147 int get_hdmi_i2c_channel(void)
149 // return (HDMI_I2C_CHANNEL);