Lines Matching +full:hall +full:- +full:enable

1 // SPDX-License-Identifier: GPL-2.0-only
9 * Kylene Hall <kjhall@us.ibm.com>
11 * Maintained by: <tpmdd-devel@lists.sourceforge.net>
72 struct tpm_nsc_priv *priv = dev_get_drvdata(&chip->dev); in wait_for_stat()
76 *data = inb(priv->base + NSC_STATUS); in wait_for_stat()
84 *data = inb(priv->base + 1); in wait_for_stat()
90 return -EBUSY; in wait_for_stat()
95 struct tpm_nsc_priv *priv = dev_get_drvdata(&chip->dev); in nsc_wait_for_ready()
100 status = inb(priv->base + NSC_STATUS); in nsc_wait_for_ready()
102 status = inb(priv->base + NSC_DATA); in nsc_wait_for_ready()
110 status = inb(priv->base + NSC_STATUS); in nsc_wait_for_ready()
112 status = inb(priv->base + NSC_DATA); in nsc_wait_for_ready()
118 dev_info(&chip->dev, "wait for ready failed\n"); in nsc_wait_for_ready()
119 return -EBUSY; in nsc_wait_for_ready()
125 struct tpm_nsc_priv *priv = dev_get_drvdata(&chip->dev); in tpm_nsc_recv()
132 return -EIO; in tpm_nsc_recv()
135 dev_err(&chip->dev, "F0 timeout\n"); in tpm_nsc_recv()
136 return -EIO; in tpm_nsc_recv()
139 data = inb(priv->base + NSC_DATA); in tpm_nsc_recv()
141 dev_err(&chip->dev, "not in normal mode (0x%x)\n", in tpm_nsc_recv()
143 return -EIO; in tpm_nsc_recv()
150 dev_err(&chip->dev, in tpm_nsc_recv()
152 return -EIO; in tpm_nsc_recv()
156 *p = inb(priv->base + NSC_DATA); in tpm_nsc_recv()
161 dev_err(&chip->dev, "F0 not set\n"); in tpm_nsc_recv()
162 return -EIO; in tpm_nsc_recv()
165 data = inb(priv->base + NSC_DATA); in tpm_nsc_recv()
167 dev_err(&chip->dev, in tpm_nsc_recv()
169 return -EIO; in tpm_nsc_recv()
176 return -EIO; in tpm_nsc_recv()
183 struct tpm_nsc_priv *priv = dev_get_drvdata(&chip->dev); in tpm_nsc_send()
193 outb(NSC_COMMAND_CANCEL, priv->base + NSC_COMMAND); in tpm_nsc_send()
196 return -EIO; in tpm_nsc_send()
199 dev_err(&chip->dev, "IBF timeout\n"); in tpm_nsc_send()
200 return -EIO; in tpm_nsc_send()
203 outb(NSC_COMMAND_NORMAL, priv->base + NSC_COMMAND); in tpm_nsc_send()
205 dev_err(&chip->dev, "IBR timeout\n"); in tpm_nsc_send()
206 return -EIO; in tpm_nsc_send()
211 dev_err(&chip->dev, in tpm_nsc_send()
213 return -EIO; in tpm_nsc_send()
215 outb(buf[i], priv->base + NSC_DATA); in tpm_nsc_send()
219 dev_err(&chip->dev, "IBF timeout\n"); in tpm_nsc_send()
220 return -EIO; in tpm_nsc_send()
222 outb(NSC_COMMAND_EOC, priv->base + NSC_COMMAND); in tpm_nsc_send()
229 struct tpm_nsc_priv *priv = dev_get_drvdata(&chip->dev); in tpm_nsc_cancel()
231 outb(NSC_COMMAND_CANCEL, priv->base + NSC_COMMAND); in tpm_nsc_cancel()
236 struct tpm_nsc_priv *priv = dev_get_drvdata(&chip->dev); in tpm_nsc_status()
238 return inb(priv->base + NSC_STATUS); in tpm_nsc_status()
261 struct tpm_nsc_priv *priv = dev_get_drvdata(&chip->dev); in tpm_nsc_remove()
264 release_region(priv->base, 2); in tpm_nsc_remove()
302 return -ENODEV; in init_nsc()
313 /* enable the DPM module */ in init_nsc()
316 pdev = platform_device_alloc("tpm_nscl0", -1); in init_nsc()
318 rc = -ENOMEM; in init_nsc()
322 pdev->num_resources = 0; in init_nsc()
323 pdev->dev.driver = &nsc_drv.driver; in init_nsc()
324 pdev->dev.release = tpm_nsc_remove; in init_nsc()
329 priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); in init_nsc()
331 rc = -ENOMEM; in init_nsc()
335 priv->base = base; in init_nsc()
338 rc = -EBUSY; in init_nsc()
342 chip = tpmm_chip_alloc(&pdev->dev, &tpm_nsc); in init_nsc()
344 rc = -ENODEV; in init_nsc()
348 dev_set_drvdata(&chip->dev, priv); in init_nsc()
354 dev_dbg(&pdev->dev, "NSC TPM detected\n"); in init_nsc()
355 dev_dbg(&pdev->dev, in init_nsc()
359 dev_dbg(&pdev->dev, in init_nsc()
363 dev_dbg(&pdev->dev, "NSC IO Base0 0x%x\n", in init_nsc()
365 dev_dbg(&pdev->dev, "NSC IO Base1 0x%x\n", in init_nsc()
367 dev_dbg(&pdev->dev, "NSC Interrupt number and wakeup 0x%x\n", in init_nsc()
369 dev_dbg(&pdev->dev, "NSC IRQ type select 0x%x\n", in init_nsc()
371 dev_dbg(&pdev->dev, in init_nsc()
374 dev_dbg(&pdev->dev, in init_nsc()
383 dev_info(&pdev->dev, in init_nsc()
403 tpm_nsc_remove(&pdev->dev); in cleanup_nsc()