Lines Matching refs:chip

38 static int tpm_atml_recv(struct tpm_chip *chip, u8 *buf, size_t count)  in tpm_atml_recv()  argument
50 status = ioread8(chip->vendor.iobase + 1); in tpm_atml_recv()
52 dev_err(chip->pdev, "error reading header\n"); in tpm_atml_recv()
55 *buf++ = ioread8(chip->vendor.iobase); in tpm_atml_recv()
63 dev_err(chip->pdev, in tpm_atml_recv()
66 status = ioread8(chip->vendor.iobase + 1); in tpm_atml_recv()
68 dev_err(chip->pdev, "error reading data\n"); in tpm_atml_recv()
77 status = ioread8(chip->vendor.iobase + 1); in tpm_atml_recv()
79 dev_err(chip->pdev, "error reading data\n"); in tpm_atml_recv()
82 *buf++ = ioread8(chip->vendor.iobase); in tpm_atml_recv()
86 status = ioread8(chip->vendor.iobase + 1); in tpm_atml_recv()
89 dev_err(chip->pdev, "data available is stuck\n"); in tpm_atml_recv()
96 static int tpm_atml_send(struct tpm_chip *chip, u8 *buf, size_t count) in tpm_atml_send() argument
100 dev_dbg(chip->pdev, "tpm_atml_send:\n"); in tpm_atml_send()
102 dev_dbg(chip->pdev, "%d 0x%x(%d)\n", i, buf[i], buf[i]); in tpm_atml_send()
103 iowrite8(buf[i], chip->vendor.iobase); in tpm_atml_send()
109 static void tpm_atml_cancel(struct tpm_chip *chip) in tpm_atml_cancel() argument
111 iowrite8(ATML_STATUS_ABORT, chip->vendor.iobase + 1); in tpm_atml_cancel()
114 static u8 tpm_atml_status(struct tpm_chip *chip) in tpm_atml_status() argument
116 return ioread8(chip->vendor.iobase + 1); in tpm_atml_status()
119 static bool tpm_atml_req_canceled(struct tpm_chip *chip, u8 status) in tpm_atml_req_canceled() argument
138 struct tpm_chip *chip = dev_get_drvdata(&pdev->dev); in atml_plat_remove() local
140 if (chip) { in atml_plat_remove()
141 tpm_chip_unregister(chip); in atml_plat_remove()
142 if (chip->vendor.have_region) in atml_plat_remove()
143 atmel_release_region(chip->vendor.base, in atml_plat_remove()
144 chip->vendor.region_size); in atml_plat_remove()
145 atmel_put_base_addr(chip->vendor.iobase); in atml_plat_remove()
165 struct tpm_chip *chip; in init_atmel() local
186 chip = tpmm_chip_alloc(&pdev->dev, &tpm_atmel); in init_atmel()
187 if (IS_ERR(chip)) { in init_atmel()
188 rc = PTR_ERR(chip); in init_atmel()
192 chip->vendor.iobase = iobase; in init_atmel()
193 chip->vendor.base = base; in init_atmel()
194 chip->vendor.have_region = have_region; in init_atmel()
195 chip->vendor.region_size = region_size; in init_atmel()
197 rc = tpm_chip_register(chip); in init_atmel()