static int __init sii9244_init(void) { int ret; sii9244_cfg_gpio(); #ifdef MHL_DEBUG printk(KERN_ERR "[SKY_MHL]+%s 3rd i2c_add_driver\n", __FUNCTION__); #endif ret = i2c_add_driver(&sii9244_i2c_driver); if (ret != 0) { pr_err("[MHL sii9244] can't add i2c driver\n"); } else{ #ifdef MHL_DEBUG printk("[MHL sii9244] add i2c driver\n"); #endif } ret = i2c_add_driver(&sii9244A_i2c_driver); if (ret != 0){ pr_err("[MHL sii9244A] can't add i2c driver\n"); } else{ #ifdef MHL_DEBUG printk("[MHL sii9244A] add i2c driver\n"); #endif } ret = i2c_add_driver(&sii9244B_i2c_driver); if (ret != 0){ pr_err("[MHL sii9244B] can't add i2c driver\n"); } else{ #ifdef MHL_DEBUG printk("[MHL sii9244B] add i2c driver\n"); #endif } ret = i2c_add_driver(&sii9244C_i2c_driver); if (ret != 0){ pr_err("[MHL sii9244C] can't add i2c driver\n"); } else{ #ifdef MHL_DEBUG printk("[MHL sii9244C] add i2c driver\n"); #endif } mhl_power_ctrl(1); sii9244_remote_control_init(); sii9244_cfg_power_init(); //Turn On power to sii9244 return ret; }
bool mhl_cable_connect(void) { int r; MHL_DEV_INFO("%s: in\n ", __func__); // pantech_hdmi_cable_detect(0);/*definitely off hdmi */ MHL_Set_Cable_State(MHL_CABLE_CONNCET); mhl_power_ctrl(1); msleep(10); MHL_On(1); // MHL_Cable_On(1); MHL_En_Control(1) ;// switch-MHL MHL_DEV_INFO( "!!!!!!!![SKY_MHL]%s MHL cable Connect\n",__func__); r = wait_event_timeout(mhl_disconnect_wait_queue, get_mhl_status()==MHL_CABLE_CONNECT ,msecs_to_jiffies(200)); MHL_DEV_INFO("get_mhl_status = %d", get_mhl_status()); MHL_DEV_INFO("get_mhl_rgnd_status=%d\n", get_mhl_rgnd_status()); MHL_DEV_INFO("get_mhl_power_mode=%d\n", get_mhl_power_mode()); if (!r && get_mhl_status() != MHL_CABLE_CONNECT) { wait_event_timeout(mhl_disconnect_wait_queue, 0 ,msecs_to_jiffies(100)); pr_err("get_mhl_status = %d", get_mhl_status()); if (!get_mhl_power_mode()){ pr_err("mhl is not ready to be operated\n"); MHL_DEV_INFO(" get_mhl_rgnd_status=%d", get_mhl_rgnd_status()); mhl_cable_disconnect(); return false; } } r = wait_event_timeout(mhl_disconnect_wait_queue, get_mhl_status()==MHL_DISCOVERY_SUCCESS ,msecs_to_jiffies(1500)); if (!r && get_mhl_status()!= MHL_DISCOVERY_SUCCESS ) { pr_err("get_mhl_status = %d", get_mhl_status()); /* for debug */ queue_delayed_work(mhl_ctrl_connect_work_queue, &mhl_ctrl_connect_work,10); return false; } return true; }
void mhl_cable_disconnect(void) { MHL_DEV_INFO("%s: in\n ", __func__); if(MHL_Get_Cable_State()){ MHL_DEV_INFO("%s: really in!!!!!! in\n ", __func__); MHL_Set_Cable_State(MHL_CABLE_DISCONNCET); set_mhl_ctrled_hpd_state(false); MHL_Cable_On(0); MHL_On(0); mhl_power_ctrl(0); MHL_En_Control(0) ;// switch-MHL // pantech_hdmi_cable_detect(0); MHL_DEV_INFO( "[SKY_MHL]%s MHL cable disConnect \n",__func__); } }
void mhl_cable_connect(struct work_struct *work) { if (HDMI_INP_ND(0x0000) & 0x00000001) { mhl_power_ctrl(1); msleep(10); MHL_On(1); MHL_En_Control(1) ;// switch-MHL MHL_Set_Cable_State(MHL_CABLE_CONNCET); #ifdef MHL_DEBUG printk(KERN_ERR "[SKY_MHL]%s MHL cable Connect \n",__func__); #endif return; } else { schedule_delayed_work(&sii9244_cable_connect_work.work, msecs_to_jiffies(100)); } return; }