From 2c32684ee85e6dd3dee44dfef10d566ea9d7a5dc Mon Sep 17 00:00:00 2001 From: Christoffer Sandberg Date: Tue, 8 Dec 2020 15:50:25 +0100 Subject: [PATCH] tuxedo_io: Prefix the clevo ioctls with CL for clarity --- src/tuxedo_io/tuxedo_io.c | 26 +++++++++++++------------- src/tuxedo_io/tuxedo_io_ioctl.h | 24 ++++++++++++------------ 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/tuxedo_io/tuxedo_io.c b/src/tuxedo_io/tuxedo_io.c index 11d7ab1..068466a 100644 --- a/src/tuxedo_io/tuxedo_io.c +++ b/src/tuxedo_io/tuxedo_io.c @@ -70,45 +70,45 @@ static long clevo_ioctl_interface(struct file *file, unsigned int cmd, unsigned char *str_clevo_if; switch (cmd) { - case R_HW_IF_STR: + case R_CL_HW_IF_STR: if (clevo_get_active_interface_id(&str_clevo_if) == 0) { copy_result = copy_to_user((char *) arg, str_clevo_if, strlen(str_clevo_if) + 1); } else { copy_result = copy_to_user((char *) arg, str_no_if, strlen(str_no_if) + 1); } break; - case R_FANINFO1: + case R_CL_FANINFO1: status = clevo_evaluate_method(CLEVO_CMD_GET_FANINFO1, 0, &result); copy_result = copy_to_user((int32_t *) arg, &result, sizeof(result)); break; - case R_FANINFO2: + case R_CL_FANINFO2: status = clevo_evaluate_method(CLEVO_CMD_GET_FANINFO2, 0, &result); copy_result = copy_to_user((int32_t *) arg, &result, sizeof(result)); break; - case R_FANINFO3: + case R_CL_FANINFO3: status = clevo_evaluate_method(CLEVO_CMD_GET_FANINFO3, 0, &result); copy_result = copy_to_user((int32_t *) arg, &result, sizeof(result)); break; - /*case R_FANINFO4: + /*case R_CL_FANINFO4: status = clevo_evaluate_method(CLEVO_CMD_GET_FANINFO4, 0); copy_to_user((int32_t *) arg, &result, sizeof(result)); break;*/ - case R_WEBCAM_SW: + case R_CL_WEBCAM_SW: status = clevo_evaluate_method(CLEVO_CMD_GET_WEBCAM_SW, 0, &result); copy_result = copy_to_user((int32_t *) arg, &result, sizeof(result)); break; - case R_FLIGHTMODE_SW: + case R_CL_FLIGHTMODE_SW: status = clevo_evaluate_method(CLEVO_CMD_GET_FLIGHTMODE_SW, 0, &result); copy_result = copy_to_user((int32_t *) arg, &result, sizeof(result)); break; - case R_TOUCHPAD_SW: + case R_CL_TOUCHPAD_SW: status = clevo_evaluate_method(CLEVO_CMD_GET_TOUCHPAD_SW, 0, &result); copy_result = copy_to_user((int32_t *) arg, &result, sizeof(result)); break; } switch (cmd) { - case W_FANSPEED: + case W_CL_FANSPEED: copy_result = copy_from_user(&argument, (int32_t *) arg, sizeof(argument)); clevo_evaluate_method(CLEVO_CMD_SET_FANSPEED_VALUE, argument, &result); // Note: Delay needed to let hardware catch up with the written value. @@ -118,11 +118,11 @@ static long clevo_ioctl_interface(struct file *file, unsigned int cmd, unsigned // Can it be lower? 50ms is too low msleep(100); break; - case W_FANAUTO: + case W_CL_FANAUTO: copy_result = copy_from_user(&argument, (int32_t *) arg, sizeof(argument)); clevo_evaluate_method(CLEVO_CMD_SET_FANSPEED_AUTO, argument, &result); break; - case W_WEBCAM_SW: + case W_CL_WEBCAM_SW: copy_result = copy_from_user(&argument, (int32_t *) arg, sizeof(argument)); status = clevo_evaluate_method(CLEVO_CMD_GET_WEBCAM_SW, 0, &result); // Only set status if it isn't already the right value @@ -131,11 +131,11 @@ static long clevo_ioctl_interface(struct file *file, unsigned int cmd, unsigned clevo_evaluate_method(CLEVO_CMD_SET_WEBCAM_SW, argument, &result); } break; - case W_FLIGHTMODE_SW: + case W_CL_FLIGHTMODE_SW: copy_result = copy_from_user(&argument, (int32_t *) arg, sizeof(argument)); clevo_evaluate_method(CLEVO_CMD_SET_FLIGHTMODE_SW, argument, &result); break; - case W_TOUCHPAD_SW: + case W_CL_TOUCHPAD_SW: copy_result = copy_from_user(&argument, (int32_t *) arg, sizeof(argument)); clevo_evaluate_method(CLEVO_CMD_SET_TOUCHPAD_SW, argument, &result); break; diff --git a/src/tuxedo_io/tuxedo_io_ioctl.h b/src/tuxedo_io/tuxedo_io_ioctl.h index 22ab9d2..e907be1 100644 --- a/src/tuxedo_io/tuxedo_io_ioctl.h +++ b/src/tuxedo_io/tuxedo_io_ioctl.h @@ -39,27 +39,27 @@ */ // Read -#define R_HW_IF_STR _IOR(MAGIC_READ_CL, 0x00, char*) -#define R_FANINFO1 _IOR(MAGIC_READ_CL, 0x10, int32_t*) -#define R_FANINFO2 _IOR(MAGIC_READ_CL, 0x11, int32_t*) -#define R_FANINFO3 _IOR(MAGIC_READ_CL, 0x12, int32_t*) +#define R_CL_HW_IF_STR _IOR(MAGIC_READ_CL, 0x00, char*) +#define R_CL_FANINFO1 _IOR(MAGIC_READ_CL, 0x10, int32_t*) +#define R_CL_FANINFO2 _IOR(MAGIC_READ_CL, 0x11, int32_t*) +#define R_CL_FANINFO3 _IOR(MAGIC_READ_CL, 0x12, int32_t*) // #define R_FANINFO4 _IOR(MAGIC_READ_CL, 0x04, int32_t*) -#define R_WEBCAM_SW _IOR(MAGIC_READ_CL, 0x13, int32_t*) -#define R_FLIGHTMODE_SW _IOR(MAGIC_READ_CL, 0x14, int32_t*) -#define R_TOUCHPAD_SW _IOR(MAGIC_READ_CL, 0x15, int32_t*) +#define R_CL_WEBCAM_SW _IOR(MAGIC_READ_CL, 0x13, int32_t*) +#define R_CL_FLIGHTMODE_SW _IOR(MAGIC_READ_CL, 0x14, int32_t*) +#define R_CL_TOUCHPAD_SW _IOR(MAGIC_READ_CL, 0x15, int32_t*) #ifdef DEBUG #define R_TF_BC _IOW(MAGIC_READ_CL, 0x91, uint32_t*) #endif // Write -#define W_FANSPEED _IOW(MAGIC_WRITE_CL, 0x10, int32_t*) -#define W_FANAUTO _IOW(MAGIC_WRITE_CL, 0x11, int32_t*) +#define W_CL_FANSPEED _IOW(MAGIC_WRITE_CL, 0x10, int32_t*) +#define W_CL_FANAUTO _IOW(MAGIC_WRITE_CL, 0x11, int32_t*) -#define W_WEBCAM_SW _IOW(MAGIC_WRITE_CL, 0x12, int32_t*) -#define W_FLIGHTMODE_SW _IOW(MAGIC_WRITE_CL, 0x13, int32_t*) -#define W_TOUCHPAD_SW _IOW(MAGIC_WRITE_CL, 0x14, int32_t*) +#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*) #ifdef DEBUG #define W_TF_BC _IOW(MAGIC_WRITE_CL, 0x91, uint32_t*)