diff options
Diffstat (limited to 'board')
-rw-r--r-- | board/plankton/board.c | 17 | ||||
-rw-r--r-- | board/plankton/board.h | 1 |
2 files changed, 18 insertions, 0 deletions
diff --git a/board/plankton/board.c b/board/plankton/board.c index 05fde4bbd9..cb60dcd353 100644 --- a/board/plankton/board.c +++ b/board/plankton/board.c @@ -11,6 +11,7 @@ #include "gpio.h" #include "hooks.h" #include "i2c.h" +#include "ioexpander_pca9534.h" #include "registers.h" #include "task.h" #include "timer.h" @@ -198,3 +199,19 @@ DECLARE_CONSOLE_COMMAND(usbc_action, cmd_usbc_action, "<5v|12v|20v|dev|usb|dp|flip|pol0|pol1>", "Set Plankton type-C port state", NULL); + +static int cmd_usb_hub_reset(int argc, char *argv[]) +{ + int ret; + + ret = pca9534_config_pin(I2C_PORT_MASTER, 0x40, 7, PCA9534_OUTPUT); + if (ret) + return ret; + ret = pca9534_set_level(I2C_PORT_MASTER, 0x40, 7, 0); + if (ret) + return ret; + usleep(100 * MSEC); + return pca9534_set_level(I2C_PORT_MASTER, 0x40, 7, 1); +} +DECLARE_CONSOLE_COMMAND(hub_reset, cmd_usb_hub_reset, + NULL, "Reset USB hub", NULL); diff --git a/board/plankton/board.h b/board/plankton/board.h index e5a036e7fe..323143bcd3 100644 --- a/board/plankton/board.h +++ b/board/plankton/board.h @@ -24,6 +24,7 @@ #define CONFIG_ADC #define CONFIG_HW_CRC #define CONFIG_I2C +#define CONFIG_IO_EXPANDER_PCA9534 #undef CONFIG_WATCHDOG_HELP #undef CONFIG_LID_SWITCH #undef CONFIG_TASK_PROFILING |