diff options
author | Lin Huang <hl@rock-chips.com> | 2017-11-20 14:57:22 +0800 |
---|---|---|
committer | Julius Werner <jwerner@chromium.org> | 2017-11-28 19:16:17 +0000 |
commit | 18617bf21b22126f3f6761c5e0c35010362d791e (patch) | |
tree | cac16bce324a39fa00c226fc67fa28c46a8b87f9 /src/mainboard/google/gru | |
parent | 25fb09b0684769bd010cde0aa60f1b32eddb2cba (diff) | |
download | coreboot-18617bf21b22126f3f6761c5e0c35010362d791e.tar.xz |
google/gru: correct backlight gpio
it uses backlight enable pin as backlight gpio currently,
correct it and define the right backlight gpio.
Change-Id: I7c5abfd5bbbae015b899f3edc8892ea32bf82463
Signed-off-by: Lin Huang <hl@rock-chips.com>
Reviewed-on: https://review.coreboot.org/22529
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/mainboard/google/gru')
-rw-r--r-- | src/mainboard/google/gru/board.h | 6 | ||||
-rw-r--r-- | src/mainboard/google/gru/chromeos.c | 2 | ||||
-rw-r--r-- | src/mainboard/google/gru/mainboard.c | 6 |
3 files changed, 11 insertions, 3 deletions
diff --git a/src/mainboard/google/gru/board.h b/src/mainboard/google/gru/board.h index 5722260bc9..41157f0ef3 100644 --- a/src/mainboard/google/gru/board.h +++ b/src/mainboard/google/gru/board.h @@ -25,7 +25,8 @@ #define GPIO_SDMMC_PWR GPIO(4, D, 5) #if IS_ENABLED(CONFIG_GRU_BASEBOARD_SCARLET) -#define GPIO_BACKLIGHT GPIO(4, C, 5) +#define GPIO_BL_EN GPIO(4, C, 5) +#define GPIO_BACKLIGHT GPIO(4, C, 6) #define GPIO_EC_IN_RW GPIO(0, A, 1) #define GPIO_EC_IRQ GPIO(1, C, 2) #define GPIO_P15V_EN dead_code_t(gpio_t, "PP1500 doesn't exist on scarlet.") @@ -36,7 +37,8 @@ #define GPIO_TPM_IRQ GPIO(1, C, 1) #define GPIO_WP GPIO(0, B, 5) #else -#define GPIO_BACKLIGHT GPIO(1, C, 1) +#define GPIO_BL_EN GPIO(1, C, 1) +#define GPIO_BACKLIGHT dead_code_t(gpio_t, "backlight controlled by ec") #define GPIO_EC_IN_RW GPIO(3, B, 0) #define GPIO_EC_IRQ GPIO(0, A, 1) #define GPIO_P15V_EN GPIO(0, B, 2) diff --git a/src/mainboard/google/gru/chromeos.c b/src/mainboard/google/gru/chromeos.c index 0dd03eaeef..38f7f6987e 100644 --- a/src/mainboard/google/gru/chromeos.c +++ b/src/mainboard/google/gru/chromeos.c @@ -32,7 +32,9 @@ void fill_lb_gpios(struct lb_gpios *gpios) {GPIO_WP.raw, ACTIVE_HIGH, get_write_protect_state(), "write protect"}, {-1, ACTIVE_HIGH, get_recovery_mode_switch(), "recovery"}, +#if IS_ENABLED(CONFIG_GRU_BASEBOARD_SCARLET) {GPIO_BACKLIGHT.raw, ACTIVE_HIGH, -1, "backlight"}, +#endif {GPIO_EC_IN_RW.raw, ACTIVE_HIGH, -1, "EC in RW"}, {GPIO_EC_IRQ.raw, ACTIVE_LOW, -1, "EC interrupt"}, {GPIO_RESET.raw, ACTIVE_HIGH, -1, "reset"}, diff --git a/src/mainboard/google/gru/mainboard.c b/src/mainboard/google/gru/mainboard.c index 296d9ad56a..653e49af7c 100644 --- a/src/mainboard/google/gru/mainboard.c +++ b/src/mainboard/google/gru/mainboard.c @@ -369,7 +369,11 @@ static void prepare_backlight_i2c(void) void mainboard_power_on_backlight(void) { - gpio_output(GPIO_BACKLIGHT, 1); /* BL_EN */ + gpio_output(GPIO_BL_EN, 1); /* BL_EN */ + + /* Configure as output GPIO, to be toggled by payload. */ + if (IS_ENABLED(CONFIG_GRU_BASEBOARD_SCARLET)) + gpio_output(GPIO_BACKLIGHT, 0); if (IS_ENABLED(CONFIG_BOARD_GOOGLE_GRU)) prepare_backlight_i2c(); |