Beispiel #1
0
/*!
* \brief	check device plugin status
*		
* \retval  None
*/ 
int sil902x_check_plugin(int hotplug)
{
	int plugin = 0;
	unsigned char *buf;
	int option = 0; 

//	sil902x_clr_interrupt();
	plugin = (ReadByte(0x3D) & 0x04)? 1:0;
	if( hotplug ){
		if (plugin){
			buf = (unsigned char *)vout_get_edid(VOUT_DVO2HDMI);
			option = edid_parse_option(buf);
			sil902x_hdmi_edid = (option & EDID_OPT_HDMI)? 1:0;
			
			sil902x_active( sil902x_videoMode) ;
		}
		else {
#ifdef SIL902X_CONTENT_PROTECT
			sil902x_CP_enable(0);
#endif
			sil902x_set_power_mode(SIL902X_PWR_STANDBY);
		}
		DPRINT("[SIL902X] HDMI plug%s,option 0x%x\n",(plugin)?"in":"out",option);
	}
	vout_set_int_type(2);
	return plugin;
} /* End of sil902x_check_plugin */
Beispiel #2
0
/*the define and struct i2c_msg were declared int linux/i2c.h*/
int vt1632_check_plugin(int hotplug)
{
	char buf[1];
	int plugin;

	if( vt1632_not_ready )
		return 1;
	
	vpp_i2c_read(VPP_DVI_I2C_ID,VT1632_ADDR,0x9,buf,1);
	plugin = (buf[0]&0x4)? 1:0;
	DPRINT("[VT1632] DVI plug%s\n",(plugin)?"in":"out");
	vout_set_int_type(4);
	return plugin;
}
Beispiel #3
0
/*----------------------- Function Body --------------------------------------*/
int ad9389_check_plugin(int hotplug)
{
	unsigned char buf[1];
	int plugin;
	unsigned int option[2];
	
	vpp_i2c_read(VPP_DVI_I2C_ID,AD9389_ADDR,0x42,buf,1);
	plugin = (buf[0] & BIT6)? 1:0;
	printk("[AD9389] HDMI plug%s\n",(plugin)?"in":"out");

	buf[0] = 0x80;
	vpp_i2c_write(VPP_DVI_I2C_ID,AD9389_ADDR,0x94,buf,1);	// enable INT
	buf[0] = 0x80;
	vpp_i2c_write(VPP_DVI_I2C_ID,AD9389_ADDR,0x96,buf,1);	// clear HPD flag
	vout_set_int_type(2);	// GPIO0 3:rising edge, 2:falling edge

	if( !hotplug ) return plugin;

	option[0] = ad9389_colfmt;
	option[1] = ad9389_dwidth;
	option[1] |= (ad9389_spdif_enable)? 0x2:0x0;
	if( plugin ){
		do {
			buf[0] = 0x10;
			vpp_i2c_write(VPP_DVI_I2C_ID,AD9389_ADDR,0x41,buf,1);
			vpp_i2c_read(VPP_DVI_I2C_ID,AD9389_ADDR,0x41,buf,1);
			if((buf[0] & BIT6)==0)	// Power up 
				break;

			vpp_i2c_read(VPP_DVI_I2C_ID,AD9389_ADDR,0x42,buf,1);
			plugin = (buf[0] & BIT6)? 1:0;
			if( plugin == 0 ) 
				return 0;			
		} while(1);
		
		ad9389_set_mode(&option[0]);
	}
	return plugin;
}