Lines Matching refs:tpm_dev
77 static struct tpm_inf_dev tpm_dev; variable
102 .addr = tpm_dev.client->addr, in iic_tpm_read()
107 .addr = tpm_dev.client->addr, in iic_tpm_read()
119 if (!tpm_dev.client->adapter->algo->master_xfer) in iic_tpm_read()
121 i2c_lock_bus(tpm_dev.client->adapter, I2C_LOCK_SEGMENT); in iic_tpm_read()
123 if (tpm_dev.chip_type == SLB9645) { in iic_tpm_read()
131 rc = __i2c_transfer(tpm_dev.client->adapter, msgs, 2); in iic_tpm_read()
143 rc = __i2c_transfer(tpm_dev.client->adapter, in iic_tpm_read()
160 if (tpm_dev.adapterlimit) { in iic_tpm_read()
162 tpm_dev.adapterlimit, in iic_tpm_read()
168 rc = __i2c_transfer(tpm_dev.client->adapter, in iic_tpm_read()
186 tpm_dev.adapterlimit = in iic_tpm_read()
196 i2c_unlock_bus(tpm_dev.client->adapter, I2C_LOCK_SEGMENT); in iic_tpm_read()
218 .addr = tpm_dev.client->addr, in iic_tpm_write_generic()
220 .buf = tpm_dev.buf in iic_tpm_write_generic()
226 if (!tpm_dev.client->adapter->algo->master_xfer) in iic_tpm_write_generic()
228 i2c_lock_bus(tpm_dev.client->adapter, I2C_LOCK_SEGMENT); in iic_tpm_write_generic()
231 tpm_dev.buf[0] = addr; in iic_tpm_write_generic()
232 memcpy(&(tpm_dev.buf[1]), buffer, len); in iic_tpm_write_generic()
241 rc = __i2c_transfer(tpm_dev.client->adapter, &msg1, 1); in iic_tpm_write_generic()
247 i2c_unlock_bus(tpm_dev.client->adapter, I2C_LOCK_SEGMENT); in iic_tpm_write_generic()
329 tpm_dev.locality = loc; in check_locality()
378 if (iic_tpm_read(TPM_STS(tpm_dev.locality), &buf, 1) < 0) in tpm_tis_i2c_status()
392 iic_tpm_write_long(TPM_STS(tpm_dev.locality), &buf, 1); in tpm_tis_i2c_ready()
406 if (iic_tpm_read(TPM_STS(tpm_dev.locality)+1, buf, 3) < 0) in get_burstcount()
460 rc = iic_tpm_read(TPM_DATA_FIFO(tpm_dev.locality), in recv_data()
519 release_locality(chip, tpm_dev.locality, 0); in tpm_tis_i2c_recv()
558 rc = iic_tpm_write(TPM_DATA_FIFO(tpm_dev.locality), in tpm_tis_i2c_send()
581 iic_tpm_write(TPM_DATA_FIFO(tpm_dev.locality), &(buf[count]), 1); in tpm_tis_i2c_send()
589 iic_tpm_write(TPM_STS(tpm_dev.locality), &sts, 1); in tpm_tis_i2c_send()
598 release_locality(chip, tpm_dev.locality, 0); in tpm_tis_i2c_send()
648 tpm_dev.chip_type = SLB9645; in tpm_tis_i2c_init()
650 tpm_dev.chip_type = SLB9635; in tpm_tis_i2c_init()
659 tpm_dev.chip = chip; in tpm_tis_i2c_init()
663 release_locality(chip, tpm_dev.locality, 1); in tpm_tis_i2c_init()
664 tpm_dev.client = NULL; in tpm_tis_i2c_init()
696 if (tpm_dev.client != NULL) { in tpm_tis_i2c_probe()
706 tpm_dev.client = client; in tpm_tis_i2c_probe()
709 tpm_dev.client = NULL; in tpm_tis_i2c_probe()
717 struct tpm_chip *chip = tpm_dev.chip; in tpm_tis_i2c_remove()
720 release_locality(chip, tpm_dev.locality, 1); in tpm_tis_i2c_remove()
721 tpm_dev.client = NULL; in tpm_tis_i2c_remove()