From patchwork Mon Sep 3 09:16:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar Lad X-Patchwork-Id: 1399201 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from arroyo.ext.ti.com (arroyo.ext.ti.com [192.94.94.40]) by patchwork1.kernel.org (Postfix) with ESMTP id C53AE3FC85 for ; Mon, 3 Sep 2012 09:23:28 +0000 (UTC) Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id q839Gjak023925; Mon, 3 Sep 2012 04:16:45 -0500 Received: from DLEE74.ent.ti.com (dlee74.ent.ti.com [157.170.170.8]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id q839Gjm0017036; Mon, 3 Sep 2012 04:16:45 -0500 Received: from dlelxv24.itg.ti.com (172.17.1.199) by DLEE74.ent.ti.com (157.170.170.8) with Microsoft SMTP Server id 14.1.323.3; Mon, 3 Sep 2012 04:16:44 -0500 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dlelxv24.itg.ti.com (8.13.8/8.13.8) with ESMTP id q839GiTl016195; Mon, 3 Sep 2012 04:16:44 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 9809480627; Mon, 3 Sep 2012 04:16:44 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dbdp20.itg.ti.com (dbdp20.itg.ti.com [172.24.170.38]) by linux.omap.com (Postfix) with ESMTP id 68A2980626 for ; Mon, 3 Sep 2012 04:16:43 -0500 (CDT) Received: from DBDE70.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id q839Gcgf021165; Mon, 3 Sep 2012 14:46:39 +0530 (IST) Received: from dbdp32.itg.ti.com (172.24.170.251) by dbde70.ent.ti.com (172.24.170.148) with Microsoft SMTP Server id 14.1.323.3; Mon, 3 Sep 2012 14:46:38 +0530 Received: from localhost.localdomain (dbdp20.itg.ti.com [172.24.170.38]) by dbdp32.itg.ti.com (8.13.8/8.13.8) with ESMTP id q839GXsq005197; Mon, 3 Sep 2012 14:46:34 +0530 From: Prabhakar Lad To: LMML Subject: [PATCH] media: v4l2-ctrls: add control for test pattern Date: Mon, 3 Sep 2012 14:46:17 +0530 Message-ID: <1346663777-23149-1-git-send-email-prabhakar.lad@ti.com> X-Mailer: git-send-email 1.7.0.4 MIME-Version: 1.0 CC: dlos , Rob Landley , , HeungJun Kim , , Hans de Goede , Kyungmin Park , Sakari Ailus , Sylwester Nawrocki , Hans Verkuil , Mauro Carvalho Chehab X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com From: Lad, Prabhakar add V4L2_CID_TEST_PATTERN of type menu, which determines the internal test pattern selected by the device. Signed-off-by: Lad, Prabhakar Signed-off-by: Manjunath Hadli Cc: Sakari Ailus Cc: Hans Verkuil Cc: Laurent Pinchart Cc: Mauro Carvalho Chehab Cc: Sylwester Nawrocki Cc: Hans de Goede Cc: Kyungmin Park Cc: Rob Landley Cc: HeungJun Kim Cc: Rob Landley --- This patches has one checkpatch warning for line over 80 characters altough it can be avoided I have kept it for consistency. Documentation/DocBook/media/v4l/controls.xml | 52 ++++++++++++++++++++++++++ drivers/media/v4l2-core/v4l2-ctrls.c | 16 ++++++++ include/linux/videodev2.h | 12 ++++++ 3 files changed, 80 insertions(+), 0 deletions(-) diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml index f704218..06f16e7 100644 --- a/Documentation/DocBook/media/v4l/controls.xml +++ b/Documentation/DocBook/media/v4l/controls.xml @@ -4313,6 +4313,58 @@ interface and may change in the future. + + V4L2_CID_TEST_PATTERN + menu + + + The capture devices/sensors have the capability to + generate internal test patterns. This test patterns are used to test a device + is properly working and can generate the desired waveforms that it supports. + + + + + + + V4L2_TEST_PATTERN_DISABLED + Test pattern generation is disabled + + + V4L2_TEST_PATTERN_VERTICAL_LINES + Generate vertical lines as test pattern + + + V4L2_TEST_PATTERN_HORIZONTAL_LINES + Generate horizontal lines as test pattern + + + V4L2_TEST_PATTERN_DIAGONAL_LINES + Generate diagonal lines as test pattern + + + V4L2_TEST_PATTERN_SOLID_BLACK + Generate solid black color as test pattern + + + V4L2_TEST_PATTERN_SOLID_WHITE + Generate solid white color as test pattern + + + V4L2_TEST_PATTERN_SOLID_BLUE + Generate solid blue color as test pattern + + + V4L2_TEST_PATTERN_SOLID_RED + Generate solid red color as test pattern + + + V4L2_TEST_PATTERN_CHECKER_BOARD + Generate a checker board as test pattern + + + + diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c index 2d7bc15..ae709d1 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls.c +++ b/drivers/media/v4l2-core/v4l2-ctrls.c @@ -430,6 +430,18 @@ const char * const *v4l2_ctrl_get_menu(u32 id) "Advanced Predictor", NULL, }; + static const char * const test_pattern[] = { + "Test Pattern Disabled", + "Vertical Lines", + "Horizontal Lines", + "Diagonal Lines", + "Solid Black", + "Solid White", + "Solid Blue", + "Solid Red", + "Checker Board", + NULL, + }; switch (id) { case V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ: @@ -509,6 +521,8 @@ const char * const *v4l2_ctrl_get_menu(u32 id) return jpeg_chroma_subsampling; case V4L2_CID_DPCM_PREDICTOR: return dpcm_predictor; + case V4L2_CID_TEST_PATTERN: + return test_pattern; default: return NULL; @@ -740,6 +754,7 @@ const char *v4l2_ctrl_get_name(u32 id) case V4L2_CID_LINK_FREQ: return "Link Frequency"; case V4L2_CID_PIXEL_RATE: return "Pixel Rate"; case V4L2_CID_DPCM_PREDICTOR: return "DPCM Predictor"; + case V4L2_CID_TEST_PATTERN: return "Test Pattern"; default: return NULL; @@ -841,6 +856,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, case V4L2_CID_EXPOSURE_METERING: case V4L2_CID_SCENE_MODE: case V4L2_CID_DPCM_PREDICTOR: + case V4L2_CID_TEST_PATTERN: *type = V4L2_CTRL_TYPE_MENU; break; case V4L2_CID_LINK_FREQ: diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index ca9fb78..1796079 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h @@ -2005,6 +2005,18 @@ enum v4l2_dpcm_predictor { V4L2_DPCM_PREDICTOR_SIMPLE = 0, V4L2_DPCM_PREDICTOR_ADVANCED = 1, }; +#define V4L2_CID_TEST_PATTERN (V4L2_CID_IMAGE_PROC_CLASS_BASE + 4) +enum v4l2_test_pattern { + V4L2_TEST_PATTERN_DISABLED = 0, + V4L2_TEST_PATTERN_VERTICAL_LINES = 1, + V4L2_TEST_PATTERN_HORIZONTAL_LINES = 2, + V4L2_TEST_PATTERN_DIAGONAL_LINES = 3, + V4L2_TEST_PATTERN_SOLID_BLACK = 4, + V4L2_TEST_PATTERN_SOLID_WHITE = 5, + V4L2_TEST_PATTERN_SOLID_BLUE = 6, + V4L2_TEST_PATTERN_SOLID_RED = 7, + V4L2_TEST_PATTERN_CHECKER_BOARD = 8, +}; /* * T U N I N G