-/* $OpenBSD: rkiic.c,v 1.5 2020/03/01 10:18:19 kettenis Exp $ */
+/* $OpenBSD: rkiic.c,v 1.6 2021/03/11 08:55:59 patrick Exp $ */
/*
* Copyright (c) 2017 Mark Kettenis <kettenis@openbsd.org>
*
{
int iba_node = *(int *)arg;
struct i2c_attach_args ia;
- char name[32];
+ char name[32], status[32];
uint32_t reg[1];
int node;
for (node = OF_child(iba_node); node; node = OF_peer(node)) {
memset(name, 0, sizeof(name));
+ memset(status, 0, sizeof(status));
memset(reg, 0, sizeof(reg));
if (OF_getprop(node, "compatible", name, sizeof(name)) == -1)
if (name[0] == '\0')
continue;
+ if (OF_getprop(node, "status", status, sizeof(status)) > 0 &&
+ strcmp(status, "disabled") == 0)
+ continue;
+
if (OF_getprop(node, "reg", ®, sizeof(reg)) != sizeof(reg))
continue;