tuxedo_io: Prefix the clevo ioctls with CL for clarity

This commit is contained in:
Christoffer Sandberg 2020-12-08 15:50:25 +01:00
parent 51741558ed
commit 2c32684ee8
No known key found for this signature in database
GPG key ID: BF563F71B6C7A96D
2 changed files with 25 additions and 25 deletions

View file

@ -70,45 +70,45 @@ static long clevo_ioctl_interface(struct file *file, unsigned int cmd, unsigned
char *str_clevo_if; char *str_clevo_if;
switch (cmd) { switch (cmd) {
case R_HW_IF_STR: case R_CL_HW_IF_STR:
if (clevo_get_active_interface_id(&str_clevo_if) == 0) { 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); copy_result = copy_to_user((char *) arg, str_clevo_if, strlen(str_clevo_if) + 1);
} else { } else {
copy_result = copy_to_user((char *) arg, str_no_if, strlen(str_no_if) + 1); copy_result = copy_to_user((char *) arg, str_no_if, strlen(str_no_if) + 1);
} }
break; break;
case R_FANINFO1: case R_CL_FANINFO1:
status = clevo_evaluate_method(CLEVO_CMD_GET_FANINFO1, 0, &result); status = clevo_evaluate_method(CLEVO_CMD_GET_FANINFO1, 0, &result);
copy_result = copy_to_user((int32_t *) arg, &result, sizeof(result)); copy_result = copy_to_user((int32_t *) arg, &result, sizeof(result));
break; break;
case R_FANINFO2: case R_CL_FANINFO2:
status = clevo_evaluate_method(CLEVO_CMD_GET_FANINFO2, 0, &result); status = clevo_evaluate_method(CLEVO_CMD_GET_FANINFO2, 0, &result);
copy_result = copy_to_user((int32_t *) arg, &result, sizeof(result)); copy_result = copy_to_user((int32_t *) arg, &result, sizeof(result));
break; break;
case R_FANINFO3: case R_CL_FANINFO3:
status = clevo_evaluate_method(CLEVO_CMD_GET_FANINFO3, 0, &result); status = clevo_evaluate_method(CLEVO_CMD_GET_FANINFO3, 0, &result);
copy_result = copy_to_user((int32_t *) arg, &result, sizeof(result)); copy_result = copy_to_user((int32_t *) arg, &result, sizeof(result));
break; break;
/*case R_FANINFO4: /*case R_CL_FANINFO4:
status = clevo_evaluate_method(CLEVO_CMD_GET_FANINFO4, 0); status = clevo_evaluate_method(CLEVO_CMD_GET_FANINFO4, 0);
copy_to_user((int32_t *) arg, &result, sizeof(result)); copy_to_user((int32_t *) arg, &result, sizeof(result));
break;*/ break;*/
case R_WEBCAM_SW: case R_CL_WEBCAM_SW:
status = clevo_evaluate_method(CLEVO_CMD_GET_WEBCAM_SW, 0, &result); status = clevo_evaluate_method(CLEVO_CMD_GET_WEBCAM_SW, 0, &result);
copy_result = copy_to_user((int32_t *) arg, &result, sizeof(result)); copy_result = copy_to_user((int32_t *) arg, &result, sizeof(result));
break; break;
case R_FLIGHTMODE_SW: case R_CL_FLIGHTMODE_SW:
status = clevo_evaluate_method(CLEVO_CMD_GET_FLIGHTMODE_SW, 0, &result); status = clevo_evaluate_method(CLEVO_CMD_GET_FLIGHTMODE_SW, 0, &result);
copy_result = copy_to_user((int32_t *) arg, &result, sizeof(result)); copy_result = copy_to_user((int32_t *) arg, &result, sizeof(result));
break; break;
case R_TOUCHPAD_SW: case R_CL_TOUCHPAD_SW:
status = clevo_evaluate_method(CLEVO_CMD_GET_TOUCHPAD_SW, 0, &result); status = clevo_evaluate_method(CLEVO_CMD_GET_TOUCHPAD_SW, 0, &result);
copy_result = copy_to_user((int32_t *) arg, &result, sizeof(result)); copy_result = copy_to_user((int32_t *) arg, &result, sizeof(result));
break; break;
} }
switch (cmd) { switch (cmd) {
case W_FANSPEED: case W_CL_FANSPEED:
copy_result = copy_from_user(&argument, (int32_t *) arg, sizeof(argument)); copy_result = copy_from_user(&argument, (int32_t *) arg, sizeof(argument));
clevo_evaluate_method(CLEVO_CMD_SET_FANSPEED_VALUE, argument, &result); clevo_evaluate_method(CLEVO_CMD_SET_FANSPEED_VALUE, argument, &result);
// Note: Delay needed to let hardware catch up with the written value. // 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 // Can it be lower? 50ms is too low
msleep(100); msleep(100);
break; break;
case W_FANAUTO: case W_CL_FANAUTO:
copy_result = copy_from_user(&argument, (int32_t *) arg, sizeof(argument)); copy_result = copy_from_user(&argument, (int32_t *) arg, sizeof(argument));
clevo_evaluate_method(CLEVO_CMD_SET_FANSPEED_AUTO, argument, &result); clevo_evaluate_method(CLEVO_CMD_SET_FANSPEED_AUTO, argument, &result);
break; break;
case W_WEBCAM_SW: case W_CL_WEBCAM_SW:
copy_result = copy_from_user(&argument, (int32_t *) arg, sizeof(argument)); copy_result = copy_from_user(&argument, (int32_t *) arg, sizeof(argument));
status = clevo_evaluate_method(CLEVO_CMD_GET_WEBCAM_SW, 0, &result); status = clevo_evaluate_method(CLEVO_CMD_GET_WEBCAM_SW, 0, &result);
// Only set status if it isn't already the right value // 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); clevo_evaluate_method(CLEVO_CMD_SET_WEBCAM_SW, argument, &result);
} }
break; break;
case W_FLIGHTMODE_SW: case W_CL_FLIGHTMODE_SW:
copy_result = copy_from_user(&argument, (int32_t *) arg, sizeof(argument)); copy_result = copy_from_user(&argument, (int32_t *) arg, sizeof(argument));
clevo_evaluate_method(CLEVO_CMD_SET_FLIGHTMODE_SW, argument, &result); clevo_evaluate_method(CLEVO_CMD_SET_FLIGHTMODE_SW, argument, &result);
break; break;
case W_TOUCHPAD_SW: case W_CL_TOUCHPAD_SW:
copy_result = copy_from_user(&argument, (int32_t *) arg, sizeof(argument)); copy_result = copy_from_user(&argument, (int32_t *) arg, sizeof(argument));
clevo_evaluate_method(CLEVO_CMD_SET_TOUCHPAD_SW, argument, &result); clevo_evaluate_method(CLEVO_CMD_SET_TOUCHPAD_SW, argument, &result);
break; break;

