pmu's i2c devices are under the "i2c" node, so find it out before
calling of_enter_i2c_devs().
This commit is contained in:
parent
56a90ee419
commit
ad6a48ee41
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: autoconf.c,v 1.183 2011/07/09 15:03:35 mrg Exp $ */
|
||||
/* $NetBSD: autoconf.c,v 1.184 2012/01/22 10:32:35 nakayama Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996
|
||||
|
@ -48,7 +48,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.183 2011/07/09 15:03:35 mrg Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.184 2012/01/22 10:32:35 nakayama Exp $");
|
||||
|
||||
#include "opt_ddb.h"
|
||||
#include "opt_kgdb.h"
|
||||
|
@ -1040,11 +1040,32 @@ noether:
|
|||
prop_dictionary_t props = device_properties(busdev);
|
||||
prop_object_t cfg = prop_dictionary_get(props,
|
||||
"i2c-child-devices");
|
||||
if (!cfg)
|
||||
if (!cfg) {
|
||||
int node;
|
||||
const char *name;
|
||||
|
||||
/*
|
||||
* pmu's i2c devices are under the "i2c" node,
|
||||
* so find it out.
|
||||
*/
|
||||
name = prom_getpropstring(busnode, "name");
|
||||
if (strcmp(name, "pmu") == 0) {
|
||||
for (node = OF_child(busnode);
|
||||
node != 0; node = OF_peer(node)) {
|
||||
name = prom_getpropstring(node,
|
||||
"name");
|
||||
if (strcmp(name, "i2c") == 0) {
|
||||
busnode = node;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
of_enter_i2c_devs(props, busnode,
|
||||
sizeof(cell_t));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* set properties for PCI framebuffers */
|
||||
if (device_is_a(busdev, "pci")) {
|
||||
|
|
Loading…
Reference in New Issue