From 81d6fe0e10bb69e1c6cbb8fd42a9291b97633713 Mon Sep 17 00:00:00 2001 From: Werner Sembach Date: Mon, 19 Jun 2023 16:09:59 +0200 Subject: [PATCH] Prepare clevo skeleton --- src/clevo_keyboard.h | 7 +++++-- src/clevo_leds.h | 8 ++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/clevo_keyboard.h b/src/clevo_keyboard.h index d069fe2..7269017 100644 --- a/src/clevo_keyboard.h +++ b/src/clevo_keyboard.h @@ -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_TOGGLE, { KEY_KBDILLUMTOGGLE } }, { KE_KEY, CLEVO_EVENT_KB_LEDS_CYCLE_MODE, { KEY_LIGHTS_TOGGLE } }, - // Single cycle key (white only versions) - { KE_KEY, CLEVO_EVENT_KB_LEDS_CYCLE_BRIGHTNESS, { KEY_KBDILLUMTOGGLE } }, + // Single cycle key (white only versions) (currently handled in driver) + // { KE_KEY, CLEVO_EVENT_KB_LEDS_CYCLE_BRIGHTNESS, { KEY_KBDILLUMTOGGLE } }, // Touchpad // 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: set_next_color_whole_kb(); break; + case CLEVO_EVENT_KB_LEDS_CYCLE_BRIGHTNESS: + clevo_leds_notify_brightness_change_extern(); + break; default: break; } diff --git a/src/clevo_leds.h b/src/clevo_leds.h index ba1c11b..c3242eb 100644 --- a/src/clevo_leds.h +++ b/src/clevo_leds.h @@ -36,6 +36,7 @@ int clevo_leds_init(struct platform_device *dev); int clevo_leds_remove(struct platform_device *dev); enum clevo_kb_backlight_types clevo_leds_get_backlight_type(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_color_extern(u32 color); @@ -414,6 +415,13 @@ void clevo_leds_restore_state_extern(void) { } 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) { if (clevo_kb_backlight_type == CLEVO_KB_BACKLIGHT_TYPE_FIXED_COLOR) { clevo_led_cdev.brightness_set(&clevo_led_cdev, brightness);