From ddf41635da2687250aaf22732e66d5cac63b2ed7 Mon Sep 17 00:00:00 2001 From: Werner Sembach Date: Mon, 14 Nov 2022 12:04:48 +0100 Subject: [PATCH] Change default brightness to 0 --- src/clevo_leds.h | 21 ++++++++++----------- src/uniwill_leds.h | 14 +++++++------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/src/clevo_leds.h b/src/clevo_leds.h index 14b5248..3391661 100644 --- a/src/clevo_leds.h +++ b/src/clevo_leds.h @@ -46,20 +46,19 @@ void clevo_leds_set_color_extern(u32 color); #include -#define CLEVO_KBD_BRIGHTNESS_MIN 0x00 -#define CLEVO_KBD_BRIGHTNESS_MAX 0xff -#define CLEVO_KBD_BRIGHTNESS_DEFAULT (CLEVO_KBD_BRIGHTNESS_MAX * 0.5) +#define CLEVO_KBD_BRIGHTNESS_MAX 0xff +#define CLEVO_KBD_BRIGHTNESS_DEFAULT 0x00 -#define CLEVO_KBD_BRIGHTNESS_WHITE_MIN 0x00 #define CLEVO_KBD_BRIGHTNESS_WHITE_MAX 0x02 // White only keyboards can only be off, half, or full brightness -#define CLEVO_KBD_BRIGHTNESS_WHITE_DEFAULT (CLEVO_KBD_BRIGHTNESS_WHITE_MAX * 0.5) -#define CLEVO_KBD_BRIGHTNESS_WHITE_MAX_5 0x05 // Devices <= Intel 7th gen had a different white control with 5 brightness values + off -#define CLEVO_KBD_BRIGHTNESS_WHITE_MAX_5_DEFAULT (CLEVO_KBD_BRIGHTNESS_WHITE_MAX * 0.5) +#define CLEVO_KBD_BRIGHTNESS_WHITE_DEFAULT 0x00 -#define CLEVO_KB_COLOR_DEFAULT_RED 0xff -#define CLEVO_KB_COLOR_DEFAULT_GREEN 0xff -#define CLEVO_KB_COLOR_DEFAULT_BLUE 0xff -#define CLEVO_KB_COLOR_DEFAULT ((CLEVO_KB_COLOR_DEFAULT_RED << 16) + (CLEVO_KB_COLOR_DEFAULT_GREEN << 8) + CLEVO_KB_COLOR_DEFAULT_BLUE) +#define CLEVO_KBD_BRIGHTNESS_WHITE_MAX_5 0x05 // Devices <= Intel 7th gen had a different white control with 5 brightness values + off +#define CLEVO_KBD_BRIGHTNESS_WHITE_MAX_5_DEFAULT 0x00 + +#define CLEVO_KB_COLOR_DEFAULT_RED 0xff +#define CLEVO_KB_COLOR_DEFAULT_GREEN 0xff +#define CLEVO_KB_COLOR_DEFAULT_BLUE 0xff +#define CLEVO_KB_COLOR_DEFAULT ((CLEVO_KB_COLOR_DEFAULT_RED << 16) + (CLEVO_KB_COLOR_DEFAULT_GREEN << 8) + CLEVO_KB_COLOR_DEFAULT_BLUE) static enum clevo_kb_backlight_types clevo_kb_backlight_type = CLEVO_KB_BACKLIGHT_TYPE_NONE; static bool leds_initialized = false; diff --git a/src/uniwill_leds.h b/src/uniwill_leds.h index b315797..63639fa 100644 --- a/src/uniwill_leds.h +++ b/src/uniwill_leds.h @@ -33,15 +33,15 @@ enum uniwill_kb_backlight_types { }; #define UNIWILL_KBD_BRIGHTNESS_MAX 0xff -#define UNIWILL_KBD_BRIGHTNESS_DEFAULT (UNIWILL_KBD_BRIGHTNESS_MAX * 0.5) +#define UNIWILL_KBD_BRIGHTNESS_DEFAULT 0x00 -#define UNIWILL_KBD_BRIGHTNESS_WHITE_MAX 0x2 -#define UNIWILL_KBD_BRIGHTNESS_WHITE_DEFAULT (UNIWILL_KBD_BRIGHTNESS_WHITE_MAX * 0.5) +#define UNIWILL_KBD_BRIGHTNESS_WHITE_MAX 0x02 +#define UNIWILL_KBD_BRIGHTNESS_WHITE_DEFAULT 0x00 -#define UNIWILL_KB_COLOR_DEFAULT_RED 0xff -#define UNIWILL_KB_COLOR_DEFAULT_GREEN 0xff -#define UNIWILL_KB_COLOR_DEFAULT_BLUE 0xff -#define UNIWILL_KB_COLOR_DEFAULT ((UNIWILL_KB_COLOR_DEFAULT_RED << 16) + (UNIWILL_KB_COLOR_DEFAULT_GREEN << 8) + UNIWILL_KB_COLOR_DEFAULT_BLUE) +#define UNIWILL_KB_COLOR_DEFAULT_RED 0xff +#define UNIWILL_KB_COLOR_DEFAULT_GREEN 0xff +#define UNIWILL_KB_COLOR_DEFAULT_BLUE 0xff +#define UNIWILL_KB_COLOR_DEFAULT ((UNIWILL_KB_COLOR_DEFAULT_RED << 16) + (UNIWILL_KB_COLOR_DEFAULT_GREEN << 8) + UNIWILL_KB_COLOR_DEFAULT_BLUE) int uniwill_leds_init_early(struct platform_device *dev); int uniwill_leds_init_late(struct platform_device *dev);