summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Chen <philipchen@google.com>2017-04-06 10:17:08 -0700
committerJulius Werner <jwerner@chromium.org>2017-04-06 20:45:51 +0200
commita304b69a45fdb210e47e98af95a2e80277c588d5 (patch)
treebb750c5fe06ed379e678abe54198df2e4eef152c
parentc91ab1cfce1558a434dcc501ec57922928dafac0 (diff)
gru: Initialize I2C bus for ARC2C0608
BUG=b:35583511 TEST=check i2c bus 0 initializes from ap console log Change-Id: Ibb6709159f5ed28ad0b62397d2ddb504dec55167 Signed-off-by: Philip Chen <philipchen@google.com> Reviewed-on: https://review.coreboot.org/19105 Tested-by: build bot (Jenkins) Reviewed-by: Julius Werner <jwerner@chromium.org>
-rw-r--r--src/mainboard/google/gru/mainboard.c34
1 files changed, 3 insertions, 31 deletions
diff --git a/src/mainboard/google/gru/mainboard.c b/src/mainboard/google/gru/mainboard.c
index bb9b6fca98..1c823f3e7c 100644
--- a/src/mainboard/google/gru/mainboard.c
+++ b/src/mainboard/google/gru/mainboard.c
@@ -333,30 +333,8 @@ static void mainboard_init(device_t dev)
register_apio_suspend();
}
-static void enable_backlight_booster(void)
+static void prepare_backlight_i2c(void)
{
- const struct {
- uint8_t reg;
- uint8_t value;
- } i2c_writes[] = {
- {1, 0x84},
- {1, 0x85},
- {0, 0x26}
- };
- int i;
- const int booster_i2c_port = 0;
- uint8_t i2c_buf[2];
- struct i2c_seg i2c_command = { .read = 0, .chip = 0x2c,
- .buf = i2c_buf, .len = sizeof(i2c_buf)
- };
-
- /*
- * This function is called on Gru right after BL_EN is asserted. It
- * takes time for the switcher chip to come online, let's wait a bit
- * to let the voltage settle, so that the chip can be accessed.
- */
- udelay(1000);
-
gpio_input(GPIO(1, B, 7)); /* I2C0_SDA remove pull_up */
gpio_input(GPIO(1, C, 0)); /* I2C0_SCL remove pull_up */
@@ -364,20 +342,14 @@ static void enable_backlight_booster(void)
write32(&rk3399_pmugrf->iomux_i2c0_sda, IOMUX_I2C0_SDA);
write32(&rk3399_pmugrf->iomux_i2c0_scl, IOMUX_I2C0_SCL);
-
- for (i = 0; i < ARRAY_SIZE(i2c_writes); i++) {
- i2c_buf[0] = i2c_writes[i].reg;
- i2c_buf[1] = i2c_writes[i].value;
- i2c_transfer(booster_i2c_port, &i2c_command, 1);
- }
}
void mainboard_power_on_backlight(void)
{
gpio_output(GPIO_BACKLIGHT, 1); /* BL_EN */
- if (IS_ENABLED(CONFIG_BOARD_GOOGLE_GRU) && board_id() == 0)
- enable_backlight_booster();
+ if (IS_ENABLED(CONFIG_BOARD_GOOGLE_GRU))
+ prepare_backlight_i2c();
}
static void mainboard_enable(device_t dev)