summaryrefslogtreecommitdiff
path: root/drivers/i2c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2005-11-23 09:57:25 +0300
committerPaul Mackerras <paulus@samba.org>2006-01-09 06:49:54 +0300
commit51d3082fe6e55aecfa17113dbe98077c749f724c (patch)
tree9a1e2355d5988d8cc1ca511d53c1bb24b0baa17f /drivers/i2c
parent463ce0e103f419f51b1769111e73fe8bb305d0ec (diff)
downloadlinux-51d3082fe6e55aecfa17113dbe98077c749f724c.tar.xz
[PATCH] powerpc: Unify udbg (#2)
This patch unifies udbg for both ppc32 and ppc64 when building the merged achitecture. xmon now has a single "back end". The powermac udbg stuff gets enriched with some ADB capabilities and btext output. In addition, the early_init callback is now called on ppc32 as well, approx. in the same order as ppc64 regarding device-tree manipulations. The init sequences of ppc32 and ppc64 are getting closer, I'll unify them in a later patch. For now, you can force udbg to the scc using "sccdbg" or to btext using "btextdbg" on powermacs. I'll implement a cleaner way of forcing udbg output to something else than the autodetected OF output device in a later patch. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-keywest.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/drivers/i2c/busses/i2c-keywest.c b/drivers/i2c/busses/i2c-keywest.c
index d61f748278fc..93e7080e3bc5 100644
--- a/drivers/i2c/busses/i2c-keywest.c
+++ b/drivers/i2c/busses/i2c-keywest.c
@@ -505,16 +505,23 @@ static int
create_iface(struct device_node *np, struct device *dev)
{
unsigned long steps;
- unsigned bsteps, tsize, i, nchan, addroffset;
+ unsigned bsteps, tsize, i, nchan;
struct keywest_iface* iface;
- u32 *psteps, *prate;
+ u32 *psteps, *prate, *addrp;
int rc;
- if (np->n_intrs < 1 || np->n_addrs < 1) {
- printk(KERN_ERR "%s: Missing interrupt or address !\n",
+ if (np->n_intrs < 1) {
+ printk(KERN_ERR "%s: Missing interrupt !\n",
np->full_name);
return -ENODEV;
}
+ addrp = (u32 *)get_property(np, "AAPL,address", NULL);
+ if (addrp == NULL) {
+ printk(KERN_ERR "%s: Can't find address !\n",
+ np->full_name);
+ return -ENODEV;
+ }
+
if (pmac_low_i2c_lock(np))
return -ENODEV;
@@ -525,13 +532,10 @@ create_iface(struct device_node *np, struct device *dev)
for (bsteps = 0; (steps & 0x01) == 0; bsteps++)
steps >>= 1;
- if (np->parent->name[0] == 'u') {
+ if (np->parent->name[0] == 'u')
nchan = 2;
- addroffset = 3;
- } else {
- addroffset = 0;
+ else
nchan = 1;
- }
tsize = sizeof(struct keywest_iface) +
(sizeof(struct keywest_chan) + 4) * nchan;
@@ -550,8 +554,7 @@ create_iface(struct device_node *np, struct device *dev)
iface->irq = np->intrs[0].line;
iface->channels = (struct keywest_chan *)
(((unsigned long)(iface + 1) + 3UL) & ~3UL);
- iface->base = ioremap(np->addrs[0].address + addroffset,
- np->addrs[0].size);
+ iface->base = ioremap(*addrp, 0x1000);
if (!iface->base) {
printk(KERN_ERR "i2c-keywest: can't map inteface !\n");
kfree(iface);