Lines Matching refs:tpm_dev
71 static struct tpm_inf_dev tpm_dev; variable
96 .addr = tpm_dev.client->addr, in iic_tpm_read()
101 .addr = tpm_dev.client->addr, in iic_tpm_read()
113 if (!tpm_dev.client->adapter->algo->master_xfer) in iic_tpm_read()
115 i2c_lock_bus(tpm_dev.client->adapter, I2C_LOCK_SEGMENT); in iic_tpm_read()
117 if (tpm_dev.chip_type == SLB9645) { in iic_tpm_read()
125 rc = __i2c_transfer(tpm_dev.client->adapter, msgs, 2); in iic_tpm_read()
137 rc = __i2c_transfer(tpm_dev.client->adapter, in iic_tpm_read()
154 if (tpm_dev.adapterlimit) { in iic_tpm_read()
156 tpm_dev.adapterlimit, in iic_tpm_read()
162 rc = __i2c_transfer(tpm_dev.client->adapter, in iic_tpm_read()
180 tpm_dev.adapterlimit = in iic_tpm_read()
190 i2c_unlock_bus(tpm_dev.client->adapter, I2C_LOCK_SEGMENT); in iic_tpm_read()
212 .addr = tpm_dev.client->addr, in iic_tpm_write_generic()
214 .buf = tpm_dev.buf in iic_tpm_write_generic()
220 if (!tpm_dev.client->adapter->algo->master_xfer) in iic_tpm_write_generic()
222 i2c_lock_bus(tpm_dev.client->adapter, I2C_LOCK_SEGMENT); in iic_tpm_write_generic()
225 tpm_dev.buf[0] = addr; in iic_tpm_write_generic()
226 memcpy(&(tpm_dev.buf[1]), buffer, len); in iic_tpm_write_generic()
235 rc = __i2c_transfer(tpm_dev.client->adapter, &msg1, 1); in iic_tpm_write_generic()
241 i2c_unlock_bus(tpm_dev.client->adapter, I2C_LOCK_SEGMENT); in iic_tpm_write_generic()
323 tpm_dev.locality = loc; in check_locality()
372 if (iic_tpm_read(TPM_STS(tpm_dev.locality), &buf, 1) < 0) in tpm_tis_i2c_status()
386 iic_tpm_write_long(TPM_STS(tpm_dev.locality), &buf, 1); in tpm_tis_i2c_ready()
400 if (iic_tpm_read(TPM_STS(tpm_dev.locality)+1, buf, 3) < 0) in get_burstcount()
454 rc = iic_tpm_read(TPM_DATA_FIFO(tpm_dev.locality), in recv_data()
513 release_locality(chip, tpm_dev.locality, 0); in tpm_tis_i2c_recv()
552 rc = iic_tpm_write(TPM_DATA_FIFO(tpm_dev.locality), in tpm_tis_i2c_send()
575 iic_tpm_write(TPM_DATA_FIFO(tpm_dev.locality), &(buf[count]), 1); in tpm_tis_i2c_send()
583 iic_tpm_write(TPM_STS(tpm_dev.locality), &sts, 1); in tpm_tis_i2c_send()
592 release_locality(chip, tpm_dev.locality, 0); in tpm_tis_i2c_send()
642 tpm_dev.chip_type = SLB9645; in tpm_tis_i2c_init()
644 tpm_dev.chip_type = SLB9635; in tpm_tis_i2c_init()
653 tpm_dev.chip = chip; in tpm_tis_i2c_init()
657 release_locality(chip, tpm_dev.locality, 1); in tpm_tis_i2c_init()
658 tpm_dev.client = NULL; in tpm_tis_i2c_init()
689 if (tpm_dev.client != NULL) { in tpm_tis_i2c_probe()
699 tpm_dev.client = client; in tpm_tis_i2c_probe()
702 tpm_dev.client = NULL; in tpm_tis_i2c_probe()
710 struct tpm_chip *chip = tpm_dev.chip; in tpm_tis_i2c_remove()
713 release_locality(chip, tpm_dev.locality, 1); in tpm_tis_i2c_remove()
714 tpm_dev.client = NULL; in tpm_tis_i2c_remove()