diff options
-rw-r--r-- | driver/retimer/bb_retimer.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/driver/retimer/bb_retimer.c b/driver/retimer/bb_retimer.c index 88eb4835fc..cd18a7a6ef 100644 --- a/driver/retimer/bb_retimer.c +++ b/driver/retimer/bb_retimer.c @@ -676,7 +676,9 @@ const struct usb_mux_driver bb_usb_retimer = { static int console_command_bb_retimer(int argc, const char **argv) { char rw, *e; - int port, reg, data, val = 0; + int port; + uint8_t reg; + uint32_t data, val = 0; int rv = EC_SUCCESS; const struct usb_mux *mux; const struct usb_mux_chain *mux_chain; @@ -706,14 +708,14 @@ static int console_command_bb_retimer(int argc, const char **argv) return EC_ERROR_PARAM2; /* Get register address */ - reg = strtoi(argv[3], &e, 0); - if (*e || reg < 0) + reg = (uint8_t)strtoull(argv[3], &e, 0); + if (*e) return EC_ERROR_PARAM3; /* Get value to be written */ if (rw == 'w') { - val = strtoi(argv[4], &e, 0); - if (*e || val < 0) + val = strtoull(argv[4], &e, 0); + if (*e) return EC_ERROR_PARAM4; } @@ -738,7 +740,9 @@ static int console_command_bb_retimer(int argc, const char **argv) return rv; } +/* TODO(b/278138274): Use common console command for all Retimers */ DECLARE_CONSOLE_COMMAND(bb, console_command_bb_retimer, - "<port> <r/w> <reg> | <val>", + "<port> r <reg>" + "\n<port> w <reg> <val>", "Read or write to BB retimer register"); #endif /* CONFIG_CMD_RETIMER */ |