aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2005-11-23 01:57:25 -0500
committerPaul Mackerras <paulus@samba.org>2006-01-08 22:49:54 -0500
commit51d3082fe6e55aecfa17113dbe98077c749f724c (patch)
tree9a1e2355d5988d8cc1ca511d53c1bb24b0baa17f /drivers/i2c
parent463ce0e103f419f51b1769111e73fe8bb305d0ec (diff)
[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
505create_iface(struct device_node *np, struct device *dev) 505create_iface(struct device_node *np, struct device *dev)
506{ 506{
507 unsigned long steps; 507 unsigned long steps;
508 unsigned bsteps, tsize, i, nchan, addroffset; 508 unsigned bsteps, tsize, i, nchan;
509 struct keywest_iface* iface; 509 struct keywest_iface* iface;
510 u32 *psteps, *prate; 510 u32 *psteps, *prate, *addrp;
511 int rc; 511 int rc;
512 512
513 if (np->n_intrs < 1 || np->n_addrs < 1) { 513 if (np->n_intrs < 1) {
514 printk(KERN_ERR "%s: Missing interrupt or address !\n", 514 printk(KERN_ERR "%s: Missing interrupt !\n",
515 np->full_name); 515 np->full_name);
516 return -ENODEV; 516 return -ENODEV;
517 } 517 }
518 addrp = (u32 *)get_property(np, "AAPL,address", NULL);
519 if (addrp == NULL) {
520 printk(KERN_ERR "%s: Can't find address !\n",
521 np->full_name);
522 return -ENODEV;
523 }
524
518 if (pmac_low_i2c_lock(np)) 525 if (pmac_low_i2c_lock(np))
519 return -ENODEV; 526 return -ENODEV;
520 527
@@ -525,13 +532,10 @@ create_iface(struct device_node *np, struct device *dev)
525 for (bsteps = 0; (steps & 0x01) == 0; bsteps++) 532 for (bsteps = 0; (steps & 0x01) == 0; bsteps++)
526 steps >>= 1; 533 steps >>= 1;
527 534
528 if (np->parent->name[0] == 'u') { 535 if (np->parent->name[0] == 'u')
529 nchan = 2; 536 nchan = 2;
530 addroffset = 3; 537 else
531 } else {
532 addroffset = 0;
533 nchan = 1; 538 nchan = 1;
534 }
535 539
536 tsize = sizeof(struct keywest_iface) + 540 tsize = sizeof(struct keywest_iface) +
537 (sizeof(struct keywest_chan) + 4) * nchan; 541 (sizeof(struct keywest_chan) + 4) * nchan;
@@ -550,8 +554,7 @@ create_iface(struct device_node *np, struct device *dev)
550 iface->irq = np->intrs[0].line; 554 iface->irq = np->intrs[0].line;
551 iface->channels = (struct keywest_chan *) 555 iface->channels = (struct keywest_chan *)
552 (((unsigned long)(iface + 1) + 3UL) & ~3UL); 556 (((unsigned long)(iface + 1) + 3UL) & ~3UL);
553 iface->base = ioremap(np->addrs[0].address + addroffset, 557 iface->base = ioremap(*addrp, 0x1000);
554 np->addrs[0].size);
555 if (!iface->base) { 558 if (!iface->base) {
556 printk(KERN_ERR "i2c-keywest: can't map inteface !\n"); 559 printk(KERN_ERR "i2c-keywest: can't map inteface !\n");
557 kfree(iface); 560 kfree(iface);