Exemplo n.º 1
0
static void slimport_cable_plug_proc(struct anx7808_data *anx7808)
{
	int status = 0;

	if (gpio_get_value_cansleep(anx7808->gpio_cbl_det)) {
		/* debounce time for avoiding glitch */
		msleep(50);
		if (gpio_get_value_cansleep(anx7808->gpio_cbl_det)) {
			if (sp_tx_pd_mode) {
				/* first turn on hpd */
				if (anx7808->hdmi_sp_ops->set_upstream_hpd) {
					status = anx7808->hdmi_sp_ops->set_upstream_hpd(
							anx7808->hdmi_pdev, 1);
					if (status)
						pr_err("failed to turn on hpd\n");
				}
				sp_tx_hardware_poweron();
				sp_tx_power_on(SP_TX_PWR_REG);
				sp_tx_power_on(SP_TX_PWR_TOTAL);
				hdmi_rx_initialization();
				sp_tx_initialization();
				sp_tx_vbus_poweron();
				if (!sp_tx_get_cable_type(1)) {
					pr_err("AUX ERR\n");
					sp_tx_power_down_and_init();
					return;
				}
				sp_tx_rx_type_backup = sp_tx_rx_type;
			}

			switch (sp_tx_rx_type) {
			case RX_HDMI:
				if (sp_tx_get_hdmi_connection())
					sp_tx_set_sys_state(STATE_PARSE_EDID);
				break;
			case RX_DP:
				if (sp_tx_get_dp_connection())
					sp_tx_set_sys_state(STATE_PARSE_EDID);
				break;
			case RX_VGA_GEN:
				if (sp_tx_get_vga_connection())
					sp_tx_set_sys_state(STATE_PARSE_EDID);
				break;
			case RX_VGA_9832:
				if (sp_tx_get_vga_connection()) {
					sp_tx_send_message(MSG_CLEAR_IRQ);
					sp_tx_set_sys_state(STATE_PARSE_EDID);
				}
				break;
			case RX_NULL:
			default:
				break;
			}
		}
	} else if (sp_tx_pd_mode == 0) {
			sp_tx_power_down_and_init();
	}
}
Exemplo n.º 2
0
static void slimport_cable_plug_proc(struct anx7808_data *anx7808)
{
	struct anx7808_platform_data *pdata = anx7808->pdata;

	if (gpio_get_value_cansleep(pdata->gpio_cbl_det)) {
		mdelay(100);
		if (gpio_get_value_cansleep(pdata->gpio_cbl_det)) {
			if (sp_tx_pd_mode) {
				sp_tx_pd_mode = 0;
#ifdef CONFIG_SLIMPORT_DYNAMIC_HPD
				slimport_set_hdmi_hpd(1);
#endif
				sp_tx_hardware_poweron();
				sp_tx_power_on(SP_TX_PWR_REG);
				sp_tx_power_on(SP_TX_PWR_TOTAL);
				hdmi_rx_initialization();
				sp_tx_initialization();
				sp_tx_vbus_poweron();
				msleep(200);
				if (!sp_tx_get_cable_type()) {
					pr_err("%s %s:AUX ERR\n",
						   LOG_TAG, __func__);
					sp_tx_vbus_powerdown();
					sp_tx_power_down(SP_TX_PWR_REG);
					sp_tx_power_down(SP_TX_PWR_TOTAL);
					sp_tx_hardware_powerdown();
					sp_tx_pd_mode = 1;
					sp_tx_link_config_done = 0;
					sp_tx_hw_lt_enable = 0;
					sp_tx_hw_lt_done = 0;
					sp_tx_rx_type = RX_NULL;
					sp_tx_rx_type_backup = RX_NULL;
					sp_tx_set_sys_state(STATE_CABLE_PLUG);
					return;
				}
				sp_tx_rx_type_backup = sp_tx_rx_type;
			}
			switch (sp_tx_rx_type) {
			case RX_HDMI:
				if (sp_tx_get_hdmi_connection())
					sp_tx_set_sys_state(STATE_PARSE_EDID);
				break;
			case RX_DP:
				if (sp_tx_get_dp_connection())
					sp_tx_set_sys_state(STATE_PARSE_EDID);
				break;
			case RX_VGA_GEN:
				if (sp_tx_get_vga_connection())
					sp_tx_set_sys_state(STATE_PARSE_EDID);
				break;
			case RX_VGA_9832:
				if (sp_tx_get_vga_connection()) {
					sp_tx_send_message(MSG_CLEAR_IRQ);
					sp_tx_set_sys_state(STATE_PARSE_EDID);
				}
				break;
			case RX_NULL:
			default:
				break;
			}
		}
	} else if (sp_tx_pd_mode == 0) {
		sp_tx_vbus_powerdown();
		sp_tx_power_down(SP_TX_PWR_REG);
		sp_tx_power_down(SP_TX_PWR_TOTAL);
		sp_tx_hardware_powerdown();
		sp_tx_pd_mode = 1;
		sp_tx_link_config_done = 0;
		sp_tx_hw_lt_enable = 0;
		sp_tx_hw_lt_done = 0;
		sp_tx_rx_type = RX_NULL;
		sp_tx_rx_type_backup = RX_NULL;
		sp_tx_set_sys_state(STATE_CABLE_PLUG);
	}
}
Exemplo n.º 3
0
static void slimport_cable_plug_proc(struct anx7808_data *anx7808)
{

	if (gpio_get_value_cansleep(anx7808->pdata->gpio_cbl_det)) {
		msleep(50);
		if (gpio_get_value_cansleep(anx7808->pdata->gpio_cbl_det)) {
			if (sp_tx_pd_mode) {
				sp_tx_pd_mode = 0;
				sp_tx_hardware_poweron();
				sp_tx_power_on(SP_TX_PWR_REG);
				sp_tx_power_on(SP_TX_PWR_TOTAL);
#ifdef CONFIG_CHARGER_SMB345
				sp_tx_pull_down_id(TRUE);
#endif
				hdmi_rx_initialization();
				sp_tx_initialization();
				sp_tx_vbus_poweron();
				msleep(200);
				if (!sp_tx_get_cable_type()) {
					SP_DEV_ERR("%s:AUX ERR\n", __func__);
					sp_tx_vbus_powerdown();
#ifdef CONFIG_CHARGER_SMB345
					sp_tx_pull_down_id(FALSE);
#endif
					sp_tx_power_down(SP_TX_PWR_REG);
					sp_tx_power_down(SP_TX_PWR_TOTAL);
					sp_tx_hardware_powerdown();
					sp_tx_pd_mode = 1;
					sp_tx_link_config_done = 0;
					sp_tx_hw_lt_enable = 0;
					sp_tx_hw_lt_done = 0;
					sp_tx_rx_type = RX_NULL;
					sp_tx_rx_type_backup = RX_NULL;
					sp_tx_set_sys_state(STATE_CABLE_PLUG);
					return;
				}
				sp_tx_rx_type_backup = sp_tx_rx_type;
			}
			switch (sp_tx_rx_type) {
			case RX_HDMI:
				if (sp_tx_get_hdmi_connection())
					sp_tx_set_sys_state(STATE_PARSE_EDID);
				break;
			case RX_DP:
				if (sp_tx_get_dp_connection())
					sp_tx_set_sys_state(STATE_PARSE_EDID);
				break;
			case RX_VGA_GEN:
				if (sp_tx_get_vga_connection())
					sp_tx_set_sys_state(STATE_PARSE_EDID);
				break;
			case RX_VGA_9832:
				if (sp_tx_get_vga_connection()) {
					sp_tx_send_message(MSG_CLEAR_IRQ);
					sp_tx_set_sys_state(STATE_PARSE_EDID);
				}
				break;
			case RX_NULL:
			default:
				break;
			}
		}
	} else if (sp_tx_pd_mode == 0) {
		sp_tx_vbus_powerdown();
#ifdef CONFIG_CHARGER_SMB345
		sp_tx_pull_down_id(FALSE);
#endif
		sp_tx_power_down(SP_TX_PWR_REG);
		sp_tx_power_down(SP_TX_PWR_TOTAL);
		sp_tx_hardware_powerdown();
		sp_tx_pd_mode = 1;
		sp_tx_link_config_done = 0;
		sp_tx_hw_lt_enable = 0;
		sp_tx_hw_lt_done = 0;
		sp_tx_rx_type = RX_NULL;
		sp_tx_rx_type_backup = RX_NULL;
		sp_tx_set_sys_state(STATE_CABLE_PLUG);
	}
}
Exemplo n.º 4
0
static void slimport_cable_plug_proc(struct anx7808_data *anx7808)
{
	int Pad_HW_ID = 0;

///	printk("+++++++++++++slimport_cable_plug_proc+++++++++++++++++++\n");
	if (gpio_get_value_cansleep(anx7808->pdata->gpio_cbl_det) ) {
		msleep(50);
		if (gpio_get_value_cansleep(anx7808->pdata->gpio_cbl_det) ) {
//			printk("slimport_cable_plug_proc start\n");
			if (sp_tx_pd_mode) {
///				printk("=================slimport_cable_plug_proc (1) ===============\n");
//ASUS_BSP +++ : larry lai for pad solution
				if(sp_tx_get_asus_id()) 
				{
#ifdef CONFIG_EEPROM_NUVOTON				
					Pad_HW_ID = AX_MicroP_IsMydpNewSKU();
#else
					Pad_HW_ID = -1;  // default TV mode
#endif
					if (Pad_HW_ID == 1)
					{
						printk("### [myDP] DP Pad detect ###\n");				
						sp_tx_asus_pad = 1;	
						myDP_DP_Dongle = 1;
					}
					else if (Pad_HW_ID == 0)
					{
						printk("### [myDP] HDMI Pad detect ###\n");				
						sp_tx_asus_pad = 1;
						myDP_DP_Dongle = 0;
					}
					else
					{
						if (myDP_force_pad_mode)
						{
							if (myDP_DP_Dongle)
							{
								printk("[myDP] DP Pad detect ###\n");				
								sp_tx_asus_pad = 1;	
								myDP_DP_Dongle = 1;
							}
							else
							{
								printk("[myDP] HDMI Pad detect ###\n");				
								sp_tx_asus_pad = 1;
								myDP_DP_Dongle = 0;							
							}
						}
						else
						{
							printk("### [myDP] Fail detect Pad , force TV mode ###\n");									
							sp_tx_asus_pad = 0;
							myDP_DP_Dongle = 0;											
						}
					}
				}
				else
					nv_touch_mode(4);	//ASUS_BSP Deeo : notify touch while plug out HDMI 4: AC

//ASUS_BSP --- : larry lai for pad solution

				//sp_tx_hardware_chip_enable(anx7808_client);
				sp_tx_hardware_poweron(anx7808_client);

				sp_tx_pd_mode = 0;

//ANX : (ver:20130105) diff with ANX slimport driver, comment it ??? 			
////				msleep(200);
				sp_tx_power_on(SP_TX_PWR_REG);
				sp_tx_power_on(SP_TX_PWR_TOTAL);
///				printk("=================slimport_cable_plug_proc (2) ===============\n");
//ANX : (ver:0.2)
				sp_tx_pull_down_id(TRUE);

				hdmi_rx_initialization();
///				printk("=================slimport_cable_plug_proc (3) ===============\n");
				sp_tx_initialization();
///				printk("=================slimport_cable_plug_proc (4) ===============\n");
//ASUS_BSP +++ : larry lai for pad solution
				if (!sp_tx_asus_pad)
				{
					sp_tx_vbus_poweron();
					msleep(200);
				}
				else
				{
					msleep(20);					
				}
//ASUS_BSP --- : larry lai for pad solution				
				if (!sp_tx_get_cable_type()) {
					DEV_ERR("%s:AUX ERR\n", __func__);
					sp_tx_vbus_powerdown();
//ANX : (ver:0.2)					
					sp_tx_pull_down_id(FALSE);
					sp_tx_power_down(SP_TX_PWR_REG);
					sp_tx_power_down(SP_TX_PWR_TOTAL);
//					sp_tx_hardware_chip_disable(anx7808_client);
					sp_tx_hardware_powerdown(anx7808_client);
					sp_tx_pd_mode = 1;
					sp_tx_link_config_done = 0;
					sp_tx_hw_lt_enable = 0;
					sp_tx_hw_lt_done = 0;
					sp_tx_rx_type = RX_NULL;
					sp_tx_rx_type_backup = RX_NULL;
//ANX +++: (ver:20130105) pad solution
					sp_tx_asus_pad = 0;
//ANX ---: (ver:20130105) pad solution
					sp_tx_set_sys_state(STATE_CABLE_PLUG);
					return;
				}
///				printk("=================slimport_cable_plug_proc (5) ===============\n");
				sp_tx_rx_type_backup = sp_tx_rx_type;
			}
			switch(sp_tx_rx_type) {
			case RX_HDMI:
///				printk("=================slimport_cable_plug_proc (RX_HDMI) ===============\n");
				if(sp_tx_get_hdmi_connection()){
					printk("==== (RX_HDMI) ===\n");
//ANX +++: (ver:20130105) pad solution					
					if(sp_tx_asus_pad) {
						//skip EDID read
						hdmi_rx_set_hpd(1);
						hdmi_rx_set_termination(1);
						sp_tx_set_sys_state(STATE_CONFIG_HDMI);
					} else {
						sp_tx_set_sys_state(STATE_PARSE_EDID);
					}
//ANX ---: (ver:20130105) pad solution					
					}
				break;
			case RX_DP:
				if(sp_tx_get_dp_connection())
				{
					printk("==== (RX_DP) ===\n");				
					if(sp_tx_asus_pad) {
						//skip EDID read
						hdmi_rx_set_hpd(1);
						hdmi_rx_set_termination(1);
						sp_tx_set_sys_state(STATE_CONFIG_HDMI);
					} else {				
						sp_tx_set_sys_state(STATE_PARSE_EDID);
					}
				}
				break;
			case RX_VGA:
				if(sp_tx_get_vga_connection()){
					sp_tx_send_message(MSG_CLEAR_IRQ); 
					sp_tx_set_sys_state(STATE_PARSE_EDID);
				}
				break;
			case RX_NULL:
			default:
				break;
			}
		}
	} else if (sp_tx_pd_mode == 0) {
		sp_tx_vbus_powerdown();
//ANX : (ver:0.2)		
		sp_tx_pull_down_id(FALSE);
		sp_tx_power_down(SP_TX_PWR_REG);
		sp_tx_power_down(SP_TX_PWR_TOTAL);
		sp_tx_hardware_powerdown(anx7808_client);
//		sp_tx_hardware_chip_disable(anx7808_client);
		sp_tx_pd_mode = 1;
		sp_tx_link_config_done = 0;
		sp_tx_hw_lt_enable = 0;
		sp_tx_hw_lt_done = 0;
		sp_tx_rx_type = RX_NULL;
		sp_tx_rx_type_backup = RX_NULL;
//ANX +++: (ver:20130105) pad solution		
		sp_tx_asus_pad = 0;
//ANX ---: (ver:20130105) pad solution		
		sp_tx_set_sys_state(STATE_CABLE_PLUG);
	}
}