MAINTAINERS: Add Matt as a maintainer for Star Labs
[coreboot2.git] / src / mainboard / google / jecht / led.c
blob811521eea711d3732784748c804a38c62fcfc363
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <superio/ite/common/ite.h>
4 #include <superio/ite/common/ite_gpio.h>
5 #include <superio/ite/it8772f/it8772f.h>
6 #include "onboard.h"
8 void set_power_led(int state)
10 u8 polarity;
12 if (CONFIG(BOARD_GOOGLE_TIDUS)) {
13 polarity = state == LED_OFF ? ITE_GPIO_POL_INVERT : 0;
14 } else {
15 polarity = state == LED_BLINK ? ITE_GPIO_POL_INVERT : 0;
18 /* Configure GPIO10 as power LED */
19 ite_reg_write(IT8772F_GPIO_DEV, ITE_GPIO_REG_SELECT(0), 0x01);
20 ite_gpio_setup(IT8772F_GPIO_DEV, 10, ITE_GPIO_OUTPUT,
21 state == LED_BLINK ? ITE_GPIO_ALT_FN_MODE : ITE_GPIO_SIMPLE_IO_MODE,
22 (state == LED_BLINK ? ITE_GPIO_PULLUP_ENABLE : ITE_GPIO_CONTROL_DEFAULT) |
23 polarity);
24 ite_gpio_setup_led(IT8772F_GPIO_DEV, 10, ITE_GPIO_LED_1, ITE_LED_FREQ_1HZ,
25 ITE_LED_CONTROL_DEFAULT);