mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-28 10:45:22 +00:00
usb_mux: Add a callback for board specific init
This adds a callback for board specific initialization that is called after the driver init function. This will allow a board to apply port-specific tuning (such as USB EQ settings) to the mux chip. BUG=chrome-os-partner:47074 BRANCH=none TEST=build and boot on chell Change-Id: Ib162f9a2c5239678c46b80e5517823b336f6b66c Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/313746 Reviewed-by: Shawn N <shawnn@chromium.org>
This commit is contained in:
committed by
chrome-bot
parent
156461b212
commit
1ea9dece80
@@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user