summaryrefslogtreecommitdiff
path: root/common/ioexpander.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/ioexpander.c')
-rw-r--r--common/ioexpander.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/common/ioexpander.c b/common/ioexpander.c
index ccf3cc7c4a..d3e713a243 100644
--- a/common/ioexpander.c
+++ b/common/ioexpander.c
@@ -195,6 +195,8 @@ int ioex_init(int ioex)
}
}
+ ioex_config[ioex].flags |= IOEX_FLAGS_INITIALIZED;
+
return EC_SUCCESS;
}
@@ -202,8 +204,13 @@ static void ioex_init_default(void)
{
int i;
- for (i = 0; i < CONFIG_IO_EXPANDER_PORT_COUNT; i++)
+ for (i = 0; i < CONFIG_IO_EXPANDER_PORT_COUNT; i++) {
+ /* IO Expander has been initialized, skip re-initializing */
+ if (ioex_config[i].flags & IOEX_FLAGS_INITIALIZED)
+ continue;
+
ioex_init(i);
+ }
}
DECLARE_HOOK(HOOK_INIT, ioex_init_default, HOOK_PRIO_INIT_I2C + 1);
@@ -335,4 +342,3 @@ static int command_ioex_get(int argc, char **argv)
DECLARE_SAFE_CONSOLE_COMMAND(ioexget, command_ioex_get,
"[name]",
"Read level of IO expander pin(s)");
-