i2c-indirect-config == false --> i2c-no-indirect-config == true

This commit is contained in:
thorpej 2020-06-12 03:32:30 +00:00
parent 113ec9c52a
commit 8a919d640d
3 changed files with 13 additions and 14 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.218 2020/06/09 21:57:00 macallan Exp $ */
/* $NetBSD: autoconf.c,v 1.219 2020/06/12 03:32:30 thorpej Exp $ */
/*
* Copyright (c) 1996
@ -48,7 +48,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.218 2020/06/09 21:57:00 macallan Exp $");
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.219 2020/06/12 03:32:30 thorpej Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -1391,7 +1391,7 @@ noether:
prop_dictionary_set(props, "i2c-child-devices",
cfg);
prop_dictionary_set_bool(props,
"i2c-indirect-config", false);
"i2c-no-indirect-config", true);
}
/* ADM1026 at 0x2e */

View File

@ -1,4 +1,4 @@
/* $NetBSD: fdt_i2c.c,v 1.7 2019/04/24 06:03:02 thorpej Exp $ */
/* $NetBSD: fdt_i2c.c,v 1.8 2020/06/12 03:32:30 thorpej Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: fdt_i2c.c,v 1.7 2019/04/24 06:03:02 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: fdt_i2c.c,v 1.8 2020/06/12 03:32:30 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@ -123,7 +123,7 @@ fdtbus_attach_i2cbus(device_t dev, int phandle, i2c_tag_t tag, cfprint_t print)
prop_object_release(devs);
props = device_properties(dev);
prop_dictionary_set_bool(props, "i2c-indirect-config", false);
prop_dictionary_set_bool(props, "i2c-no-indirect-config", true);
ret = config_found_ia(dev, "i2cbus", &iba, print);
if (iba.iba_child_devices)

View File

@ -1,4 +1,4 @@
/* $NetBSD: i2c.c,v 1.73 2020/06/11 02:39:30 thorpej Exp $ */
/* $NetBSD: i2c.c,v 1.74 2020/06/12 03:32:30 thorpej Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@ -40,7 +40,7 @@
#endif
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.73 2020/06/11 02:39:30 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.74 2020/06/12 03:32:30 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -400,7 +400,7 @@ iic_attach(device_t parent, device_t self, void *aux)
char *buf;
i2c_tag_t ic;
int rv;
bool indirect_config;
bool no_indirect_config = false;
aprint_naive("\n");
aprint_normal(": I2C bus\n");
@ -424,12 +424,11 @@ iic_attach(device_t parent, device_t self, void *aux)
if (iba->iba_child_devices) {
child_devices = iba->iba_child_devices;
indirect_config = false;
no_indirect_config = true;
} else {
props = device_properties(parent);
if (!prop_dictionary_get_bool(props, "i2c-indirect-config",
&indirect_config))
indirect_config = true;
prop_dictionary_get_bool(props, "i2c-no-indirect-config",
&no_indirect_config);
child_devices = prop_dictionary_get(props, "i2c-child-devices");
}
@ -495,7 +494,7 @@ iic_attach(device_t parent, device_t self, void *aux)
if (buf)
free(buf, M_TEMP);
}
} else if (indirect_config) {
} else if (!no_indirect_config) {
/*
* Attach all i2c devices described in the kernel
* configuration file.