summary refs log tree commit diff stats
path: root/hw/misc/led.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>2020-06-20 18:47:17 +0200
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>2020-10-26 13:44:58 +0100
commit4aef43991afa70c3cb314881fd4bf0f3e1f8b41b (patch)
tree30d436639c41e87e45a81c3647eef409142e3a7e /hw/misc/led.c
parentddb67f6402b8096f70ca68e3cffaddfd588b384d (diff)
downloadfocaccia-qemu-4aef43991afa70c3cb314881fd4bf0f3e1f8b41b.tar.gz
focaccia-qemu-4aef43991afa70c3cb314881fd4bf0f3e1f8b41b.zip
hw/misc/led: Emit a trace event when LED intensity has changed
Track the LED intensity, and emit a trace event when it changes.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Luc Michel <luc.michel@greensocs.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20200912134041.946260-4-f4bug@amsat.org>
Diffstat (limited to 'hw/misc/led.c')
-rw-r--r--hw/misc/led.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/misc/led.c b/hw/misc/led.c
index c5fa09a613..5266d026d0 100644
--- a/hw/misc/led.c
+++ b/hw/misc/led.c
@@ -41,6 +41,10 @@ void led_set_intensity(LEDState *s, unsigned intensity_percent)
         intensity_percent = LED_INTENSITY_PERCENT_MAX;
     }
     trace_led_set_intensity(s->description, s->color, intensity_percent);
+    if (intensity_percent != s->intensity_percent) {
+        trace_led_change_intensity(s->description, s->color,
+                                   s->intensity_percent, intensity_percent);
+    }
     s->intensity_percent = intensity_percent;
 }