View file

@ -39,27 +39,27 @@
*/ */
// Read // Read
#define R_HW_IF_STR _IOR(MAGIC_READ_CL, 0x00, char*) #define R_CL_HW_IF_STR _IOR(MAGIC_READ_CL, 0x00, char*)
#define R_FANINFO1 _IOR(MAGIC_READ_CL, 0x10, int32_t*) #define R_CL_FANINFO1 _IOR(MAGIC_READ_CL, 0x10, int32_t*)
#define R_FANINFO2 _IOR(MAGIC_READ_CL, 0x11, int32_t*) #define R_CL_FANINFO2 _IOR(MAGIC_READ_CL, 0x11, int32_t*)
#define R_FANINFO3 _IOR(MAGIC_READ_CL, 0x12, 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_FANINFO4 _IOR(MAGIC_READ_CL, 0x04, int32_t*)
#define R_WEBCAM_SW _IOR(MAGIC_READ_CL, 0x13, int32_t*) #define R_CL_WEBCAM_SW _IOR(MAGIC_READ_CL, 0x13, int32_t*)
#define R_FLIGHTMODE_SW _IOR(MAGIC_READ_CL, 0x14, int32_t*) #define R_CL_FLIGHTMODE_SW _IOR(MAGIC_READ_CL, 0x14, int32_t*)
#define R_TOUCHPAD_SW _IOR(MAGIC_READ_CL, 0x15, int32_t*) #define R_CL_TOUCHPAD_SW _IOR(MAGIC_READ_CL, 0x15, int32_t*)
#ifdef DEBUG #ifdef DEBUG
#define R_TF_BC _IOW(MAGIC_READ_CL, 0x91, uint32_t*) #define R_TF_BC _IOW(MAGIC_READ_CL, 0x91, uint32_t*)
#endif #endif
// Write // Write
#define W_FANSPEED _IOW(MAGIC_WRITE_CL, 0x10, int32_t*) #define W_CL_FANSPEED _IOW(MAGIC_WRITE_CL, 0x10, int32_t*)
#define W_FANAUTO _IOW(MAGIC_WRITE_CL, 0x11, 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_CL_WEBCAM_SW _IOW(MAGIC_WRITE_CL, 0x12, int32_t*)
#define W_FLIGHTMODE_SW _IOW(MAGIC_WRITE_CL, 0x13, int32_t*) #define W_CL_FLIGHTMODE_SW _IOW(MAGIC_WRITE_CL, 0x13, int32_t*)
#define W_TOUCHPAD_SW _IOW(MAGIC_WRITE_CL, 0x14, int32_t*) #define W_CL_TOUCHPAD_SW _IOW(MAGIC_WRITE_CL, 0x14, int32_t*)
#ifdef DEBUG #ifdef DEBUG
#define W_TF_BC _IOW(MAGIC_WRITE_CL, 0x91, uint32_t*) #define W_TF_BC _IOW(MAGIC_WRITE_CL, 0x91, uint32_t*)