diff options
author | Patrick Delaunay <patrick.delaunay@foss.st.com> | 2021-11-15 16:32:20 +0100 |
---|---|---|
committer | Patrice Chotard <patrice.chotard@foss.st.com> | 2021-11-30 16:43:28 +0100 |
commit | 2e2e6d8cacbc80f2da0ce8f1afca5ed24020b331 (patch) | |
tree | 1102ca504f44bd6f92521f917df57c3dc344e933 /drivers/video/video-uclass.c | |
parent | fded97adcedb4c77927d06aad7a7d816059eeeab (diff) | |
download | u-boot-2e2e6d8cacbc80f2da0ce8f1afca5ed24020b331.zip u-boot-2e2e6d8cacbc80f2da0ce8f1afca5ed24020b331.tar.gz u-boot-2e2e6d8cacbc80f2da0ce8f1afca5ed24020b331.tar.bz2 |
video: Add video_is_active function
Add the helper function video_is_active() to test if one video device
is active.
This function can be used in board code to execute operation
only when the display is probed / really used.
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Diffstat (limited to 'drivers/video/video-uclass.c')
-rw-r--r-- | drivers/video/video-uclass.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c index 9f8cf6e..43ebb3c 100644 --- a/drivers/video/video-uclass.c +++ b/drivers/video/video-uclass.c @@ -228,6 +228,20 @@ void video_sync_all(void) } } +bool video_is_active(void) +{ + struct udevice *dev; + + for (uclass_find_first_device(UCLASS_VIDEO, &dev); + dev; + uclass_find_next_device(&dev)) { + if (device_active(dev)) + return true; + } + + return false; +} + int video_get_xsize(struct udevice *dev) { struct video_priv *priv = dev_get_uclass_priv(dev); |