lightbar: add reset GPIO

De-assert the lightbar reset GPIO to be able to access its registers.

According to the HW guys, it will consume less power in standby than in
reset due the pull-up on the reset line.

Signed-off-by: Bill Richardson <wfrichar@chromium.org>

BUG=None
TEST=manual

On Link proto-1, type "lightbar test" in the EC console and see it blink.

On BDS, just build it. Nothing actually changes for BDS.

Change-Id: I9ec612c80f48d41ccf779f0962fc047966d4b7ba
This commit is contained in:
Bill Richardson
2012-04-03 17:57:05 -07:00
parent 422f8ea6ba
commit e881236a72
3 changed files with 7 additions and 4 deletions

View File

@@ -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"),
};

View File

@@ -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

View File

@@ -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);