feat(reimaden): add platform support kernel module
This commit is contained in:
parent
b3d50a3180
commit
6c52d98c54
26 changed files with 2071 additions and 0 deletions
35
spec/reimaden/ac71/misc.c
Normal file
35
spec/reimaden/ac71/misc.c
Normal 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);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue