diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2005-11-16 12:28:55 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2005-11-16 12:28:55 +0000 |
commit | befa7b3e6f517d471e41f4539b20cfefdf99d00b (patch) | |
tree | 08456b5c88d96f3cc537241f0146554059cad7b2 /sys/arch/macppc/dev/adb.c | |
parent | b3a60fd52c5e08fcc358e3574480d981ba5b50cd (diff) |
Add support for the I2C controller on via-pmu.
ok deraadt@
Diffstat (limited to 'sys/arch/macppc/dev/adb.c')
-rw-r--r-- | sys/arch/macppc/dev/adb.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/arch/macppc/dev/adb.c b/sys/arch/macppc/dev/adb.c index dc57bf8c823..f28dff44802 100644 --- a/sys/arch/macppc/dev/adb.c +++ b/sys/arch/macppc/dev/adb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: adb.c,v 1.13 2005/10/21 22:07:45 kettenis Exp $ */ +/* $OpenBSD: adb.c,v 1.14 2005/11/16 12:28:54 kettenis Exp $ */ /* $NetBSD: adb.c,v 1.6 1999/08/16 06:28:09 tsubai Exp $ */ /*- @@ -41,6 +41,7 @@ #include <sys/systm.h> #include <machine/autoconf.h> +#include <dev/ofw/openfirm.h> #include <macppc/dev/adbvar.h> #include <macppc/dev/akbdvar.h> @@ -99,6 +100,9 @@ adbattach(struct device *parent, struct device *self, void *aux) { struct adb_softc *sc = (struct adb_softc *)self; struct confargs *ca = aux; + struct confargs nca; + char name[32]; + int node; ADBDataBlock adbdata; struct adb_attach_args aa_args; @@ -176,6 +180,17 @@ adbattach(struct device *parent, struct device *self, void *aux) if (adbHardware == ADB_HW_CUDA) adb_cuda_autopoll(); adb_polling = 0; + + /* Attach I2C controller. */ + for (node = OF_child(ca->ca_node); node; node = OF_peer(node)) { + if (OF_getprop(node, "name", name, sizeof name) <= 0) + continue; + if (strcmp(name, "pmu-i2c") == 0) { + nca.ca_name = "pi2c"; + nca.ca_node = node; + config_found(self, &nca, NULL); + } + } } int |