summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--driver/usb_mux.c4
-rw-r--r--include/usb_mux.h9
2 files changed, 13 insertions, 0 deletions
diff --git a/driver/usb_mux.c b/driver/usb_mux.c
index a067fc1c25..619c32ba21 100644
--- a/driver/usb_mux.c
+++ b/driver/usb_mux.c
@@ -24,6 +24,10 @@ void usb_mux_init(int port)
res = mux->driver->init(mux->port_addr);
if (res)
CPRINTS("Error initializing mux port(%d): %d", port, res);
+
+ /* Apply board specific initialization */
+ if (mux->board_init)
+ mux->board_init(mux);
}
/*
diff --git a/include/usb_mux.h b/include/usb_mux.h
index 3cb5c4e49d..1524caa3fa 100644
--- a/include/usb_mux.h
+++ b/include/usb_mux.h
@@ -66,6 +66,15 @@ struct usb_mux {
const int port_addr;
/* Mux driver */
const struct usb_mux_driver *driver;
+
+ /**
+ * Board specific initialization for USB mux that is
+ * called after mux->driver->init() function.
+ *
+ * @param mux USB mux to tune
+ * @return EC_SUCCESS on success, non-zero error code on failure.
+ */
+ int (*board_init)(const struct usb_mux *mux);
};
/* Supported USB mux drivers */