Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 32ed6ef1 authored by Tomi Valkeinen's avatar Tomi Valkeinen
Browse files

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: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Steffen Trumtrar <s.trumtrar@pengutronix.de>
parent 06a33079
Loading
Loading
Loading
Loading
+17 −11
Original line number Original line Diff line number Diff line
@@ -12,16 +12,22 @@
#include <linux/bitops.h>
#include <linux/bitops.h>
#include <linux/types.h>
#include <linux/types.h>


#define DISPLAY_FLAGS_HSYNC_LOW		BIT(0)
enum display_flags {
#define DISPLAY_FLAGS_HSYNC_HIGH	BIT(1)
	DISPLAY_FLAGS_HSYNC_LOW		= BIT(0),
#define DISPLAY_FLAGS_VSYNC_LOW		BIT(2)
	DISPLAY_FLAGS_HSYNC_HIGH	= BIT(1),
#define DISPLAY_FLAGS_VSYNC_HIGH	BIT(3)
	DISPLAY_FLAGS_VSYNC_LOW		= BIT(2),
#define DISPLAY_FLAGS_DE_LOW		BIT(4)	/* data enable flag */
	DISPLAY_FLAGS_VSYNC_HIGH	= BIT(3),
#define DISPLAY_FLAGS_DE_HIGH		BIT(5)

#define DISPLAY_FLAGS_PIXDATA_POSEDGE	BIT(6)	/* drive data on pos. edge */
	/* data enable flag */
#define DISPLAY_FLAGS_PIXDATA_NEGEDGE	BIT(7)	/* drive data on neg. edge */
	DISPLAY_FLAGS_DE_LOW		= BIT(4),
#define DISPLAY_FLAGS_INTERLACED	BIT(8)
	DISPLAY_FLAGS_DE_HIGH		= BIT(5),
#define DISPLAY_FLAGS_DOUBLESCAN	BIT(9)
	/* 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
 * 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 vback_porch;	/* ver. back porch */
	struct timing_entry vsync_len;		/* ver. sync len */
	struct timing_entry vsync_len;		/* ver. sync len */


	unsigned int flags;			/* display flags */
	enum display_flags flags;		/* display flags */
};
};


/*
/*
+1 −1
Original line number Original line Diff line number Diff line
@@ -29,7 +29,7 @@ struct videomode {
	u32 vback_porch;
	u32 vback_porch;
	u32 vsync_len;
	u32 vsync_len;


	unsigned int flags; /* display flags */
	enum display_flags flags; /* display flags */
};
};


/**
/**