Skip to content

Commit 32ed6ef

Browse files
committed
videomode: create enum for videomode's display flags
Instead of having plain defines for the videomode's flags, add an enum for the flags. This makes the flags clearer to use, as the enum tells which values can be used with the flags field. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: Steffen Trumtrar <s.trumtrar@pengutronix.de>
1 parent 06a3307 commit 32ed6ef

2 files changed

Lines changed: 18 additions & 12 deletions

File tree

‎include/video/display_timing.h‎

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,22 @@
1212
#include <linux/bitops.h>
1313
#include <linux/types.h>
1414

15-
#define DISPLAY_FLAGS_HSYNC_LOW BIT(0)
16-
#define DISPLAY_FLAGS_HSYNC_HIGH BIT(1)
17-
#define DISPLAY_FLAGS_VSYNC_LOW BIT(2)
18-
#define DISPLAY_FLAGS_VSYNC_HIGH BIT(3)
19-
#define DISPLAY_FLAGS_DE_LOW BIT(4) /* data enable flag */
20-
#define DISPLAY_FLAGS_DE_HIGH BIT(5)
21-
#define DISPLAY_FLAGS_PIXDATA_POSEDGE BIT(6) /* drive data on pos. edge */
22-
#define DISPLAY_FLAGS_PIXDATA_NEGEDGE BIT(7) /* drive data on neg. edge */
23-
#define DISPLAY_FLAGS_INTERLACED BIT(8)
24-
#define DISPLAY_FLAGS_DOUBLESCAN BIT(9)
15+
enum display_flags {
16+
DISPLAY_FLAGS_HSYNC_LOW = BIT(0),
17+
DISPLAY_FLAGS_HSYNC_HIGH = BIT(1),
18+
DISPLAY_FLAGS_VSYNC_LOW = BIT(2),
19+
DISPLAY_FLAGS_VSYNC_HIGH = BIT(3),
20+
21+
/* data enable flag */
22+
DISPLAY_FLAGS_DE_LOW = BIT(4),
23+
DISPLAY_FLAGS_DE_HIGH = BIT(5),
24+
/* drive data on pos. edge */
25+
DISPLAY_FLAGS_PIXDATA_POSEDGE = BIT(6),
26+
/* drive data on neg. edge */
27+
DISPLAY_FLAGS_PIXDATA_NEGEDGE = BIT(7),
28+
DISPLAY_FLAGS_INTERLACED = BIT(8),
29+
DISPLAY_FLAGS_DOUBLESCAN = BIT(9),
30+
};
2531

2632
/*
2733
* A single signal can be specified via a range of minimal and maximal values
@@ -69,7 +75,7 @@ struct display_timing {
6975
struct timing_entry vback_porch; /* ver. back porch */
7076
struct timing_entry vsync_len; /* ver. sync len */
7177

72-
unsigned int flags; /* display flags */
78+
enum display_flags flags; /* display flags */
7379
};
7480

7581
/*

‎include/video/videomode.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ struct videomode {
2929
u32 vback_porch;
3030
u32 vsync_len;
3131

32-
unsigned int flags; /* display flags */
32+
enum display_flags flags; /* display flags */
3333
};
3434

3535
/**

0 commit comments

Comments
 (0)