Commit 4763b551 authored by Jonas Höglund's avatar Jonas Höglund

If state is the same as what has already been applied, don't do

anything.

This is a workaround for a bug in the Broadcom CLED driver which
causes flickering of LED:s when brightness is repeatedly set.
parent 27b06566
Pipeline #13060 passed with stage
in 11 seconds
......@@ -43,7 +43,7 @@ struct gpio_led_data {
char *rgb_color; /* LED_SK9822 attribute */
};
active_t active;
int state;
led_state_t state;
gpio_mode_t mode;
struct led_drv led;
};
......@@ -126,6 +126,11 @@ static int gpio_led_set_state(struct led_drv *drv, led_state_t state)
bit_val=1;
}
/* If state already has been applied we don't need to do
anything. */
if (state == p->state)
return p->state;
p->state = state;
switch (p->mode) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment