diff --git a/src/driver-hidpp20.c b/src/driver-hidpp20.c index 451d0da6..578f43d5 100644 --- a/src/driver-hidpp20.c +++ b/src/driver-hidpp20.c @@ -316,6 +316,8 @@ hidpp20drv_read_led_8070(struct ratbag_led *led, struct hidpp20drv_data* drv_dat struct hidpp20_profile *profile; struct hidpp20_led *h_led; struct hidpp20_color_led_zone_info* led_info; + struct hidpp20_color_led_info info; + int rc; led_info = &drv_data->led_infos.color_leds[led->index]; profile = &drv_data->profiles->profiles[led->profile->index]; @@ -344,7 +346,13 @@ hidpp20drv_read_led_8070(struct ratbag_led *led, struct hidpp20drv_data* drv_dat led->color.blue = h_led->color.blue; led->hz = h_led->period; /* FIXME: should be ceil(1000.0 / h_led->period), but that would be very small */ led->brightness = h_led->brightness * 255 / 100; - led->colordepth = RATBAG_LED_COLORDEPTH_RGB_888; + + rc = hidpp20_color_led_effects_get_info(drv_data->dev, &info); + if (rc == 0 && + info.ext_caps & HIDPP20_COLOR_LED_INFO_EXT_CAP_MONOCHROME_ONLY) + led->colordepth = RATBAG_LED_COLORDEPTH_MONOCHROME; + else + led->colordepth = RATBAG_LED_COLORDEPTH_RGB_888; ratbag_led_set_mode_capability(led, RATBAG_LED_ON); ratbag_led_set_mode_capability(led, RATBAG_LED_CYCLE); diff --git a/src/hidpp20.h b/src/hidpp20.h index ce068300..beef46d6 100644 --- a/src/hidpp20.h +++ b/src/hidpp20.h @@ -389,6 +389,13 @@ int hidpp20_adjustable_report_rate_get_report_rate_list(struct hidpp20_device *d #define HIDPP_PAGE_COLOR_LED_EFFECTS 0x8070 +enum hidpp20_color_led_info_ext_caps { + HIDPP20_COLOR_LED_INFO_EXT_CAP_HAS_ZONE_EFFECT = 0x01, + HIDPP20_COLOR_LED_INFO_EXT_CAP_NO_GET_EFFECT_SETTINGS = 0x02, + HIDPP20_COLOR_LED_INFO_EXT_CAP_HAS_SET_LED_BIN_INFO = 0x04, + HIDPP20_COLOR_LED_INFO_EXT_CAP_MONOCHROME_ONLY = 0x08, +}; + struct hidpp20_color_led_info; int