Prepare clevo skeleton

This commit is contained in:
Werner Sembach 2023-06-19 16:09:59 +02:00
parent 91a69bab8c
commit 81d6fe0e10
2 changed files with 13 additions and 2 deletions

View file

@ -54,8 +54,8 @@ static struct key_entry clevo_keymap[] = {
{ KE_KEY, CLEVO_EVENT_KB_LEDS_INCREASE, { KEY_KBDILLUMUP } }, { KE_KEY, CLEVO_EVENT_KB_LEDS_INCREASE, { KEY_KBDILLUMUP } },
{ KE_KEY, CLEVO_EVENT_KB_LEDS_TOGGLE, { KEY_KBDILLUMTOGGLE } }, { KE_KEY, CLEVO_EVENT_KB_LEDS_TOGGLE, { KEY_KBDILLUMTOGGLE } },
{ KE_KEY, CLEVO_EVENT_KB_LEDS_CYCLE_MODE, { KEY_LIGHTS_TOGGLE } }, { KE_KEY, CLEVO_EVENT_KB_LEDS_CYCLE_MODE, { KEY_LIGHTS_TOGGLE } },
// Single cycle key (white only versions) // Single cycle key (white only versions) (currently handled in driver)
{ KE_KEY, CLEVO_EVENT_KB_LEDS_CYCLE_BRIGHTNESS, { KEY_KBDILLUMTOGGLE } }, // { KE_KEY, CLEVO_EVENT_KB_LEDS_CYCLE_BRIGHTNESS, { KEY_KBDILLUMTOGGLE } },
// Touchpad // Touchpad
// The weirdly named touchpad toggle key that is implemented as KEY_F21 "everywhere" // The weirdly named touchpad toggle key that is implemented as KEY_F21 "everywhere"
@ -256,6 +256,9 @@ static void clevo_keyboard_event_callb(u32 event)
case CLEVO_EVENT_KB_LEDS_CYCLE_MODE: case CLEVO_EVENT_KB_LEDS_CYCLE_MODE:
set_next_color_whole_kb(); set_next_color_whole_kb();
break; break;
case CLEVO_EVENT_KB_LEDS_CYCLE_BRIGHTNESS:
clevo_leds_notify_brightness_change_extern();
break;
default: default:
break; break;
} }

View file

@ -36,6 +36,7 @@ int clevo_leds_init(struct platform_device *dev);
int clevo_leds_remove(struct platform_device *dev); int clevo_leds_remove(struct platform_device *dev);
enum clevo_kb_backlight_types clevo_leds_get_backlight_type(void); enum clevo_kb_backlight_types clevo_leds_get_backlight_type(void);
void clevo_leds_restore_state_extern(void); void clevo_leds_restore_state_extern(void);
void clevo_leds_notify_brightness_change_extern(void);
void clevo_leds_set_brightness_extern(enum led_brightness brightness); void clevo_leds_set_brightness_extern(enum led_brightness brightness);
void clevo_leds_set_color_extern(u32 color); void clevo_leds_set_color_extern(u32 color);
@ -414,6 +415,13 @@ void clevo_leds_restore_state_extern(void) {
} }
EXPORT_SYMBOL(clevo_leds_restore_state_extern); EXPORT_SYMBOL(clevo_leds_restore_state_extern);
void clevo_leds_notify_brightness_change_extern(void) {
if (clevo_kb_backlight_type == CLEVO_KB_BACKLIGHT_TYPE_FIXED_COLOR) {
// TODO
}
}
EXPORT_SYMBOL(clevo_leds_notify_brightness_change_extern);
void clevo_leds_set_brightness_extern(enum led_brightness brightness) { void clevo_leds_set_brightness_extern(enum led_brightness brightness) {
if (clevo_kb_backlight_type == CLEVO_KB_BACKLIGHT_TYPE_FIXED_COLOR) { if (clevo_kb_backlight_type == CLEVO_KB_BACKLIGHT_TYPE_FIXED_COLOR) {
clevo_led_cdev.brightness_set(&clevo_led_cdev, brightness); clevo_led_cdev.brightness_set(&clevo_led_cdev, brightness);