diff --git a/board/bds/board.c b/board/bds/board.c index 6a76c03e03..e433b818d7 100644 --- a/board/bds/board.c +++ b/board/bds/board.c @@ -79,6 +79,7 @@ const struct gpio_info gpio_list[GPIO_COUNT] = { GPIO_SIGNAL_NOT_IMPLEMENTED("SHUNT_1_5V_DDR"), GPIO_SIGNAL_NOT_IMPLEMENTED("RECOVERYn"), GPIO_SIGNAL_NOT_IMPLEMENTED("WRITE_PROTECTn"), + GPIO_SIGNAL_NOT_IMPLEMENTED("LIGHTBAR_RESETn"), }; diff --git a/board/bds/board.h b/board/bds/board.h index 0b96e493c2..1aed0f314a 100644 --- a/board/bds/board.h +++ b/board/bds/board.h @@ -119,6 +119,7 @@ enum gpio_signal { * depending on stuffing. */ GPIO_RECOVERYn, /* Recovery signal from servo */ GPIO_WRITE_PROTECTn, /* Write protect input */ + GPIO_LIGHTBAR_RESETn, /* Reset lightbar controllers (Proto1+) */ /* Number of GPIOs; not an actual GPIO */ GPIO_COUNT diff --git a/common/lightbar.c b/common/lightbar.c index 6cc897d25a..743962e43f 100644 --- a/common/lightbar.c +++ b/common/lightbar.c @@ -7,6 +7,7 @@ #include "board.h" #include "console.h" +#include "gpio.h" #include "i2c.h" #include "timer.h" #include "uart.h" @@ -58,11 +59,11 @@ static const struct { /****************************************************************************/ /* External interface functions. */ -/* Shut down the driver chips, so everything is off. */ +/* We don't actually shut down the driver chips, because the reset pullup + * uses more power than leaving them enabled but inactive. */ void lightbar_off(void) { - /* FIXME: nRST is attached to a GPIO on link, so just assert it. For - * now we'll just put the drivers into standby, but won't reset. */ + gpio_set_level(GPIO_LIGHTBAR_RESETn, 1); i2c_write8(I2C_PORT_LIGHTBAR, DRIVER_FUN, 0x01, 0x00); i2c_write8(I2C_PORT_LIGHTBAR, DRIVER_SMART, 0x01, 0x00); } @@ -71,7 +72,7 @@ void lightbar_off(void) void lightbar_on(void) { int i; - /* FIXME: If nRST is asserted, deassert it. */ + gpio_set_level(GPIO_LIGHTBAR_RESETn, 1); for (i = 0; i < ARRAY_SIZE(ready_vals); i++) { i2c_write8(I2C_PORT_LIGHTBAR, DRIVER_FUN, ready_vals[i].reg, ready_vals[i].val);