From patchwork Mon Oct 1 14:03:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 1531611 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from arroyo.ext.ti.com (arroyo.ext.ti.com [192.94.94.40]) by patchwork2.kernel.org (Postfix) with ESMTP id 449C4DFFAD for ; Mon, 1 Oct 2012 14:08:09 +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 q91E5ZWX015430; Mon, 1 Oct 2012 09:05:35 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id q91E5ZpE007167; Mon, 1 Oct 2012 09:05:35 -0500 Received: from dlelxv24.itg.ti.com (172.17.1.199) by dfle73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.1.323.3; Mon, 1 Oct 2012 09:05:35 -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 q91E5XJ6028442; Mon, 1 Oct 2012 09:05:34 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id ACE7D80627; Mon, 1 Oct 2012 09:05:33 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp51.itg.ti.com (dflp51.itg.ti.com [128.247.22.94]) by linux.omap.com (Postfix) with ESMTP id 4F88D80626 for ; Mon, 1 Oct 2012 09:05:32 -0500 (CDT) Received: from neches.ext.ti.com (neches.ext.ti.com [192.91.81.29]) by dflp51.itg.ti.com (8.13.7/8.13.8) with ESMTP id q91E5Wb7020965 for ; Mon, 1 Oct 2012 09:05:32 -0500 (CDT) Received: from psmtp.com (na3sys009amx243.postini.com [74.125.149.127]) by neches.ext.ti.com (8.13.7/8.13.7) with SMTP id q91E5UP9003210 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 1 Oct 2012 09:05:31 -0500 Received: from mail-pb0-f45.google.com ([209.85.160.45]) (using TLSv1) by na3sys009amx243.postini.com ([74.125.148.10]) with SMTP; Mon, 01 Oct 2012 14:05:31 GMT Received: by pbbrp2 with SMTP id rp2so7825277pbb.4 for ; Mon, 01 Oct 2012 07:05:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=HQ97nASskacNkNMCNpdt+YPR3hyrIOruingEP32t0og=; b=u59QDL06eL9dVfhY+z+BX069RhSgZk65lGCrXtiRnnM776mmz+hczCbc6b2zP2reh5 l5Qq5dSl3m46Sp7eKMQe7V3oAovpTAYult+cHYJnlOdLVqVh7S4Kv6RjPIUnCULvXQa4 PHD+MQL5gM8nk7AhQmf4rq8XXs/KmU3dOx2nFY9t3+rEUUyxIseYDgVtQtAQ/g/GNXd+ A4fXXNpQu9t4+2qtejyksdCdBgqH+6z9elsBgzCSFDV3IntEJKXMkPIaWcez6xXP0dGv 7+xGVQ8B1RqkRVskKdAtykA1egaAeCVnXrr4iplrFAT2q5K+MBbayKKnT2RccTXvIFw+ fDYw== Received: by 10.68.220.2 with SMTP id ps2mr41293361pbc.61.1349100329547; Mon, 01 Oct 2012 07:05:29 -0700 (PDT) Received: from localhost.localdomain ([117.221.42.190]) by mx.google.com with ESMTPS id wl4sm10339069pbc.17.2012.10.01.07.05.09 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 01 Oct 2012 07:05:28 -0700 (PDT) From: Prabhakar To: LMML Subject: [PATCH RFC] media: v4l2-ctrl: Add digital gain controls Date: Mon, 1 Oct 2012 19:33:39 +0530 Message-ID: <1349100219-7599-1-git-send-email-prabhakar.lad@ti.com> X-Mailer: git-send-email 1.7.4.1 X-pstn-levels: (S:31.07758/99.90000 CV:99.9000 FC:95.5390 LC:95.5390 R:95.9108 P:95.9108 M:97.0282 C:98.6951 ) X-pstn-dkim: 1 skipped:not-enabled X-pstn-settings: 2 (0.5000:0.0050) s cv GT3 gt2 gt1 r p m c X-pstn-addresses: from [82/3] CC: DLOS , Rob Landley , LDOC , VGER , Sakari Ailus , Sylwester Nawrocki , Hans Verkuil , Mauro Carvalho Chehab , Guennadi Liakhovetski 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: , MIME-Version: 1.0 Sender: Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com From: Lad, Prabhakar add support for per color component digital gain controls and also their corresponding offset. Signed-off-by: Lad, Prabhakar Signed-off-by: Manjunath Hadli Cc: Sakari Ailus Cc: Laurent Pinchart Cc: Guennadi Liakhovetski Cc: Sylwester Nawrocki Cc: Hans Verkuil Cc: Hans de Goede hdegoede@redhat.com Cc: Chris MacGregor chris@cybermato.com Cc: Rob Landley Cc: Mauro Carvalho Chehab --- Documentation/DocBook/media/v4l/controls.xml | 54 ++++++++++++++++++++++++++ drivers/media/v4l2-core/v4l2-ctrls.c | 11 +++++ include/linux/v4l2-controls.h | 11 +++++ 3 files changed, 76 insertions(+), 0 deletions(-) diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml index a84a08c..9bf54f3 100644 --- a/Documentation/DocBook/media/v4l/controls.xml +++ b/Documentation/DocBook/media/v4l/controls.xml @@ -4277,6 +4277,60 @@ interface and may change in the future. specific test patterns can be used to test if a device is working properly. + + V4L2_CID_GAIN_RED + integer + + + V4L2_CID_GAIN_GREEN_RED + integer + + + V4L2_CID_GAIN_GREEN_BLUE + integer + + + V4L2_CID_GAIN_BLUE + integer + + + V4L2_CID_GAIN_GREEN + integer + + + Some capture/sensor devices have + the capability to set per color component digital gain values. + + + V4L2_CID_GAIN_OFFSET + integer + + + V4L2_CID_BLUE_OFFSET + integer + + + V4L2_CID_RED_OFFSET + integer + + + V4L2_CID_GREEN_OFFSET + integer + + + V4L2_CID_GREEN_RED_OFFSET + integer + + + V4L2_CID_GREEN_BLUE_OFFSET + integer + + + Some capture/sensor devices have the + capability to set per color component digital gain offset values. + V4L2_CID_GAIN_OFFSET is the global gain offset and the rest are per + color component gain offsets. + diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c index 93cd0a4..02cc1d2 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls.c +++ b/drivers/media/v4l2-core/v4l2-ctrls.c @@ -750,6 +750,17 @@ 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_TEST_PATTERN: return "Test Pattern"; + case V4L2_CID_GAIN_RED: return "Digital Gain Red"; + case V4L2_CID_GAIN_GREEN_RED: return "Digital Gain Green Red"; + case V4L2_CID_GAIN_GREEN_BLUE: return "Digital Gain Green Blue"; + case V4L2_CID_GAIN_BLUE: return "Digital Gain Blue"; + case V4L2_CID_GAIN_GREEN: return "Digital Gain Green"; + case V4L2_CID_GAIN_OFFSET: return "Digital Gain Offset"; + case V4L2_CID_BLUE_OFFSET: return "Digital Gain Blue Offset"; + case V4L2_CID_RED_OFFSET: return "Digital Gain Red Offset"; + case V4L2_CID_GREEN_OFFSET: return "Digital Gain Green Offset"; + case V4L2_CID_GREEN_RED_OFFSET: return "Digital Gain Green Red Offset"; + case V4L2_CID_GREEN_BLUE_OFFSET: return "Digital Gain Green Blue Offset"; /* DV controls */ case V4L2_CID_DV_CLASS: return "Digital Video Controls"; diff --git a/include/linux/v4l2-controls.h b/include/linux/v4l2-controls.h index e1b3680..087596d 100644 --- a/include/linux/v4l2-controls.h +++ b/include/linux/v4l2-controls.h @@ -758,5 +758,16 @@ enum v4l2_jpeg_chroma_subsampling { #define V4L2_CID_LINK_FREQ (V4L2_CID_IMAGE_PROC_CLASS_BASE + 1) #define V4L2_CID_PIXEL_RATE (V4L2_CID_IMAGE_PROC_CLASS_BASE + 2) #define V4L2_CID_TEST_PATTERN (V4L2_CID_IMAGE_PROC_CLASS_BASE + 3) +#define V4L2_CID_GAIN_RED (V4L2_CID_IMAGE_PROC_CLASS_BASE + 4) +#define V4L2_CID_GAIN_GREEN_RED (V4L2_CID_IMAGE_PROC_CLASS_BASE + 5) +#define V4L2_CID_GAIN_GREEN_BLUE (V4L2_CID_IMAGE_PROC_CLASS_BASE + 6) +#define V4L2_CID_GAIN_BLUE (V4L2_CID_IMAGE_PROC_CLASS_BASE + 7) +#define V4L2_CID_GAIN_GREEN (V4L2_CID_IMAGE_PROC_CLASS_BASE + 8) +#define V4L2_CID_GAIN_OFFSET (V4L2_CID_IMAGE_PROC_CLASS_BASE + 9) +#define V4L2_CID_BLUE_OFFSET (V4L2_CID_IMAGE_PROC_CLASS_BASE + 10) +#define V4L2_CID_RED_OFFSET (V4L2_CID_IMAGE_PROC_CLASS_BASE + 11) +#define V4L2_CID_GREEN_OFFSET (V4L2_CID_IMAGE_PROC_CLASS_BASE + 12) +#define V4L2_CID_GREEN_RED_OFFSET (V4L2_CID_IMAGE_PROC_CLASS_BASE + 13) +#define V4L2_CID_GREEN_BLUE_OFFSET (V4L2_CID_IMAGE_PROC_CLASS_BASE + 14) #endif