49 for (i = 0; i < 6; i++) {
64 "Recv size(%d) less than available space\n", size);
65 for (; i <
size; i++) {
76 for (; i <
size; i++) {
89 dev_err(chip->
dev,
"data available is stuck\n");
96 static int tpm_atml_send(
struct tpm_chip *chip,
u8 *buf,
size_t count)
101 for (i = 0; i <
count; i++) {
102 dev_dbg(chip->
dev,
"%d 0x%x(%d)\n", i, buf[i], buf[i]);
109 static void tpm_atml_cancel(
struct tpm_chip *chip)
114 static u8 tpm_atml_status(
struct tpm_chip *chip)
133 static struct attribute* atmel_attrs[] = {
134 &dev_attr_pubek.attr,
137 &dev_attr_cancel.attr,
141 static struct attribute_group atmel_attr_grp = { .attrs = atmel_attrs };
144 .recv = tpm_atml_recv,
145 .send = tpm_atml_send,
146 .cancel = tpm_atml_cancel,
147 .status = tpm_atml_status,
151 .attr_group = &atmel_attr_grp,
152 .miscdev = { .fops = &atmel_ops, },
157 static void atml_plat_remove(
void)
162 if (chip->
vendor.have_region)
164 chip->
vendor.region_size);
165 atmel_put_base_addr(chip->
vendor.iobase);
181 static int __init init_atmel(
void)
185 int have_region, region_size;
193 if ((iobase = atmel_get_base_addr(&base, ®ion_size)) ==
NULL) {
200 (tpm_atmel.
base, region_size,
"tpm_atmel0") ==
NULL) ? 0 : 1;
202 pdev = platform_device_register_simple(
"tpm_atmel", -1,
NULL, 0);
215 chip->
vendor.have_region = have_region;
216 chip->
vendor.region_size = region_size;
223 atmel_put_base_addr(iobase);
232 static void __exit cleanup_atmel(
void)