feat(reimaden): add platform support kernel module

This commit is contained in:
514fpv 2024-02-14 03:23:48 +08:00
parent b3d50a3180
commit 6c52d98c54
Signed by: koishi
SSH key fingerprint: SHA256:axz0uIzzY+5W19i7QOUuiw5LSqhKfCBKPf3L4xFRxLw
26 changed files with 2071 additions and 0 deletions

35
spec/reimaden/ac71/misc.c Normal file
View file

@ -0,0 +1,35 @@
// SPDX-License-Identifier: GPL-2.0
#include "pr.h"
#include <linux/bug.h>
#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/platform_device.h>
#include "ec.h"
#include "misc.h"
#include "util.h"
/* ========================================================================== */
int ac71_fn_lock_get_state(void)
{
int status = ec_read_byte(BIOS_CTRL_1_ADDR);
if (status < 0)
return status;
return !!(status & BIOS_CTRL_1_FN_LOCK_STATUS);
}
int ac71_fn_lock_set_state(bool state)
{
int status = ec_read_byte(BIOS_CTRL_1_ADDR);
if (status < 0)
return status;
status = SET_BIT(status, BIOS_CTRL_1_FN_LOCK_STATUS, state);
return ec_write_byte(BIOS_CTRL_1_ADDR, status);
}