videomode: create enum for videomode's display flags
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Tue, 12 Mar 2013 08:31:29 +0000 (10:31 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Tue, 12 Mar 2013 13:46:52 +0000 (15:46 +0200)
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>
include/video/display_timing.h
include/video/videomode.h

index a8a4be5b0af710bc96f6d7b5e82caa54e37f82d7..b63471d1409774e33f710ca64accc7710d09c001 100644 (file)
 #include <linux/bitops.h>
 #include <linux/types.h>
 
-#define DISPLAY_FLAGS_HSYNC_LOW                BIT(0)
-#define DISPLAY_FLAGS_HSYNC_HIGH       BIT(1)
-#define DISPLAY_FLAGS_VSYNC_LOW                BIT(2)
-#define DISPLAY_FLAGS_VSYNC_HIGH       BIT(3)
-#define DISPLAY_FLAGS_DE_LOW           BIT(4)  /* data enable flag */
-#define DISPLAY_FLAGS_DE_HIGH          BIT(5)
-#define DISPLAY_FLAGS_PIXDATA_POSEDGE  BIT(6)  /* drive data on pos. edge */
-#define DISPLAY_FLAGS_PIXDATA_NEGEDGE  BIT(7)  /* drive data on neg. edge */
-#define DISPLAY_FLAGS_INTERLACED       BIT(8)
-#define DISPLAY_FLAGS_DOUBLESCAN       BIT(9)
+enum display_flags {
+       DISPLAY_FLAGS_HSYNC_LOW         = BIT(0),
+       DISPLAY_FLAGS_HSYNC_HIGH        = BIT(1),
+       DISPLAY_FLAGS_VSYNC_LOW         = BIT(2),
+       DISPLAY_FLAGS_VSYNC_HIGH        = BIT(3),
+
+       /* data enable flag */
+       DISPLAY_FLAGS_DE_LOW            = BIT(4),
+       DISPLAY_FLAGS_DE_HIGH           = BIT(5),
+       /* drive data on pos. edge */
+       DISPLAY_FLAGS_PIXDATA_POSEDGE   = BIT(6),
+       /* drive data on neg. edge */
+       DISPLAY_FLAGS_PIXDATA_NEGEDGE   = BIT(7),
+       DISPLAY_FLAGS_INTERLACED        = BIT(8),
+       DISPLAY_FLAGS_DOUBLESCAN        = BIT(9),
+};
 
 /*
  * A single signal can be specified via a range of minimal and maximal values
@@ -69,7 +75,7 @@ struct display_timing {
        struct timing_entry vback_porch;        /* ver. back porch */
        struct timing_entry vsync_len;          /* ver. sync len */
 
-       unsigned int flags;                     /* display flags */
+       enum display_flags flags;               /* display flags */
 };
 
 /*
index f4ae6edfeb08df168a4532073cc2805e2f905110..8b12e60b61736b62cfa5dc1b2dd989b26efec5f1 100644 (file)
@@ -29,7 +29,7 @@ struct videomode {
        u32 vback_porch;
        u32 vsync_len;
 
-       unsigned int flags; /* display flags */
+       enum display_flags flags; /* display flags */
 };
 
 /**
This page took 0.02538 seconds and 5 git commands to generate.