Move static color definitions for use by multiple drivers

This commit is contained in:
Christoffer Sandberg 2020-07-27 11:34:29 +02:00
parent af54fb8d9b
commit 5f2db68a9b
No known key found for this signature in database
GPG key ID: BF563F71B6C7A96D
2 changed files with 27 additions and 24 deletions

View file

@ -105,16 +105,6 @@ static struct key_entry clevo_wmi_keymap[] = {
#define BRIGHTNESS_STEP 25 #define BRIGHTNESS_STEP 25
struct color_t {
u32 code;
char* name;
};
struct color_list_t {
uint size;
struct color_t colors[];
};
// Keyboard struct // Keyboard struct
struct kbd_led_state_t { struct kbd_led_state_t {
u8 has_extra; u8 has_extra;
@ -196,20 +186,6 @@ static struct kbd_led_state_t kbd_led_state = {
.whole_kbd_color = 7 .whole_kbd_color = 7
}; };
static struct color_list_t color_list = {
.size = 8,
.colors = {
{ .name = "BLACK", .code = 0x000000 }, // 0
{ .name = "RED", .code = 0xFF0000 }, // 1
{ .name = "GREEN", .code = 0x00FF00 }, // 2
{ .name = "BLUE", .code = 0x0000FF }, // 3
{ .name = "YELLOW", .code = 0xFFFF00 }, // 4
{ .name = "MAGENTA", .code = 0xFF00FF }, // 5
{ .name = "CYAN", .code = 0x00FFFF }, // 6
{ .name = "WHITE", .code = 0xFFFFFF }, // 7
}
};
static struct blinking_pattern_t blinking_patterns[] = { static struct blinking_pattern_t blinking_patterns[] = {
{ .key = 0,.value = 0,.name = "CUSTOM"}, { .key = 0,.value = 0,.name = "CUSTOM"},
{ .key = 1,.value = 0x1002a000,.name = "BREATHE"}, { .key = 1,.value = 0x1002a000,.name = "BREATHE"},

View file

@ -68,4 +68,31 @@ bool sparse_keymap_report_known_event(struct input_dev *dev, unsigned int code,
return false; return false;
} }
struct color_t {
u32 code;
char* name;
};
struct color_list_t {
uint size;
struct color_t colors[];
};
/**
* Commonly used standard colors
*/
static struct color_list_t color_list = {
.size = 8,
.colors = {
{ .name = "BLACK", .code = 0x000000 }, // 0
{ .name = "RED", .code = 0xFF0000 }, // 1
{ .name = "GREEN", .code = 0x00FF00 }, // 2
{ .name = "BLUE", .code = 0x0000FF }, // 3
{ .name = "YELLOW", .code = 0xFFFF00 }, // 4
{ .name = "MAGENTA", .code = 0xFF00FF }, // 5
{ .name = "CYAN", .code = 0x00FFFF }, // 6
{ .name = "WHITE", .code = 0xFFFFFF }, // 7
}
};
#endif #endif