Files
system76-embedded-controller/src/board/system76/addw1/board.c
Tim Crawford a198289695 Remove power_set_limit from board_event
This is already handled by power_event.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
2023-04-03 13:06:16 -06:00

37 lines
945 B
C

// SPDX-License-Identifier: GPL-3.0-only
#include <board/board.h>
#include <board/gpio.h>
#include <board/kbc.h>
#include <common/debug.h>
extern uint8_t main_cycle;
void board_init(void) {
// Allow CPU to boot
gpio_set(&SB_KBCRST_N, true);
// Allow backlight to be turned on
gpio_set(&BKL_EN, true);
// Enable camera
gpio_set(&CCD_EN, true);
// Enable right USB port
gpio_set(&USB_PWR_EN_N, false);
// Assert SMI#, SCI#, and SWI#
gpio_set(&SCI_N, true);
gpio_set(&SMI_N, true);
gpio_set(&SWI_N, true);
}
void board_event(void) {
if (main_cycle == 0) {
// Set keyboard LEDs
static uint8_t last_kbc_leds = 0;
if (kbc_leds != last_kbc_leds) {
gpio_set(&LED_SCROLL_N, (kbc_leds & 1) == 0);
gpio_set(&LED_NUM_N, (kbc_leds & 2) == 0);
gpio_set(&LED_CAP_N, (kbc_leds & 4) == 0);
last_kbc_leds = kbc_leds;
}
}
}