mirror of
https://github.com/wessel-novacustom/clevo-keyboard.git
synced 2024-11-15 03:34:01 +01:00
Change use of uw if read/write to new ones
- For tuxedo_io
This commit is contained in:
parent
de124948ab
commit
4fa915fcc3
|
@ -276,7 +276,7 @@ static u32 uniwill_identify(void)
|
||||||
|
|
||||||
static void uniwill_init(void)
|
static void uniwill_init(void)
|
||||||
{
|
{
|
||||||
u32 i;
|
/* u32 i;
|
||||||
union uw_ec_read_return reg_read_return;
|
union uw_ec_read_return reg_read_return;
|
||||||
union uw_ec_write_return reg_write_return;
|
union uw_ec_write_return reg_write_return;
|
||||||
|
|
||||||
|
@ -293,11 +293,12 @@ static void uniwill_init(void)
|
||||||
|
|
||||||
// Zero second fan temp for detection
|
// Zero second fan temp for detection
|
||||||
uw_ec_write_addr(0x4f, 0x04, 0x00, 0x00, ®_write_return);
|
uw_ec_write_addr(0x4f, 0x04, 0x00, 0x00, ®_write_return);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
static void uniwill_exit(void)
|
static void uniwill_exit(void)
|
||||||
{
|
{
|
||||||
union uw_ec_write_return reg_write_return;
|
// union uw_ec_write_return reg_write_return;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -157,6 +157,7 @@ static long uniwill_ioctl_interface(struct file *file, unsigned int cmd, unsigne
|
||||||
u32 result = 0;
|
u32 result = 0;
|
||||||
u32 copy_result;
|
u32 copy_result;
|
||||||
u32 argument;
|
u32 argument;
|
||||||
|
u8 byte_data;
|
||||||
union uw_ec_read_return reg_read_return;
|
union uw_ec_read_return reg_read_return;
|
||||||
union uw_ec_write_return reg_write_return;
|
union uw_ec_write_return reg_write_return;
|
||||||
|
|
||||||
|
@ -171,46 +172,49 @@ static long uniwill_ioctl_interface(struct file *file, unsigned int cmd, unsigne
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case R_UW_FANSPEED:
|
case R_UW_FANSPEED:
|
||||||
uw_ec_read_addr(0x04, 0x18, ®_read_return);
|
uniwill_read_ec_ram(0x1804, &byte_data);
|
||||||
result = reg_read_return.bytes.data_low;
|
result = byte_data;
|
||||||
copy_result = copy_to_user((void *) arg, &result, sizeof(result));
|
copy_result = copy_to_user((void *) arg, &result, sizeof(result));
|
||||||
break;
|
break;
|
||||||
case R_UW_FANSPEED2:
|
case R_UW_FANSPEED2:
|
||||||
uw_ec_read_addr(0x09, 0x18, ®_read_return);
|
uniwill_read_ec_ram(0x1809, &byte_data);
|
||||||
result = reg_read_return.bytes.data_low;
|
result = byte_data;
|
||||||
copy_result = copy_to_user((void *) arg, &result, sizeof(result));
|
copy_result = copy_to_user((void *) arg, &result, sizeof(result));
|
||||||
break;
|
break;
|
||||||
case R_UW_FAN_TEMP:
|
case R_UW_FAN_TEMP:
|
||||||
uw_ec_read_addr(0x3e, 0x04, ®_read_return);
|
uniwill_read_ec_ram(0x043e, &byte_data);
|
||||||
result = reg_read_return.bytes.data_low;
|
result = byte_data;
|
||||||
copy_result = copy_to_user((void *) arg, &result, sizeof(result));
|
copy_result = copy_to_user((void *) arg, &result, sizeof(result));
|
||||||
break;
|
break;
|
||||||
case R_UW_FAN_TEMP2:
|
case R_UW_FAN_TEMP2:
|
||||||
uw_ec_read_addr(0x4f, 0x04, ®_read_return);
|
uniwill_read_ec_ram(0x044f, &byte_data);
|
||||||
result = reg_read_return.bytes.data_low;
|
result = byte_data;
|
||||||
copy_result = copy_to_user((void *) arg, &result, sizeof(result));
|
copy_result = copy_to_user((void *) arg, &result, sizeof(result));
|
||||||
break;
|
break;
|
||||||
case R_UW_MODE:
|
case R_UW_MODE:
|
||||||
uw_ec_read_addr(0x51, 0x07, ®_read_return);
|
uniwill_read_ec_ram(0x0751, &byte_data);
|
||||||
result = reg_read_return.bytes.data_low;
|
result = byte_data;
|
||||||
copy_result = copy_to_user((void *) arg, &result, sizeof(result));
|
copy_result = copy_to_user((void *) arg, &result, sizeof(result));
|
||||||
break;
|
break;
|
||||||
case R_UW_MODE_ENABLE:
|
case R_UW_MODE_ENABLE:
|
||||||
uw_ec_read_addr(0x41, 0x07, ®_read_return);
|
uniwill_read_ec_ram(0x0741, &byte_data);
|
||||||
result = reg_read_return.bytes.data_low;
|
result = byte_data;
|
||||||
copy_result = copy_to_user((void *) arg, &result, sizeof(result));
|
copy_result = copy_to_user((void *) arg, &result, sizeof(result));
|
||||||
break;
|
break;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
case R_TF_BC:
|
case R_TF_BC:
|
||||||
copy_result = copy_from_user(&uw_arg, (void *) arg, sizeof(uw_arg));
|
copy_result = copy_from_user(&uw_arg, (void *) arg, sizeof(uw_arg));
|
||||||
|
reg_read_return.dword = 0;
|
||||||
|
result = uniwill_read_ec_ram((uw_arg[1] << 8) | uw_arg[0], ®_read_return.bytes.data_low);
|
||||||
|
copy_result = copy_to_user((void *) arg, ®_read_return.dword, sizeof(reg_read_return.dword));
|
||||||
// pr_info("R_TF_BC args [%0#2x, %0#2x, %0#2x, %0#2x]\n", uw_arg[0], uw_arg[1], uw_arg[2], uw_arg[3]);
|
// pr_info("R_TF_BC args [%0#2x, %0#2x, %0#2x, %0#2x]\n", uw_arg[0], uw_arg[1], uw_arg[2], uw_arg[3]);
|
||||||
if (uniwill_ec_direct) {
|
/*if (uniwill_ec_direct) {
|
||||||
result = uw_ec_read_addr_direct(uw_arg[0], uw_arg[1], ®_read_return);
|
result = uw_ec_read_addr_direct(uw_arg[0], uw_arg[1], ®_read_return);
|
||||||
copy_result = copy_to_user((void *) arg, ®_read_return.dword, sizeof(reg_read_return.dword));
|
copy_result = copy_to_user((void *) arg, ®_read_return.dword, sizeof(reg_read_return.dword));
|
||||||
} else {
|
} else {
|
||||||
result = uw_wmi_ec_evaluate(uw_arg[0], uw_arg[1], uw_arg[2], uw_arg[3], 1, uw_result);
|
result = uw_wmi_ec_evaluate(uw_arg[0], uw_arg[1], uw_arg[2], uw_arg[3], 1, uw_result);
|
||||||
copy_result = copy_to_user((void *) arg, &uw_result, sizeof(uw_result));
|
copy_result = copy_to_user((void *) arg, &uw_result, sizeof(uw_result));
|
||||||
}
|
}*/
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -228,13 +232,13 @@ static long uniwill_ioctl_interface(struct file *file, unsigned int cmd, unsigne
|
||||||
break;
|
break;
|
||||||
case W_UW_MODE:
|
case W_UW_MODE:
|
||||||
copy_result = copy_from_user(&argument, (int32_t *) arg, sizeof(argument));
|
copy_result = copy_from_user(&argument, (int32_t *) arg, sizeof(argument));
|
||||||
uw_ec_write_addr(0x51, 0x07, argument & 0xff, 0x00, ®_write_return);
|
uniwill_write_ec_ram(0x0751, argument & 0xff);
|
||||||
break;
|
break;
|
||||||
case W_UW_MODE_ENABLE:
|
case W_UW_MODE_ENABLE:
|
||||||
// Note: Is for the moment set and cleared on init/exit of module (uniwill mode)
|
// Note: Is for the moment set and cleared on init/exit of module (uniwill mode)
|
||||||
/*
|
/*
|
||||||
copy_result = copy_from_user(&argument, (int32_t *) arg, sizeof(argument));
|
copy_result = copy_from_user(&argument, (int32_t *) arg, sizeof(argument));
|
||||||
uw_ec_write_addr(0x41, 0x07, argument & 0x01, 0x00, ®_write_return);
|
uniwill_write_ec_ram(0x0741, argument & 0x01);
|
||||||
*/
|
*/
|
||||||
break;
|
break;
|
||||||
case W_UW_FANAUTO:
|
case W_UW_FANAUTO:
|
||||||
|
@ -242,15 +246,18 @@ static long uniwill_ioctl_interface(struct file *file, unsigned int cmd, unsigne
|
||||||
break;
|
break;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
case W_TF_BC:
|
case W_TF_BC:
|
||||||
|
reg_write_return.dword = 0;
|
||||||
copy_result = copy_from_user(&uw_arg, (void *) arg, sizeof(uw_arg));
|
copy_result = copy_from_user(&uw_arg, (void *) arg, sizeof(uw_arg));
|
||||||
if (uniwill_ec_direct) {
|
uniwill_write_ec_ram((uw_arg[1] << 8) | uw_arg[0], uw_arg[2]);
|
||||||
|
copy_result = copy_to_user((void *) arg, ®_write_return.dword, sizeof(reg_write_return.dword));
|
||||||
|
/*if (uniwill_ec_direct) {
|
||||||
result = uw_ec_write_addr_direct(uw_arg[0], uw_arg[1], uw_arg[2], uw_arg[3], ®_write_return);
|
result = uw_ec_write_addr_direct(uw_arg[0], uw_arg[1], uw_arg[2], uw_arg[3], ®_write_return);
|
||||||
copy_result = copy_to_user((void *) arg, ®_write_return.dword, sizeof(reg_write_return.dword));
|
copy_result = copy_to_user((void *) arg, ®_write_return.dword, sizeof(reg_write_return.dword));
|
||||||
} else {
|
} else {
|
||||||
result = uw_wmi_ec_evaluate(uw_arg[0], uw_arg[1], uw_arg[2], uw_arg[3], 0, uw_result);
|
result = uw_wmi_ec_evaluate(uw_arg[0], uw_arg[1], uw_arg[2], uw_arg[3], 0, uw_result);
|
||||||
copy_result = copy_to_user((void *) arg, &uw_result, sizeof(uw_result));
|
copy_result = copy_to_user((void *) arg, &uw_result, sizeof(uw_result));
|
||||||
reg_write_return.dword = uw_result[0];
|
reg_write_return.dword = uw_result[0];
|
||||||
}
|
}*/
|
||||||
/*pr_info("data_high %0#2x\n", reg_write_return.bytes.data_high);
|
/*pr_info("data_high %0#2x\n", reg_write_return.bytes.data_high);
|
||||||
pr_info("data_low %0#2x\n", reg_write_return.bytes.data_low);
|
pr_info("data_low %0#2x\n", reg_write_return.bytes.data_low);
|
||||||
pr_info("addr_high %0#2x\n", reg_write_return.bytes.addr_high);
|
pr_info("addr_high %0#2x\n", reg_write_return.bytes.addr_high);
|
||||||
|
|
Loading…
Reference in a new issue