mirror of
https://github.com/wessel-novacustom/clevo-keyboard.git
synced 2024-11-15 11:43:59 +01:00
Fix typo, rename uw kbd methods
This commit is contained in:
parent
afbe4cde64
commit
d29b1352c7
|
@ -132,7 +132,7 @@ static struct notifier_block keyboard_notifier_block = {
|
||||||
.notifier_call = keyboard_notifier_callb
|
.notifier_call = keyboard_notifier_callb
|
||||||
};
|
};
|
||||||
|
|
||||||
static void write_keyb_rgb(u8 red, u8 green, u8 blue)
|
static void uniwill_write_kbd_bl_rgb(u8 red, u8 green, u8 blue)
|
||||||
{
|
{
|
||||||
union uw_ec_read_return reg_read_return;
|
union uw_ec_read_return reg_read_return;
|
||||||
u8 high_byte_red_reg, high_byte_green_reg, high_byte_blue_reg;
|
u8 high_byte_red_reg, high_byte_green_reg, high_byte_blue_reg;
|
||||||
|
@ -169,7 +169,7 @@ static void write_keyb_rgb(u8 red, u8 green, u8 blue)
|
||||||
if (__uniwill_wmi_ec_write) symbol_put(uniwill_wmi_ec_write);
|
if (__uniwill_wmi_ec_write) symbol_put(uniwill_wmi_ec_write);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void uniwill_write_kdb_led_state(void) {
|
static void uniwill_write_kbd_bl_state(void) {
|
||||||
// Get single colors from state
|
// Get single colors from state
|
||||||
u32 color_red = ((kbd_led_state_uw.color >> 0x10) & 0xff);
|
u32 color_red = ((kbd_led_state_uw.color >> 0x10) & 0xff);
|
||||||
u32 color_green = (kbd_led_state_uw.color >> 0x08) & 0xff;
|
u32 color_green = (kbd_led_state_uw.color >> 0x08) & 0xff;
|
||||||
|
@ -187,7 +187,7 @@ static void uniwill_write_kdb_led_state(void) {
|
||||||
color_green = (color_green * brightness_percentage) / 100;
|
color_green = (color_green * brightness_percentage) / 100;
|
||||||
color_blue = (color_blue * brightness_percentage) / 100;
|
color_blue = (color_blue * brightness_percentage) / 100;
|
||||||
|
|
||||||
write_keyb_rgb(color_red, color_green, color_blue);
|
uniwill_write_kbd_bl_rgb(color_red, color_green, color_blue);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void uniwill_wmi_handle_event(u32 value, void *context, u32 guid_nr)
|
static void uniwill_wmi_handle_event(u32 value, void *context, u32 guid_nr)
|
||||||
|
@ -227,23 +227,23 @@ static void uniwill_wmi_handle_event(u32 value, void *context, u32 guid_nr)
|
||||||
switch (code) {
|
switch (code) {
|
||||||
case 0x3b:
|
case 0x3b:
|
||||||
kbd_led_state_uw.brightness = 0x00;
|
kbd_led_state_uw.brightness = 0x00;
|
||||||
uniwill_write_kdb_led_state();
|
uniwill_write_kbd_bl_state();
|
||||||
break;
|
break;
|
||||||
case 0x3c:
|
case 0x3c:
|
||||||
kbd_led_state_uw.brightness = 0x20;
|
kbd_led_state_uw.brightness = 0x20;
|
||||||
uniwill_write_kdb_led_state();
|
uniwill_write_kbd_bl_state();
|
||||||
break;
|
break;
|
||||||
case 0x3d:
|
case 0x3d:
|
||||||
kbd_led_state_uw.brightness = 0x50;
|
kbd_led_state_uw.brightness = 0x50;
|
||||||
uniwill_write_kdb_led_state();
|
uniwill_write_kbd_bl_state();
|
||||||
break;
|
break;
|
||||||
case 0x3e:
|
case 0x3e:
|
||||||
kbd_led_state_uw.brightness = 0x80;
|
kbd_led_state_uw.brightness = 0x80;
|
||||||
uniwill_write_kdb_led_state();
|
uniwill_write_kbd_bl_state();
|
||||||
break;
|
break;
|
||||||
case 0x3f:
|
case 0x3f:
|
||||||
kbd_led_state_uw.brightness = 0xc8;
|
kbd_led_state_uw.brightness = 0xc8;
|
||||||
uniwill_write_kdb_led_state();
|
uniwill_write_kbd_bl_state();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -312,7 +312,7 @@ static int uniwill_keyboard_probe(struct platform_device *dev)
|
||||||
else kbd_led_state_uw.color = UNIWILL_COLOR_DEFAULT;
|
else kbd_led_state_uw.color = UNIWILL_COLOR_DEFAULT;
|
||||||
|
|
||||||
// Update keyboard according to the current state
|
// Update keyboard according to the current state
|
||||||
uniwill_write_kdb_led_state();
|
uniwill_write_kbd_bl_state();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue