From patchwork Wed Mar 27 06:58:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 2348771 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 0CC51DFE82 for ; Wed, 27 Mar 2013 09:05:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F36BEE652B for ; Wed, 27 Mar 2013 02:05:34 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) by gabe.freedesktop.org (Postfix) with ESMTP id 397E2E621A for ; Tue, 26 Mar 2013 23:59:19 -0700 (PDT) Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id r2R6xC8U009626; Wed, 27 Mar 2013 01:59:12 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id r2R6xBv4005364; Wed, 27 Mar 2013 01:59:11 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.2.342.3; Wed, 27 Mar 2013 01:59:11 -0500 Received: from deskari.tieu.ti.com (h64-4.vpn.ti.com [172.24.64.4]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id r2R6x2nb029150; Wed, 27 Mar 2013 01:59:09 -0500 From: Tomi Valkeinen To: Steffen Trumtrar , , Subject: [PATCHv2 3/5] videomode: create enum for videomode's display flags Date: Wed, 27 Mar 2013 08:58:23 +0200 Message-ID: <1364367505-4366-4-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1364367505-4366-1-git-send-email-tomi.valkeinen@ti.com> References: <1364367505-4366-1-git-send-email-tomi.valkeinen@ti.com> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 27 Mar 2013 02:01:16 -0700 Cc: Tomi Valkeinen , Laurent Pinchart 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 */ }; /**