From 7c6951b059b9a7c36486a73f656ad8a88f648626 Mon Sep 17 00:00:00 2001 From: Matt DeVillier Date: Tue, 6 Dec 2016 17:59:23 -0600 Subject: google/beltino, tidus: simplify led_power_on() function Simplify set_power_led() by consolidating switch and setting values as needed inline based on LED state. Remove unnecesary function param, includes for Tidus. Change-Id: I28e6fac5f8d7e2ff419002db714ce88697895faf Signed-off-by: Matt DeVillier Reviewed-on: https://review.coreboot.org/17744 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber --- .../google/beltino/variants/mccloud/led.c | 34 ++++++---------------- 1 file changed, 9 insertions(+), 25 deletions(-) (limited to 'src/mainboard/google/beltino/variants') diff --git a/src/mainboard/google/beltino/variants/mccloud/led.c b/src/mainboard/google/beltino/variants/mccloud/led.c index da303e81d3..ce8d2d861c 100644 --- a/src/mainboard/google/beltino/variants/mccloud/led.c +++ b/src/mainboard/google/beltino/variants/mccloud/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, - 1 /* set */, - 0x01 /* select */, - state /* polarity: state dependent */, - 0x00 /* 0=pulldown */, - 0x01 /* output */, - 0x01 /* 1=Simple IO function */, - SIO_GPIO_BLINK_GPIO10, - IT8772F_GPIO_BLINK_FREQUENCY_1_HZ); - break; - case LED_BLINK: - it8772f_gpio_led(IT8772F_GPIO_DEV, - 1 /* set */, - 0x01 /* select */, - 0x01 /* polarity */, - 0x01 /* 1=pullup */, - 0x01 /* output */, - 0x00, /* 0=Alternate function */ - SIO_GPIO_BLINK_GPIO10, - IT8772F_GPIO_BLINK_FREQUENCY_1_HZ); - break; - } + it8772f_gpio_led(IT8772F_GPIO_DEV, + 1, /* set */ + 0x01, /* select */ + state == LED_OFF ? 0x00 : 0x01, /* polarity */ + state == LED_BLINK ? 0x01 : 0x00, /* pullup/pulldown */ + 0x01, /* output */ + state == LED_BLINK ? 0x00 : 0x01, /* I/O function */ + SIO_GPIO_BLINK_GPIO10, + IT8772F_GPIO_BLINK_FREQUENCY_1_HZ); } -- cgit v1.2.3