diff options
author | Matt DeVillier <matt.devillier@gmail.com> | 2016-12-02 23:27:32 -0600 |
---|---|---|
committer | Nico Huber <nico.h@gmx.de> | 2016-12-07 23:43:49 +0100 |
commit | 0b7c72c70c70c7d0dd73a86606ecd4661b184165 (patch) | |
tree | 4e7a35dd36e199957372571af67692a5ffae6ec7 | |
parent | 4015608ed776a8c63c928b5b59ed9e3ad6d677ca (diff) | |
download | coreboot-0b7c72c70c70c7d0dd73a86606ecd4661b184165.tar.xz |
google/beltino: fix LED, simplify function for Tricky variant
Simplify set_power_led() by consolidating switch and setting values
as needed inline based on LED state.
Fix non-off LED polarity for Tricky using correct value from Chromium source
TEST: power on Tricky, observe LED lit / solid
Change-Id: I8bc7c4ae3f83d3f37b76fd5c90a4faed7057ebee
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/17719
Tested-by: build bot (Jenkins)
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
-rw-r--r-- | src/mainboard/google/beltino/variants/tricky/led.c | 34 |
1 files changed, 9 insertions, 25 deletions
diff --git a/src/mainboard/google/beltino/variants/tricky/led.c b/src/mainboard/google/beltino/variants/tricky/led.c index 72498a306e..e6ca6eb8d0 100644 --- a/src/mainboard/google/beltino/variants/tricky/led.c +++ b/src/mainboard/google/beltino/variants/tricky/led.c @@ -19,29 +19,13 @@ void set_power_led(int state) { - switch (state) { - case LED_ON: - case LED_OFF: - it8772f_gpio_led(IT8772F_GPIO_DEV, - 2 /* set */, - 0xF7 /* select */, - state /* polarity: state dependent */, - 0x00 /* 0=pulldown */, - 0x04 /* output */, - 0x04 /* 1=Simple IO function */, - SIO_GPIO_BLINK_GPIO22, - IT8772F_GPIO_BLINK_FREQUENCY_1_HZ); - break; - case LED_BLINK: - it8772f_gpio_led(IT8772F_GPIO_DEV, - 2 /* set */, - 0xF7 /* select */, - 0x04 /* polarity */, - 0x04 /* 1=pullup */, - 0x04 /* output */, - 0x00, /* 0=Alternate function */ - SIO_GPIO_BLINK_GPIO22, - IT8772F_GPIO_BLINK_FREQUENCY_1_HZ); - break; - } + it8772f_gpio_led(IT8772F_GPIO_DEV, + 2, /* set */ + 0xF7, /* select */ + state == LED_OFF ? 0x00 : 0x04, /* polarity */ + state == LED_BLINK ? 0x04 : 0x00, /* pullup/pulldown */ + 0x04, /* output */ + state == LED_BLINK ? 0x00 : 0x04, /* I/O function */ + SIO_GPIO_BLINK_GPIO22, + IT8772F_GPIO_BLINK_FREQUENCY_1_HZ); } |