mirror of
https://github.com/wessel-novacustom/clevo-keyboard.git
synced 2024-11-15 03:34:01 +01:00
Prepare uw state data structure and lookup for color strings
This commit is contained in:
parent
5f2db68a9b
commit
a85ccf9a4e
|
@ -95,4 +95,22 @@ static struct color_list_t color_list = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Looks up a color in the color_list
|
||||||
|
*
|
||||||
|
* Returns found color, or -1 if string did not match
|
||||||
|
*/
|
||||||
|
static u32 color_lookup(const struct color_list_t *color_list, const char *color_name)
|
||||||
|
{
|
||||||
|
u32 found_color = -1;
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < color_list->size; ++i) {
|
||||||
|
if (strcmp(color_list->colors[i].name, color_name) == 0) {
|
||||||
|
found_color = color_list->colors[i].code;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return found_color;
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -34,7 +34,10 @@
|
||||||
#define UNIWILL_OSD_RADIOON 0x01A
|
#define UNIWILL_OSD_RADIOON 0x01A
|
||||||
#define UNIWILL_OSD_RADIOOFF 0x01B
|
#define UNIWILL_OSD_RADIOOFF 0x01B
|
||||||
|
|
||||||
#define UNIWILL_OSD_TOUCHPADWORKAROUND 0xFFF
|
#define UNIWILL_OSD_TOUCHPADWORKAROUND 0xFFF
|
||||||
|
|
||||||
|
#define UNIWILL_BRIGHTNESS_DEFAULT 0xc8 * 0.75 // Note: values 0x00 - 0xc8
|
||||||
|
#define UNIWILL_COLOR_DEFAULT 0xffffff
|
||||||
|
|
||||||
union uw_ec_read_return {
|
union uw_ec_read_return {
|
||||||
u32 dword;
|
u32 dword;
|
||||||
|
@ -59,6 +62,14 @@ extern u32 uniwill_wmi_ec_write(u8, u8, u8, u8, union uw_ec_write_return *);
|
||||||
|
|
||||||
struct tuxedo_keyboard_driver uniwill_keyboard_driver;
|
struct tuxedo_keyboard_driver uniwill_keyboard_driver;
|
||||||
|
|
||||||
|
struct kbd_led_state_uw_t {
|
||||||
|
u8 brightness;
|
||||||
|
u32 color;
|
||||||
|
} kbd_led_state_cl = {
|
||||||
|
.brightness = UNIWILL_BRIGHTNESS_DEFAULT,
|
||||||
|
.color = UNIWILL_COLOR_DEFAULT,
|
||||||
|
};
|
||||||
|
|
||||||
static struct key_entry uniwill_wmi_keymap[] = {
|
static struct key_entry uniwill_wmi_keymap[] = {
|
||||||
// { KE_KEY, UNIWILL_OSD_RADIOON, { KEY_RFKILL } },
|
// { KE_KEY, UNIWILL_OSD_RADIOON, { KEY_RFKILL } },
|
||||||
// { KE_KEY, UNIWILL_OSD_RADIOOFF, { KEY_RFKILL } },
|
// { KE_KEY, UNIWILL_OSD_RADIOOFF, { KEY_RFKILL } },
|
||||||
|
|
Loading…
Reference in a new issue