Lines Matching refs:pca_data
370 struct i2c_algo_pca_data *pca_data = adap->algo_data; in pca_probe_chip() local
376 pca_outw(pca_data, I2C_PCA_INDPTR, I2C_PCA_IADR); in pca_probe_chip()
377 pca_outw(pca_data, I2C_PCA_IND, 0xAA); in pca_probe_chip()
378 pca_outw(pca_data, I2C_PCA_INDPTR, I2C_PCA_ITO); in pca_probe_chip()
379 pca_outw(pca_data, I2C_PCA_IND, 0x00); in pca_probe_chip()
380 pca_outw(pca_data, I2C_PCA_INDPTR, I2C_PCA_IADR); in pca_probe_chip()
381 if (pca_inw(pca_data, I2C_PCA_IND) == 0xAA) { in pca_probe_chip()
383 pca_data->chip = I2C_PCA_CHIP_9665; in pca_probe_chip()
386 pca_data->chip = I2C_PCA_CHIP_9564; in pca_probe_chip()
388 return pca_data->chip; in pca_probe_chip()
393 struct i2c_algo_pca_data *pca_data = adap->algo_data; in pca_init() local
401 if (pca_data->i2c_clock > 7) { in pca_init()
402 switch (pca_data->i2c_clock) { in pca_init()
404 pca_data->i2c_clock = I2C_PCA_CON_330kHz; in pca_init()
407 pca_data->i2c_clock = I2C_PCA_CON_288kHz; in pca_init()
410 pca_data->i2c_clock = I2C_PCA_CON_217kHz; in pca_init()
413 pca_data->i2c_clock = I2C_PCA_CON_146kHz; in pca_init()
416 pca_data->i2c_clock = I2C_PCA_CON_88kHz; in pca_init()
419 pca_data->i2c_clock = I2C_PCA_CON_59kHz; in pca_init()
422 pca_data->i2c_clock = I2C_PCA_CON_44kHz; in pca_init()
425 pca_data->i2c_clock = I2C_PCA_CON_36kHz; in pca_init()
431 pca_data->i2c_clock = I2C_PCA_CON_59kHz; in pca_init()
440 clock = pca_clock(pca_data); in pca_init()
445 pca_data->bus_settings.clock_freq = clock; in pca_init()
447 pca_reset(pca_data); in pca_init()
463 if (pca_data->i2c_clock > 1265800) { in pca_init()
466 pca_data->i2c_clock = 1265800; in pca_init()
469 if (pca_data->i2c_clock < 60300) { in pca_init()
472 pca_data->i2c_clock = 60300; in pca_init()
476 clock = pca_clock(pca_data) / 100; in pca_init()
478 if (pca_data->i2c_clock > I2C_MAX_FAST_MODE_PLUS_FREQ) { in pca_init()
483 } else if (pca_data->i2c_clock > I2C_MAX_FAST_MODE_FREQ) { in pca_init()
488 } else if (pca_data->i2c_clock > I2C_MAX_STANDARD_MODE_FREQ) { in pca_init()
515 pca_data->bus_settings.mode = mode; in pca_init()
516 pca_data->bus_settings.tlow = tlow; in pca_init()
517 pca_data->bus_settings.thi = thi; in pca_init()
519 pca_reset(pca_data); in pca_init()