From: Christian Marangi Date: Tue, 1 Oct 2024 12:24:41 +0000 (+0200) Subject: ubi: implement support for LED activity X-Git-Url: http://git.dujemihanovic.xyz/img/static/%7B%7B%20%24style.RelPermalink%20%7D%7D?a=commitdiff_plain;h=990f726ce797c040adda6d1e1bc6a21bd2b28657;p=u-boot.git ubi: implement support for LED activity Implement support for LED activity. If the feature is enabled, make the defined ACTIVITY LED to signal ubi write operation. Signed-off-by: Christian Marangi Reviewed-by: Simon Glass --- diff --git a/cmd/ubi.c b/cmd/ubi.c index 0e62e44932..56d7da8262 100644 --- a/cmd/ubi.c +++ b/cmd/ubi.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -488,10 +489,18 @@ exit: int ubi_volume_write(char *volume, void *buf, loff_t offset, size_t size) { + int ret; + + led_activity_blink(); + if (!offset) - return ubi_volume_begin_write(volume, buf, size, size); + ret = ubi_volume_begin_write(volume, buf, size, size); + else + ret = ubi_volume_offset_write(volume, buf, offset, size); - return ubi_volume_offset_write(volume, buf, offset, size); + led_activity_off(); + + return ret; } int ubi_volume_read(char *volume, char *buf, loff_t offset, size_t size)