ec/google/chromeec: Add CFR option for RGB keyboard boot color
Add ec_rgb_kb_color CFR option to select RGB keyboard color at boot. Suppress regular keyboard backlight option when RGB keyboard is present, as they are mutually exclusive. TEST=build/boot google/mithrax, verify RGB keyboard option enabled, all colors able to be set at boot. Change-Id: I55848931248a70023c49b98190105679f2999ad9 Signed-off-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/90160 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Sean Rhodes <sean@starlabs.systems>
This commit is contained in:
parent
e695731399
commit
d97cb61b50
2 changed files with 31 additions and 1 deletions
|
|
@ -40,7 +40,7 @@ static const struct sm_enum_value ec_backlight_values[] = {
|
|||
|
||||
static void update_kb_backlight(struct sm_object *new)
|
||||
{
|
||||
if (!google_chromeec_has_kbbacklight()) {
|
||||
if (!google_chromeec_has_kbbacklight() || google_chromeec_has_rgbkbd()) {
|
||||
new->sm_bool.flags = CFR_OPTFLAG_SUPPRESS;
|
||||
new->sm_bool.default_value = -1;
|
||||
}
|
||||
|
|
@ -55,4 +55,30 @@ static const struct sm_object ec_kb_backlight = SM_DECLARE_ENUM({
|
|||
.values = ec_backlight_values,
|
||||
}, WITH_CALLBACK(update_kb_backlight));
|
||||
|
||||
static const struct sm_enum_value ec_rgb_backlight_values[] = {
|
||||
{ "Off", GOOGLE_CHROMEEC_RGBKBD_COLOR_OFF },
|
||||
{ "Red", GOOGLE_CHROMEEC_RGBKBD_COLOR_RED },
|
||||
{ "Green", GOOGLE_CHROMEEC_RGBKBD_COLOR_GREEN },
|
||||
{ "Blue", GOOGLE_CHROMEEC_RGBKBD_COLOR_BLUE },
|
||||
{ "Yellow", GOOGLE_CHROMEEC_RGBKBD_COLOR_YELLOW },
|
||||
{ "White", GOOGLE_CHROMEEC_RGBKBD_COLOR_WHITE },
|
||||
SM_ENUM_VALUE_END,
|
||||
};
|
||||
|
||||
static void update_rgb_kb_backlight(struct sm_object *new)
|
||||
{
|
||||
if (!google_chromeec_has_rgbkbd()) {
|
||||
new->sm_bool.flags = CFR_OPTFLAG_SUPPRESS;
|
||||
new->sm_bool.default_value = GOOGLE_CHROMEEC_RGBKBD_COLOR_OFF;
|
||||
}
|
||||
}
|
||||
|
||||
static const struct sm_object ec_rgb_kb_color = SM_DECLARE_ENUM({
|
||||
.opt_name = "ec_rgb_kb_color",
|
||||
.ui_name = "RGB Keyboard Color At Boot",
|
||||
.ui_helptext = "Select the static color applied to the RGB keyboard at boot.",
|
||||
.default_value = GOOGLE_CHROMEEC_RGBKBD_COLOR_OFF,
|
||||
.values = ec_rgb_backlight_values,
|
||||
}, WITH_CALLBACK(update_rgb_kb_backlight));
|
||||
|
||||
#endif /* _CHROMEEC_CFR_H_ */
|
||||
|
|
|
|||
|
|
@ -1454,6 +1454,10 @@ void google_chromeec_init(void)
|
|||
int backlight_level = get_uint_option("ec_kb_backlight", -1);
|
||||
if (backlight_level != -1 && !acpi_is_wakeup_s3() && google_chromeec_has_kbbacklight())
|
||||
google_chromeec_kbbacklight(backlight_level);
|
||||
|
||||
int rgb_color = get_uint_option("ec_rgb_kb_color", -1);
|
||||
if (rgb_color != -1 && !acpi_is_wakeup_s3() && google_chromeec_has_rgbkbd())
|
||||
google_chromeec_rgbkbd_set_color((enum google_chromeec_rgbkbd_color)rgb_color);
|
||||
}
|
||||
|
||||
int google_ec_running_ro(void)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue