Exemple #1
0
static int tmds_register_read(int index)
{
	u8 data;

	viafb_i2c_readbyte(viaparinfo->chip_info->tmds_chip_info.i2c_port,
			   (u8) viaparinfo->chip_info->tmds_chip_info.tmds_chip_slave_addr,
			   (u8) index, &data);
	return data;
}
u8 viafb_gpio_i2c_read_lvds(struct lvds_setting_information
	*plvds_setting_info, struct lvds_chip_information *plvds_chip_info,
	u8 index)
{
	u8 data;

	viaparinfo->i2c_stuff.i2c_port = plvds_chip_info->i2c_port;
	viafb_i2c_readbyte(plvds_chip_info->lvds_chip_slave_addr, index, &data);

	return data;
}
bool viafb_lvds_identify_vt1636(void)
{
	u8 Buffer[2];

	DEBUG_MSG(KERN_INFO "viafb_lvds_identify_vt1636.\n");

	/* Sense VT1636 LVDS Transmiter */
	viaparinfo->chip_info->lvds_chip_info.lvds_chip_slave_addr =
	VT1636_LVDS_I2C_ADDR;

	/* Check vendor ID first: */
	viafb_i2c_readbyte((u8) viaparinfo->chip_info->lvds_chip_info.
	lvds_chip_slave_addr,
		    0x00, &Buffer[0]);
	viafb_i2c_readbyte((u8) viaparinfo->chip_info->lvds_chip_info.
		lvds_chip_slave_addr,
		    0x01, &Buffer[1]);

	if (!((Buffer[0] == 0x06) && (Buffer[1] == 0x11)))
		return false;

	/* Check Chip ID: */
	viafb_i2c_readbyte((u8) viaparinfo->chip_info->lvds_chip_info.
	lvds_chip_slave_addr,
		    0x02, &Buffer[0]);
	viafb_i2c_readbyte((u8) viaparinfo->chip_info->lvds_chip_info.
		lvds_chip_slave_addr,
		    0x03, &Buffer[1]);
	if ((Buffer[0] == 0x45) && (Buffer[1] == 0x33)) {
		viaparinfo->chip_info->lvds_chip_info.lvds_chip_name =
			VT1636_LVDS;
		return true;
	}

	return false;
}