Lines Matching refs:tpm_dev
50 static struct tpm_inf_dev tpm_dev; variable
55 if (tpm_dev.iotype == TPM_INF_IO_PORT) in tpm_data_out()
56 outb(data, tpm_dev.data_regs + offset); in tpm_data_out()
59 writeb(data, tpm_dev.mem_base + tpm_dev.data_regs + offset); in tpm_data_out()
65 if (tpm_dev.iotype == TPM_INF_IO_PORT) in tpm_data_in()
66 return inb(tpm_dev.data_regs + offset); in tpm_data_in()
68 return readb(tpm_dev.mem_base + tpm_dev.data_regs + offset); in tpm_data_in()
74 if (tpm_dev.iotype == TPM_INF_IO_PORT) in tpm_config_out()
75 outb(data, tpm_dev.config_port + offset); in tpm_config_out()
78 writeb(data, tpm_dev.mem_base + tpm_dev.index_off + offset); in tpm_config_out()
84 if (tpm_dev.iotype == TPM_INF_IO_PORT) in tpm_config_in()
85 return inb(tpm_dev.config_port + offset); in tpm_config_in()
87 return readb(tpm_dev.mem_base + tpm_dev.index_off + offset); in tpm_config_in()
409 tpm_dev.iotype = TPM_INF_IO_PORT; in tpm_inf_pnp_probe()
411 tpm_dev.config_port = pnp_port_start(dev, 0); in tpm_inf_pnp_probe()
412 tpm_dev.config_size = pnp_port_len(dev, 0); in tpm_inf_pnp_probe()
413 tpm_dev.data_regs = pnp_port_start(dev, 1); in tpm_inf_pnp_probe()
414 tpm_dev.data_size = pnp_port_len(dev, 1); in tpm_inf_pnp_probe()
415 if ((tpm_dev.data_size < 4) || (tpm_dev.config_size < 2)) { in tpm_inf_pnp_probe()
421 if (!((tpm_dev.data_regs >> 8) & 0xff)) { in tpm_inf_pnp_probe()
426 if (request_region(tpm_dev.data_regs, tpm_dev.data_size, in tpm_inf_pnp_probe()
431 if (request_region(tpm_dev.config_port, tpm_dev.config_size, in tpm_inf_pnp_probe()
433 release_region(tpm_dev.data_regs, tpm_dev.data_size); in tpm_inf_pnp_probe()
440 tpm_dev.iotype = TPM_INF_IO_MEM; in tpm_inf_pnp_probe()
442 tpm_dev.map_base = pnp_mem_start(dev, 0); in tpm_inf_pnp_probe()
443 tpm_dev.map_size = pnp_mem_len(dev, 0); in tpm_inf_pnp_probe()
449 if (request_mem_region(tpm_dev.map_base, tpm_dev.map_size, in tpm_inf_pnp_probe()
455 tpm_dev.mem_base = ioremap(tpm_dev.map_base, tpm_dev.map_size); in tpm_inf_pnp_probe()
456 if (tpm_dev.mem_base == NULL) { in tpm_inf_pnp_probe()
457 release_mem_region(tpm_dev.map_base, tpm_dev.map_size); in tpm_inf_pnp_probe()
469 tpm_dev.index_off = TPM_ADDR; in tpm_inf_pnp_probe()
470 tpm_dev.data_regs = 0x0; in tpm_inf_pnp_probe()
507 tpm_config_out((tpm_dev.data_regs >> 8) & 0xff, TPM_INF_DATA); in tpm_inf_pnp_probe()
509 tpm_config_out((tpm_dev.data_regs & 0xff), TPM_INF_DATA); in tpm_inf_pnp_probe()
517 if ((ioh << 8 | iol) != tpm_dev.data_regs) { in tpm_inf_pnp_probe()
520 tpm_dev.data_regs); in tpm_inf_pnp_probe()
541 tpm_dev.iotype == TPM_INF_IO_PORT ? in tpm_inf_pnp_probe()
542 tpm_dev.config_port : in tpm_inf_pnp_probe()
543 tpm_dev.map_base + tpm_dev.index_off, in tpm_inf_pnp_probe()
544 tpm_dev.iotype == TPM_INF_IO_PORT ? in tpm_inf_pnp_probe()
545 tpm_dev.data_regs : in tpm_inf_pnp_probe()
546 tpm_dev.map_base + tpm_dev.data_regs, in tpm_inf_pnp_probe()
568 if (tpm_dev.iotype == TPM_INF_IO_PORT) { in tpm_inf_pnp_probe()
569 release_region(tpm_dev.data_regs, tpm_dev.data_size); in tpm_inf_pnp_probe()
570 release_region(tpm_dev.config_port, tpm_dev.config_size); in tpm_inf_pnp_probe()
572 iounmap(tpm_dev.mem_base); in tpm_inf_pnp_probe()
573 release_mem_region(tpm_dev.map_base, tpm_dev.map_size); in tpm_inf_pnp_probe()
586 if (tpm_dev.iotype == TPM_INF_IO_PORT) { in tpm_inf_pnp_remove()
587 release_region(tpm_dev.data_regs, tpm_dev.data_size); in tpm_inf_pnp_remove()
588 release_region(tpm_dev.config_port, in tpm_inf_pnp_remove()
589 tpm_dev.config_size); in tpm_inf_pnp_remove()
591 iounmap(tpm_dev.mem_base); in tpm_inf_pnp_remove()
592 release_mem_region(tpm_dev.map_base, tpm_dev.map_size); in tpm_inf_pnp_remove()
602 tpm_config_out((tpm_dev.data_regs >> 8) & 0xff, TPM_INF_DATA); in tpm_inf_resume()
604 tpm_config_out((tpm_dev.data_regs & 0xff), TPM_INF_DATA); in tpm_inf_resume()