Lines Matching refs:tpm_dev

80 static u8 clear_interruption(struct st33zp24_dev *tpm_dev)  in clear_interruption()  argument
84 tpm_dev->ops->recv(tpm_dev->phy_id, TPM_INT_STATUS, &interrupt, 1); in clear_interruption()
85 tpm_dev->ops->send(tpm_dev->phy_id, TPM_INT_STATUS, &interrupt, 1); in clear_interruption()
96 struct st33zp24_dev *tpm_dev = dev_get_drvdata(&chip->dev); in st33zp24_cancel() local
100 tpm_dev->ops->send(tpm_dev->phy_id, TPM_STS, &data, 1); in st33zp24_cancel()
110 struct st33zp24_dev *tpm_dev = dev_get_drvdata(&chip->dev); in st33zp24_status() local
113 tpm_dev->ops->recv(tpm_dev->phy_id, TPM_STS, &data, 1); in st33zp24_status()
124 struct st33zp24_dev *tpm_dev = dev_get_drvdata(&chip->dev); in check_locality() local
128 status = tpm_dev->ops->recv(tpm_dev->phy_id, TPM_ACCESS, &data, 1); in check_locality()
144 struct st33zp24_dev *tpm_dev = dev_get_drvdata(&chip->dev); in request_locality() local
150 return tpm_dev->locality; in request_locality()
153 ret = tpm_dev->ops->send(tpm_dev->phy_id, TPM_ACCESS, &data, 1); in request_locality()
162 return tpm_dev->locality; in request_locality()
176 struct st33zp24_dev *tpm_dev = dev_get_drvdata(&chip->dev); in release_locality() local
181 tpm_dev->ops->send(tpm_dev->phy_id, TPM_ACCESS, &data, 1); in release_locality()
191 struct st33zp24_dev *tpm_dev = dev_get_drvdata(&chip->dev); in get_burstcount() local
198 status = tpm_dev->ops->recv(tpm_dev->phy_id, TPM_STS + 1, in get_burstcount()
204 status = tpm_dev->ops->recv(tpm_dev->phy_id, TPM_STS + 2, in get_burstcount()
254 struct st33zp24_dev *tpm_dev = dev_get_drvdata(&chip->dev); in wait_for_stat() local
270 cur_intrs = tpm_dev->intrs; in wait_for_stat()
271 clear_interruption(tpm_dev); in wait_for_stat()
272 enable_irq(tpm_dev->irq); in wait_for_stat()
283 cur_intrs != tpm_dev->intrs, in wait_for_stat()
285 clear_interruption(tpm_dev); in wait_for_stat()
295 disable_irq_nosync(tpm_dev->irq); in wait_for_stat()
318 struct st33zp24_dev *tpm_dev = dev_get_drvdata(&chip->dev); in recv_data() local
325 &tpm_dev->read_queue, true) == 0) { in recv_data()
330 ret = tpm_dev->ops->recv(tpm_dev->phy_id, TPM_DATA_FIFO, in recv_data()
349 struct st33zp24_dev *tpm_dev = dev_get_drvdata(&chip->dev); in tpm_ioserirq_handler() local
351 tpm_dev->intrs++; in tpm_ioserirq_handler()
352 wake_up_interruptible(&tpm_dev->read_queue); in tpm_ioserirq_handler()
353 disable_irq_nosync(tpm_dev->irq); in tpm_ioserirq_handler()
370 struct st33zp24_dev *tpm_dev = dev_get_drvdata(&chip->dev); in st33zp24_send() local
388 &tpm_dev->read_queue, false) < 0) { in st33zp24_send()
399 ret = tpm_dev->ops->send(tpm_dev->phy_id, TPM_DATA_FIFO, in st33zp24_send()
413 ret = tpm_dev->ops->send(tpm_dev->phy_id, TPM_DATA_FIFO, in st33zp24_send()
425 ret = tpm_dev->ops->send(tpm_dev->phy_id, TPM_STS, &data, 1); in st33zp24_send()
434 &tpm_dev->read_queue, false); in st33zp24_send()
528 struct st33zp24_dev *tpm_dev; in st33zp24_probe() local
534 tpm_dev = devm_kzalloc(dev, sizeof(struct st33zp24_dev), in st33zp24_probe()
536 if (!tpm_dev) in st33zp24_probe()
539 tpm_dev->phy_id = phy_id; in st33zp24_probe()
540 tpm_dev->ops = ops; in st33zp24_probe()
541 dev_set_drvdata(&chip->dev, tpm_dev); in st33zp24_probe()
548 tpm_dev->locality = LOCALITY0; in st33zp24_probe()
552 init_waitqueue_head(&tpm_dev->read_queue); in st33zp24_probe()
553 tpm_dev->intrs = 0; in st33zp24_probe()
560 clear_interruption(tpm_dev); in st33zp24_probe()
574 ret = tpm_dev->ops->send(tpm_dev->phy_id, TPM_INT_ENABLE, in st33zp24_probe()
580 ret = tpm_dev->ops->send(tpm_dev->phy_id, (TPM_INT_ENABLE + 3), in st33zp24_probe()
585 tpm_dev->irq = irq; in st33zp24_probe()
588 disable_irq_nosync(tpm_dev->irq); in st33zp24_probe()
620 struct st33zp24_dev *tpm_dev = dev_get_drvdata(&chip->dev); in st33zp24_pm_suspend() local
624 if (gpio_is_valid(tpm_dev->io_lpcpd)) in st33zp24_pm_suspend()
625 gpio_set_value(tpm_dev->io_lpcpd, 0); in st33zp24_pm_suspend()
641 struct st33zp24_dev *tpm_dev = dev_get_drvdata(&chip->dev); in st33zp24_pm_resume() local
644 if (gpio_is_valid(tpm_dev->io_lpcpd)) { in st33zp24_pm_resume()
645 gpio_set_value(tpm_dev->io_lpcpd, 1); in st33zp24_pm_resume()
648 &tpm_dev->read_queue, false); in st33zp24_pm_resume()