From patchwork Tue Mar 12 10:19:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 2255151 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 31AD63FCF6 for ; Tue, 12 Mar 2013 10:50:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 331E8E65AA for ; Tue, 12 Mar 2013 03:50:29 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from arroyo.ext.ti.com (arroyo.ext.ti.com [192.94.94.40]) by gabe.freedesktop.org (Postfix) with ESMTP id BFB34E654A for ; Tue, 12 Mar 2013 03:20:23 -0700 (PDT) Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id r2CAKHHC015188; Tue, 12 Mar 2013 05:20:17 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id r2CAKH1X025904; Tue, 12 Mar 2013 05:20:17 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.2.342.3; Tue, 12 Mar 2013 05:20:17 -0500 Received: from deskari.tieu.ti.com (h64-2.vpn.ti.com [172.24.64.2]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id r2CAKBdO003043; Tue, 12 Mar 2013 05:20:15 -0500 From: Tomi Valkeinen To: Steffen Trumtrar , , , Laurent Pinchart Subject: [PATCH 3/5] videomode: create enum for videomode's display flags Date: Tue, 12 Mar 2013 12:19:36 +0200 Message-ID: <1363083578-17062-3-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1363083578-17062-1-git-send-email-tomi.valkeinen@ti.com> References: <1363083578-17062-1-git-send-email-tomi.valkeinen@ti.com> MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 12 Mar 2013 03:46:45 -0700 Cc: Tomi Valkeinen X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org 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 Cc: Steffen Trumtrar --- include/video/display_timing.h | 28 +++++++++++++++++----------- include/video/videomode.h | 2 +- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/include/video/display_timing.h b/include/video/display_timing.h index a8a4be5..b63471d 100644 --- a/include/video/display_timing.h +++ b/include/video/display_timing.h @@ -12,16 +12,22 @@ #include #include -#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 */ }; /* diff --git a/include/video/videomode.h b/include/video/videomode.h index f4ae6ed..8b12e60 100644 --- a/include/video/videomode.h +++ b/include/video/videomode.h @@ -29,7 +29,7 @@ struct videomode { u32 vback_porch; u32 vsync_len; - unsigned int flags; /* display flags */ + enum display_flags flags; /* display flags */ }; /**