aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc
diff options
context:
space:
mode:
authorAl Viro <viro@www.linux.org.uk>2005-04-25 10:55:58 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-25 10:55:58 -0400
commitd01daf72f0a238c5ccfba7bf82999e384927412e (patch)
tree77ad6895e968291f1a7f012f4d20696c1a04058e /arch/ppc
parentba724a373a7184dce869e8adb79a0a03d91fbdd8 (diff)
[PATCH] ppc iomem annotations: pmac_low_i2c
Signed-off-by: Al Viro <viro@parcelfarce.linux.theplanet.co.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/ppc')
-rw-r--r--arch/ppc/platforms/pmac_low_i2c.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/arch/ppc/platforms/pmac_low_i2c.c b/arch/ppc/platforms/pmac_low_i2c.c
index d07579f2b8b9..08583fce1692 100644
--- a/arch/ppc/platforms/pmac_low_i2c.c
+++ b/arch/ppc/platforms/pmac_low_i2c.c
@@ -54,7 +54,7 @@ struct low_i2c_host
54 int mode; /* Current mode */ 54 int mode; /* Current mode */
55 int channel; /* Current channel */ 55 int channel; /* Current channel */
56 int num_channels; /* Number of channels */ 56 int num_channels; /* Number of channels */
57 unsigned long base; /* For keywest-i2c, base address */ 57 void __iomem * base; /* For keywest-i2c, base address */
58 int bsteps; /* And register stepping */ 58 int bsteps; /* And register stepping */
59 int speed; /* And speed */ 59 int speed; /* And speed */
60}; 60};
@@ -154,14 +154,12 @@ static const char *__kw_state_names[] = {
154 154
155static inline u8 __kw_read_reg(struct low_i2c_host *host, reg_t reg) 155static inline u8 __kw_read_reg(struct low_i2c_host *host, reg_t reg)
156{ 156{
157 return in_8(((volatile u8 *)host->base) 157 return in_8(host->base + (((unsigned)reg) << host->bsteps));
158 + (((unsigned)reg) << host->bsteps));
159} 158}
160 159
161static inline void __kw_write_reg(struct low_i2c_host *host, reg_t reg, u8 val) 160static inline void __kw_write_reg(struct low_i2c_host *host, reg_t reg, u8 val)
162{ 161{
163 out_8(((volatile u8 *)host->base) 162 out_8(host->base + (((unsigned)reg) << host->bsteps), val);
164 + (((unsigned)reg) << host->bsteps), val);
165 (void)__kw_read_reg(host, reg_subaddr); 163 (void)__kw_read_reg(host, reg_subaddr);
166} 164}
167 165
@@ -370,7 +368,7 @@ static void keywest_low_i2c_add(struct device_node *np)
370 break; 368 break;
371 } 369 }
372 host->mode = pmac_low_i2c_mode_std; 370 host->mode = pmac_low_i2c_mode_std;
373 host->base = (unsigned long)ioremap(np->addrs[0].address + aoffset, 371 host->base = ioremap(np->addrs[0].address + aoffset,
374 np->addrs[0].size); 372 np->addrs[0].size);
375 host->func = keywest_low_i2c_func; 373 host->func = keywest_low_i2c_func;
376} 374}