Merge branch '45-set-performance-profile-cl' into 'master'

Resolve "Set performance profile (CL)"

Implements #45

See merge request tuxedocomputers/development/packages/tuxedo-keyboard!20
This commit is contained in:
Christoffer 2021-06-07 14:58:46 +00:00
commit 356d157f25
3 changed files with 14 additions and 3 deletions

View file

@ -1,5 +1,5 @@
/*!
* Copyright (c) 2020 TUXEDO Computers GmbH <tux@tuxedocomputers.com>
* Copyright (c) 2020-2021 TUXEDO Computers GmbH <tux@tuxedocomputers.com>
*
* This file is part of tuxedo-keyboard.
*
@ -45,6 +45,9 @@
#define CLEVO_CMD_SET_FLIGHTMODE_SW 0x20
#define CLEVO_CMD_SET_TOUCHPAD_SW 0x2a
#define CLEVO_CMD_OPT 0x79
#define CLEVO_OPT_SUBCMD_SET_PERF_PROF 0x19
int clevo_keyboard_init(void);
struct clevo_interface_t {

View file

@ -1,5 +1,5 @@
/*!
* Copyright (c) 2019-2020 TUXEDO Computers GmbH <tux@tuxedocomputers.com>
* Copyright (c) 2019-2021 TUXEDO Computers GmbH <tux@tuxedocomputers.com>
*
* This file is part of tuxedo-io.
*
@ -66,6 +66,8 @@ static long clevo_ioctl_interface(struct file *file, unsigned int cmd, unsigned
u32 copy_result;
u32 argument = (u32) arg;
u32 clevo_arg;
const char str_no_if[] = "";
char *str_clevo_if;
@ -139,6 +141,11 @@ static long clevo_ioctl_interface(struct file *file, unsigned int cmd, unsigned
copy_result = copy_from_user(&argument, (int32_t *) arg, sizeof(argument));
clevo_evaluate_method(CLEVO_CMD_SET_TOUCHPAD_SW, argument, &result);
break;
case W_CL_PERF_PROFILE:
copy_result = copy_from_user(&argument, (int32_t *) arg, sizeof(argument));
clevo_arg = (CLEVO_OPT_SUBCMD_SET_PERF_PROF << 0x18) | (argument & 0xff);
clevo_evaluate_method(CLEVO_CMD_OPT, clevo_arg, &result);
break;
}
return 0;

View file

@ -1,5 +1,5 @@
/*!
* Copyright (c) 2019-2020 TUXEDO Computers GmbH <tux@tuxedocomputers.com>
* Copyright (c) 2019-2021 TUXEDO Computers GmbH <tux@tuxedocomputers.com>
*
* This file is part of tuxedo-io.
*
@ -60,6 +60,7 @@
#define W_CL_WEBCAM_SW _IOW(MAGIC_WRITE_CL, 0x12, int32_t*)
#define W_CL_FLIGHTMODE_SW _IOW(MAGIC_WRITE_CL, 0x13, int32_t*)
#define W_CL_TOUCHPAD_SW _IOW(MAGIC_WRITE_CL, 0x14, int32_t*)
#define W_CL_PERF_PROFILE _IOW(MAGIC_WRITE_CL, 0x15, int32_t*)
#ifdef DEBUG
#define W_TF_BC _IOW(MAGIC_WRITE_CL, 0x91, uint32_t*)