Lines Matching refs:tpm_dev
67 static u8 clear_interruption(struct st33zp24_dev *tpm_dev) in clear_interruption() argument
71 tpm_dev->ops->recv(tpm_dev->phy_id, TPM_INT_STATUS, &interrupt, 1); in clear_interruption()
72 tpm_dev->ops->send(tpm_dev->phy_id, TPM_INT_STATUS, &interrupt, 1); in clear_interruption()
81 struct st33zp24_dev *tpm_dev = dev_get_drvdata(&chip->dev); in st33zp24_cancel() local
85 tpm_dev->ops->send(tpm_dev->phy_id, TPM_STS, &data, 1); in st33zp24_cancel()
93 struct st33zp24_dev *tpm_dev = dev_get_drvdata(&chip->dev); in st33zp24_status() local
96 tpm_dev->ops->recv(tpm_dev->phy_id, TPM_STS, &data, 1); in st33zp24_status()
105 struct st33zp24_dev *tpm_dev = dev_get_drvdata(&chip->dev); in check_locality() local
109 status = tpm_dev->ops->recv(tpm_dev->phy_id, TPM_ACCESS, &data, 1); in check_locality()
120 struct st33zp24_dev *tpm_dev = dev_get_drvdata(&chip->dev); in request_locality() local
126 return tpm_dev->locality; in request_locality()
129 ret = tpm_dev->ops->send(tpm_dev->phy_id, TPM_ACCESS, &data, 1); in request_locality()
138 return tpm_dev->locality; in request_locality()
148 struct st33zp24_dev *tpm_dev = dev_get_drvdata(&chip->dev); in release_locality() local
153 tpm_dev->ops->send(tpm_dev->phy_id, TPM_ACCESS, &data, 1); in release_locality()
161 struct st33zp24_dev *tpm_dev = dev_get_drvdata(&chip->dev); in get_burstcount() local
168 status = tpm_dev->ops->recv(tpm_dev->phy_id, TPM_STS + 1, in get_burstcount()
174 status = tpm_dev->ops->recv(tpm_dev->phy_id, TPM_STS + 2, in get_burstcount()
208 struct st33zp24_dev *tpm_dev = dev_get_drvdata(&chip->dev); in wait_for_stat() local
224 cur_intrs = tpm_dev->intrs; in wait_for_stat()
225 clear_interruption(tpm_dev); in wait_for_stat()
226 enable_irq(tpm_dev->irq); in wait_for_stat()
237 cur_intrs != tpm_dev->intrs, in wait_for_stat()
239 clear_interruption(tpm_dev); in wait_for_stat()
249 disable_irq_nosync(tpm_dev->irq); in wait_for_stat()
265 struct st33zp24_dev *tpm_dev = dev_get_drvdata(&chip->dev); in recv_data() local
272 &tpm_dev->read_queue, true) == 0) { in recv_data()
277 ret = tpm_dev->ops->recv(tpm_dev->phy_id, TPM_DATA_FIFO, in recv_data()
290 struct st33zp24_dev *tpm_dev = dev_get_drvdata(&chip->dev); in tpm_ioserirq_handler() local
292 tpm_dev->intrs++; in tpm_ioserirq_handler()
293 wake_up_interruptible(&tpm_dev->read_queue); in tpm_ioserirq_handler()
294 disable_irq_nosync(tpm_dev->irq); in tpm_ioserirq_handler()
305 struct st33zp24_dev *tpm_dev = dev_get_drvdata(&chip->dev); in st33zp24_send() local
323 &tpm_dev->read_queue, false) < 0) { in st33zp24_send()
334 ret = tpm_dev->ops->send(tpm_dev->phy_id, TPM_DATA_FIFO, in st33zp24_send()
348 ret = tpm_dev->ops->send(tpm_dev->phy_id, TPM_DATA_FIFO, in st33zp24_send()
360 ret = tpm_dev->ops->send(tpm_dev->phy_id, TPM_STS, &data, 1); in st33zp24_send()
369 &tpm_dev->read_queue, false); in st33zp24_send()
452 struct st33zp24_dev *tpm_dev; in st33zp24_probe() local
458 tpm_dev = devm_kzalloc(dev, sizeof(struct st33zp24_dev), in st33zp24_probe()
460 if (!tpm_dev) in st33zp24_probe()
463 tpm_dev->phy_id = phy_id; in st33zp24_probe()
464 tpm_dev->ops = ops; in st33zp24_probe()
465 dev_set_drvdata(&chip->dev, tpm_dev); in st33zp24_probe()
472 tpm_dev->locality = LOCALITY0; in st33zp24_probe()
485 tpm_dev->io_lpcpd = devm_gpiod_get_optional(dev, "lpcpd", in st33zp24_probe()
487 ret = PTR_ERR_OR_ZERO(tpm_dev->io_lpcpd); in st33zp24_probe()
495 init_waitqueue_head(&tpm_dev->read_queue); in st33zp24_probe()
496 tpm_dev->intrs = 0; in st33zp24_probe()
503 clear_interruption(tpm_dev); in st33zp24_probe()
517 ret = tpm_dev->ops->send(tpm_dev->phy_id, TPM_INT_ENABLE, in st33zp24_probe()
523 ret = tpm_dev->ops->send(tpm_dev->phy_id, (TPM_INT_ENABLE + 3), in st33zp24_probe()
528 tpm_dev->irq = irq; in st33zp24_probe()
531 disable_irq_nosync(tpm_dev->irq); in st33zp24_probe()
551 struct st33zp24_dev *tpm_dev = dev_get_drvdata(&chip->dev); in st33zp24_pm_suspend() local
555 if (tpm_dev->io_lpcpd) in st33zp24_pm_suspend()
556 gpiod_set_value_cansleep(tpm_dev->io_lpcpd, 0); in st33zp24_pm_suspend()
567 struct st33zp24_dev *tpm_dev = dev_get_drvdata(&chip->dev); in st33zp24_pm_resume() local
570 if (tpm_dev->io_lpcpd) { in st33zp24_pm_resume()
571 gpiod_set_value_cansleep(tpm_dev->io_lpcpd, 1); in st33zp24_pm_resume()
574 &tpm_dev->read_queue, false); in st33zp24_pm_resume()