summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2009-08-12 14:11:53 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2009-08-12 14:11:53 +0000
commit75d94a306a3a9d02dd53bd7803bd9b759a789135 (patch)
treea1555e4f1b8d5f4372977a283f727a7bb10fd234
parent15ebd85782678156e9844b3efbf977da6e380f2d (diff)
Apple is hopelessly inconsistent with their firmware, so some machines have
an extra smu-i2c-control node where others don't. Handle the difference. Makes the PowerMac9,1 actually find some i2c devices.
-rw-r--r--sys/arch/macppc/dev/smu.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/arch/macppc/dev/smu.c b/sys/arch/macppc/dev/smu.c
index 44227bf0139..dc933372032 100644
--- a/sys/arch/macppc/dev/smu.c
+++ b/sys/arch/macppc/dev/smu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smu.c,v 1.21 2009/08/12 12:30:51 kettenis Exp $ */
+/* $OpenBSD: smu.c,v 1.22 2009/08/12 14:11:52 kettenis Exp $ */
/*
* Copyright (c) 2005 Mark Kettenis
@@ -377,8 +377,16 @@ smu_attach(struct device *parent, struct device *self, void *aux)
sc->sc_i2c_tag.ic_release_bus = smu_i2c_release_bus;
sc->sc_i2c_tag.ic_exec = smu_i2c_exec;
+ /*
+ * Early versions of the SMU have the i2c bus node directly
+ * below the "smu" node, while later models have an
+ * intermediate "smu-i2c-control" node.
+ */
node = OF_getnodebyname(ca->ca_node, "smu-i2c-control");
- node = OF_child(node);
+ if (node)
+ node = OF_child(node);
+ else
+ node = OF_getnodebyname(ca->ca_node, "i2c");
bzero(&iba, sizeof iba);
iba.iba_name = "iic";