From patchwork Sun Sep 16 16:00:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Frank_Sch=C3=A4fer?= X-Patchwork-Id: 1463151 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id D36D3DF28C for ; Sun, 16 Sep 2012 16:00:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751675Ab2IPQAn (ORCPT ); Sun, 16 Sep 2012 12:00:43 -0400 Received: from mail-wi0-f172.google.com ([209.85.212.172]:62460 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751600Ab2IPQAl (ORCPT ); Sun, 16 Sep 2012 12:00:41 -0400 Received: by wibhi8 with SMTP id hi8so1638690wib.1 for ; Sun, 16 Sep 2012 09:00:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=LufdpPHBIaF1fsl0cqXgWnKP+QLBIVQFo3U/cx4l2es=; b=DoqWLa7HtJBE34qDwu41rjFclL7mczq0MWEk+/6VONZh4/d9bbIBLizePkofourQJV i4V/4sb37x1G53bT9ygUHsbEwdD40K8vveChtbsdVRUPdKaC3jwk+daXTAmi0WVkUK06 kH30KKgaYbW6QrZUwGPfKXp02xXomp7wKYqKdQTM7fM5IxQb9g5P7umBwA+xhhi9VvXR OahJNCwHVe9pF6RhkcCcf0+Yvn271dD7yeJQ+qEy6roZuh+Pe9xRP9ZlHOwLZ4g/bYhx gE0MT3Zi7+GXlxo0ZQC1TALzn/R3GDyKUp4SVUnQJ9x6gncY7CdDMJGMfcZlUVLl5n6U sXJg== Received: by 10.216.240.3 with SMTP id d3mr4910214wer.87.1347811240225; Sun, 16 Sep 2012 09:00:40 -0700 (PDT) Received: from localhost.localdomain (ip-176-199-46-78.unitymediagroup.de. [176.199.46.78]) by mx.google.com with ESMTPS id w7sm12601075wiz.0.2012.09.16.09.00.39 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 16 Sep 2012 09:00:39 -0700 (PDT) From: =?UTF-8?q?Frank=20Sch=C3=A4fer?= To: hdegoede@redhat.com Cc: linux-media@vger.kernel.org, =?UTF-8?q?Frank=20Sch=C3=A4fer?= Subject: [PATCH 3/4] v4l2-ctrl: add a control for green balance Date: Sun, 16 Sep 2012 18:00:39 +0200 Message-Id: <1347811240-4000-3-git-send-email-fschaefer.oss@googlemail.com> X-Mailer: git-send-email 1.7.7 In-Reply-To: <1347811240-4000-1-git-send-email-fschaefer.oss@googlemail.com> References: <1347811240-4000-1-git-send-email-fschaefer.oss@googlemail.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org We already support the red balance (V4L2_CID_RED_BALANCE) and blue balance (V4L2_CID_BLUE_BALANCE) controls and lots of hardware provides a possibility to adjust the green balance, too. Several drivers already support this as custom controls, other just don't do that due to the lack of a V4L2 standard control. Signed-off-by: Frank Schäfer --- Documentation/DocBook/media/v4l/controls.xml | 5 +++++ drivers/media/v4l2-core/v4l2-ctrls.c | 2 ++ include/linux/videodev2.h | 4 +++- 3 files changed, 10 insertions(+), 1 deletions(-) diff --git a/Documentation/DocBook/media/v4l/controls.xml b/Documentation/DocBook/media/v4l/controls.xml index 272a5f7..dbb3b61 100644 --- a/Documentation/DocBook/media/v4l/controls.xml +++ b/Documentation/DocBook/media/v4l/controls.xml @@ -162,6 +162,11 @@ activated, keeps adjusting the white balance. Red chroma balance. + V4L2_CID_GREEN_BALANCE + integer + Green chroma balance. + + V4L2_CID_BLUE_BALANCE integer Blue chroma balance. diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c index ab287f2..39b9bb8 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls.c +++ b/drivers/media/v4l2-core/v4l2-ctrls.c @@ -575,6 +575,7 @@ const char *v4l2_ctrl_get_name(u32 id) case V4L2_CID_MIN_BUFFERS_FOR_OUTPUT: return "Min Number of Output Buffers"; case V4L2_CID_ALPHA_COMPONENT: return "Alpha Component"; case V4L2_CID_COLORFX_CBCR: return "Color Effects, CbCr"; + case V4L2_CID_GREEN_BALANCE: return "Green Balance"; /* MPEG controls */ /* Keep the order of the 'case's the same as in videodev2.h! */ @@ -941,6 +942,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type, case V4L2_CID_SATURATION: case V4L2_CID_HUE: case V4L2_CID_RED_BALANCE: + case V4L2_CID_GREEN_BALANCE: case V4L2_CID_BLUE_BALANCE: case V4L2_CID_GAMMA: case V4L2_CID_SHARPNESS: diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 4862165..72354ad 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h @@ -1390,8 +1390,10 @@ enum v4l2_colorfx { #define V4L2_CID_ALPHA_COMPONENT (V4L2_CID_BASE+41) #define V4L2_CID_COLORFX_CBCR (V4L2_CID_BASE+42) +#define V4L2_CID_GREEN_BALANCE (V4L2_CID_BASE+43) + /* last CID + 1 */ -#define V4L2_CID_LASTP1 (V4L2_CID_BASE+43) +#define V4L2_CID_LASTP1 (V4L2_CID_BASE+44) /* MPEG-class control IDs defined by V4L2 */ #define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)