mb/google/brya: Create rull variant
[coreboot2.git] / src / mainboard / google / beltino / variants / tricky / led.c
blobb21e18e8e4bc76b4dcfbede7ca0651258b87b27f
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 /* Configure GPIO22 as power LED */
11 ite_reg_write(IT8772F_GPIO_DEV, ITE_GPIO_REG_SELECT(1), 0xf7);
12 ite_gpio_setup(IT8772F_GPIO_DEV, 22, ITE_GPIO_OUTPUT,
13 state == LED_BLINK ? ITE_GPIO_ALT_FN_MODE : ITE_GPIO_SIMPLE_IO_MODE,
14 (state != LED_OFF ? ITE_GPIO_POL_INVERT : 0) |
15 (state == LED_BLINK ? ITE_GPIO_PULLUP_ENABLE : 0));
16 ite_gpio_setup_led(IT8772F_GPIO_DEV, 22, ITE_GPIO_LED_1,
17 ITE_LED_FREQ_1HZ, ITE_LED_CONTROL_DEFAULT);