aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-06-01 10:22:48 -0600
committerTom Rini <trini@konsulko.com>2023-07-14 12:54:51 -0400
commit2d6ee92c6af06eeb7f7410180d5faa8f5e840bbb (patch)
treea5448f1c00eaf1e7538be640bf7f5914050d3fbf
parent9af341502c1cdf1d40a41e8fe6c3922f1e409f33 (diff)
downloadu-boot-2d6ee92c6af06eeb7f7410180d5faa8f5e840bbb.zip
u-boot-2d6ee92c6af06eeb7f7410180d5faa8f5e840bbb.tar.gz
u-boot-2d6ee92c6af06eeb7f7410180d5faa8f5e840bbb.tar.bz2
video: Use enum with video_index_to_colour()
Use the provided enum with this function, so it is clearer what should be passed to it. Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r--drivers/video/video-uclass.c2
-rw-r--r--include/video.h4
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index d304e92..95e874b 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -260,7 +260,7 @@ static const struct vid_rgb colours[VID_COLOUR_COUNT] = {
{ 0xff, 0xff, 0xff }, /* white */
};
-u32 video_index_to_colour(struct video_priv *priv, unsigned int idx)
+u32 video_index_to_colour(struct video_priv *priv, enum colour_idx idx)
{
switch (priv->bpix) {
case VIDEO_BPP16:
diff --git a/include/video.h b/include/video.h
index 55e9f32..e98d0f9 100644
--- a/include/video.h
+++ b/include/video.h
@@ -164,10 +164,10 @@ enum colour_idx {
* VID_COLOR_COUNT.
*
* @priv private data of the video device (UCLASS_VIDEO)
- * @idx color index
+ * @idx color index (e.g. VID_YELLOW)
* Return: color value
*/
-u32 video_index_to_colour(struct video_priv *priv, unsigned int idx);
+u32 video_index_to_colour(struct video_priv *priv, enum colour_idx idx);
/**
* video_reserve() - Reserve frame-buffer memory for video devices