aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/tpm/tpm_atmel.h
diff options
context:
space:
mode:
authorKylene Jo Hall <kjhall@us.ibm.com>2005-11-18 04:10:58 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-18 10:49:45 -0500
commit90612b308f2a2cc8aa08fbaf6f7184f5b7b5a855 (patch)
treeec50684193a201c7f6762287ce4f3b66bae1b04d /drivers/char/tpm/tpm_atmel.h
parentba3961152e7016237e15e3dfc18f08c1853d156b (diff)
[PATCH] tpm: use ioread8 and iowrite8
Use ioread8 and iowrite8 as suggested. Signed-off-by: Kylene Hall <kjhall@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char/tpm/tpm_atmel.h')
-rw-r--r--drivers/char/tpm/tpm_atmel.h22
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/char/tpm/tpm_atmel.h b/drivers/char/tpm/tpm_atmel.h
index 3c5b9a8d1c49..d3478aaadd77 100644
--- a/drivers/char/tpm/tpm_atmel.h
+++ b/drivers/char/tpm/tpm_atmel.h
@@ -27,12 +27,14 @@
27#define atmel_putb(val, chip, offset) writeb(val, chip->vendor->iobase + offset) 27#define atmel_putb(val, chip, offset) writeb(val, chip->vendor->iobase + offset)
28#define atmel_request_region request_mem_region 28#define atmel_request_region request_mem_region
29#define atmel_release_region release_mem_region 29#define atmel_release_region release_mem_region
30static inline void atmel_put_base_addr(struct tpm_vendor_specific *vendor) 30
31static inline void atmel_put_base_addr(struct tpm_vendor_specific
32 *vendor)
31{ 33{
32 iounmap(vendor->iobase); 34 iounmap(vendor->iobase);
33} 35}
34 36
35static int atmel_get_base_addr(struct tpm_vendor_specific *vendor) 37static void __iomem * atmel_get_base_addr(struct tpm_vendor_specific *vendor)
36{ 38{
37 struct device_node *dn; 39 struct device_node *dn;
38 unsigned long address, size; 40 unsigned long address, size;
@@ -44,11 +46,11 @@ static int atmel_get_base_addr(struct tpm_vendor_specific *vendor)
44 dn = of_find_node_by_name(NULL, "tpm"); 46 dn = of_find_node_by_name(NULL, "tpm");
45 47
46 if (!dn) 48 if (!dn)
47 return 1; 49 return NULL;
48 50
49 if (!device_is_compatible(dn, "AT97SC3201")) { 51 if (!device_is_compatible(dn, "AT97SC3201")) {
50 of_node_put(dn); 52 of_node_put(dn);
51 return 1; 53 return NULL;
52 } 54 }
53 55
54 reg = (unsigned int *) get_property(dn, "reg", &reglen); 56 reg = (unsigned int *) get_property(dn, "reg", &reglen);
@@ -71,8 +73,7 @@ static int atmel_get_base_addr(struct tpm_vendor_specific *vendor)
71 73
72 vendor->base = address; 74 vendor->base = address;
73 vendor->region_size = size; 75 vendor->region_size = size;
74 vendor->iobase = ioremap(address, size); 76 return ioremap(vendor->base, vendor->region_size);
75 return 0;
76} 77}
77#else 78#else
78#define atmel_getb(chip, offset) inb(chip->vendor->base + offset) 79#define atmel_getb(chip, offset) inb(chip->vendor->base + offset)
@@ -105,18 +106,19 @@ static int atmel_verify_tpm11(void)
105 return 0; 106 return 0;
106} 107}
107 108
108static inline void atmel_put_base_addr(struct tpm_vendor_specific *vendor) 109static inline void atmel_put_base_addr(struct tpm_vendor_specific
110 *vendor)
109{ 111{
110} 112}
111 113
112/* Determine where to talk to device */ 114/* Determine where to talk to device */
113static unsigned long atmel_get_base_addr(struct tpm_vendor_specific 115static void __iomem * atmel_get_base_addr(struct tpm_vendor_specific
114 *vendor) 116 *vendor)
115{ 117{
116 int lo, hi; 118 int lo, hi;
117 119
118 if (atmel_verify_tpm11() != 0) 120 if (atmel_verify_tpm11() != 0)
119 return 1; 121 return NULL;
120 122
121 lo = tpm_read_index(TPM_ADDR, TPM_ATMEL_BASE_ADDR_LO); 123 lo = tpm_read_index(TPM_ADDR, TPM_ATMEL_BASE_ADDR_LO);
122 hi = tpm_read_index(TPM_ADDR, TPM_ATMEL_BASE_ADDR_HI); 124 hi = tpm_read_index(TPM_ADDR, TPM_ATMEL_BASE_ADDR_HI);
@@ -124,6 +126,6 @@ static unsigned long atmel_get_base_addr(struct tpm_vendor_specific
124 vendor->base = (hi << 8) | lo; 126 vendor->base = (hi << 8) | lo;
125 vendor->region_size = 2; 127 vendor->region_size = 2;
126 128
127 return 0; 129 return ioport_map(vendor->base, vendor->region_size);
128} 130}
129#endif 131#endif