/* Probe the given I2C chip address. Returns 0 if a chip responded, not 0 on failure.  */
int i2c_probe(uchar chip)
/* Probe the given I2C chip address. Returns 0 if a chip responded, not 0 on failure.  */
int i2c_probe(uchar chip)
{
	unsigned char res;
	pca_write_reg(PCA_CON, PCA_CON_STA | PCA_CON_ENSIO);
	pca_wait_busy();
	pca_write_reg(PCA_CON, PCA_CON_STA | PCA_CON_ENSIO);
	pca_write_reg(PCA_DAT, (chip << 1) | 1);
	res = pca_wait_busy();
	if ((res == 0) && (pca_read_reg(PCA_STA) == 0x48))
		res = 1;
	pca_write_reg(PCA_CON, PCA_CON_STO | PCA_CON_ENSIO);
	return res;
}