]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
leds: turris-omnia: Inform about missing LED gamma correction feature in the MCU...
authorMarek BehĂșn <kabel@kernel.org>
Mon, 11 Nov 2024 10:03:53 +0000 (11:03 +0100)
committerLee Jones <lee@kernel.org>
Thu, 12 Dec 2024 18:37:36 +0000 (18:37 +0000)
If the LED gamma correction feature is missing in the MCU firmware,
inform about this in the MCU firmware probe function instead of LED
driver probe function, so that all the feature checks are in one place.

Signed-off-by: Marek BehĂșn <kabel@kernel.org>
Link: https://lore.kernel.org/r/20241111100355.6978-10-kabel@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/leds/leds-turris-omnia.c
drivers/platform/cznic/turris-omnia-mcu-base.c

index 4f7b529781ce7cfb90f786a7a8adccec93990ac7..cfbcbdd7921b0aaf215c3a1802c697faf47c4848 100644 (file)
@@ -507,12 +507,6 @@ static int omnia_leds_probe(struct i2c_client *client)
        }
 
        leds->has_gamma_correction = ret & OMNIA_FEAT_LED_GAMMA_CORRECTION;
-       if (!leds->has_gamma_correction) {
-               dev_info(dev,
-                        "Your board's MCU firmware does not support the LED gamma correction feature.\n");
-               dev_info(dev,
-                        "Consider upgrading MCU firmware with the omnia-mcutool utility.\n");
-       }
 
        if (ret & OMNIA_FEAT_BRIGHTNESS_INT) {
                ret = omnia_request_brightness_irq(leds);
index 3bb4a3cfdb29c61bcd47c14e70fae9e202d7d23c..770e680b96f95d91f54f55dc3738565d05d19fcd 100644 (file)
@@ -259,6 +259,7 @@ static int omnia_mcu_read_features(struct omnia_mcu *mcu)
                _DEF_FEAT(POWEROFF_WAKEUP,      "poweroff and wakeup"),
                _DEF_FEAT(TRNG,                 "true random number generator"),
                _DEF_FEAT(BRIGHTNESS_INT,       "LED panel brightness change interrupt"),
+               _DEF_FEAT(LED_GAMMA_CORRECTION, "LED gamma correction"),
 #undef _DEF_FEAT
        };
        struct i2c_client *client = mcu->client;