From patchwork Sun Mar 10 14:04:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volokh Konstantin X-Patchwork-Id: 2244811 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id E60163FCF6 for ; Sun, 10 Mar 2013 14:12:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752437Ab3CJOM3 (ORCPT ); Sun, 10 Mar 2013 10:12:29 -0400 Received: from mail-la0-f52.google.com ([209.85.215.52]:54103 "EHLO mail-la0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751741Ab3CJOM2 (ORCPT ); Sun, 10 Mar 2013 10:12:28 -0400 Received: by mail-la0-f52.google.com with SMTP id fs12so3019449lab.25 for ; Sun, 10 Mar 2013 07:12:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=lx5+J0xZYBjXcsLV98lK/w+YiQG49p2P6+EzN2Jdfuc=; b=ATGVTxOlN+UXAxERrXXzsVZNcY6hRkNkuEa0qDTJegZKogEPF1Gc+207jiwNvwmzdj G2QaUttdB2B8QVYIlZJGCPb6mM0qSpshUIIUbGGyp+YQDN2hjDJZZYTxfoRIeC3w54J1 eC99uauccT4Q0C542Qt6TFkEHGTt9pXRZMfr94BzdIev2HWQejLi2yVxZYs+/sYsZRTd hYFkaDvypu2bHS5aXUmphc1z05v16MyO2QNzdoGkClKlpuYwSmS1Yz5s9NRR6KjveuhZ fr9pxv4W6aSdRqtYukaLUjU3TZM1OF/Yt2P2rEBJ0OANjFYJks43I8F3VRZCXN10HL55 TNjA== X-Received: by 10.112.43.137 with SMTP id w9mr3354349lbl.77.1362924746924; Sun, 10 Mar 2013 07:12:26 -0700 (PDT) Received: from Volokh.Home (host-124-159-66-217.spbmts.ru. [217.66.159.124]) by mx.google.com with ESMTPS id m2sm3542813lbz.7.2013.03.10.07.12.15 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 10 Mar 2013 07:12:26 -0700 (PDT) From: Volokh Konstantin To: hverkuil@xs4all.nl, linux-media@vger.kernel.org Cc: Volokh Konstantin Subject: [PATCH 4/7] hverkuil/go7007: staging: media: go7007: Add Modet controls Date: Sun, 10 Mar 2013 18:04:43 +0400 Message-Id: <1362924286-23995-4-git-send-email-volokh84@gmail.com> X-Mailer: git-send-email 1.7.7.6 In-Reply-To: <1362924286-23995-1-git-send-email-volokh84@gmail.com> References: <1362924286-23995-1-git-send-email-volokh84@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Signed-off-by: Volokh Konstantin --- drivers/staging/media/go7007/go7007-v4l2.c | 95 ++++++++++++++++++++++++++++ drivers/staging/media/go7007/go7007.h | 18 +++++ 2 files changed, 113 insertions(+), 0 deletions(-) diff --git a/drivers/staging/media/go7007/go7007-v4l2.c b/drivers/staging/media/go7007/go7007-v4l2.c index 91e5572..c4d0ca2 100644 --- a/drivers/staging/media/go7007/go7007-v4l2.c +++ b/drivers/staging/media/go7007/go7007-v4l2.c @@ -1137,6 +1137,101 @@ static struct video_device go7007_template = { .tvnorms = V4L2_STD_ALL, }; +static struct v4l2_ctrl_config md_configs[] = { + { + .ops = &go7007_ctrl_ops + ,.id = V4L2_CID_USER_MODET_REGION_NUMBER + ,.name = "Region MD" + ,.type = V4L2_CTRL_TYPE_INTEGER + ,.min = 0 + ,.max = 3 + ,.step = 1 + ,.def = 0 + } + ,{ + .ops = &go7007_ctrl_ops + ,.id = V4L2_CID_USER_MODET_PIXEL_THRESOLD + ,.name = "Pixel Thresold" + ,.type = V4L2_CTRL_TYPE_INTEGER + ,.min = 0 + ,.max = 65535 + ,.step = 1 + ,.def = 32767 + } + ,{ + .ops = &go7007_ctrl_ops + ,.id = V4L2_CID_USER_MODET_MOTION_THRESOLD + ,.name = "Motion Thresold" + ,.type = V4L2_CTRL_TYPE_INTEGER + ,.min = 0 + ,.max = 65535 + ,.step = 1 + ,.def = 32767 + } + ,{ + .ops = &go7007_ctrl_ops + ,.id = V4L2_CID_USER_MODET_TRIGGER + ,.name = "Trigger" + ,.type = V4L2_CTRL_TYPE_INTEGER + ,.min = 0 + ,.max = 65535 + ,.step = 1 + ,.def = 32767 + } + ,{ + .ops = &go7007_ctrl_ops + ,.id = V4L2_CID_USER_MODET_CLIP_LEFT + ,.name = "Left of Region" + ,.type = V4L2_CTRL_TYPE_INTEGER + ,.min = 0 + ,.step = 1 + ,.def = 0 + } + ,{ + .ops = &go7007_ctrl_ops + ,.id = V4L2_CID_USER_MODET_CLIP_TOP + ,.name = "Top of Region" + ,.type = V4L2_CTRL_TYPE_INTEGER + ,.min = 0 + ,.step = 1 + ,.def = 0 + } + ,{ + .ops = &go7007_ctrl_ops + ,.id = V4L2_CID_USER_MODET_CLIP_WIDTH + ,.name = "Width of Region" + ,.type = V4L2_CTRL_TYPE_INTEGER + ,.min = 0 + ,.step = 1 + ,.def = 0 + } + ,{ + .ops = &go7007_ctrl_ops + ,.id = V4L2_CID_USER_MODET_CLIP_HEIGHT + ,.name = "Height of Region" + ,.type = V4L2_CTRL_TYPE_INTEGER + ,.min = 0 + ,.step = 1 + ,.def = 0 + } + ,{ + .ops = &go7007_ctrl_ops + ,.id = V4L2_CID_USER_MODET_REGION_CONTROL + ,.name = "Region Control" + ,.type = V4L2_CTRL_TYPE_MENU + ,.min = rcAdd + ,.max = rcClear + ,.step = 0 + ,.def = rcClear + ,.qmenu = (const char * const[]){ + "Add" + ,"Delete" + ,"Clear" + ,NULL + } + } +}; + int go7007_v4l2_ctrl_init(struct go7007 *go) { struct v4l2_ctrl_handler *hdl = &go->hdl; diff --git a/drivers/staging/media/go7007/go7007.h b/drivers/staging/media/go7007/go7007.h index 54b9897..fcb45ea 100644 --- a/drivers/staging/media/go7007/go7007.h +++ b/drivers/staging/media/go7007/go7007.h @@ -38,3 +38,21 @@ struct go7007_md_region { struct go7007_md_params) #define GO7007IOC_S_MD_REGION _IOW('V', BASE_VIDIOC_PRIVATE + 8, \ struct go7007_md_region) + +#define V4L2_CID_USER_GO7007_BASE (V4L2_CID_USER_BASE + 0x1000) +#define V4L2_CID_USER_MODET_REGION_NUMBER (V4L2_CID_USER_GO7007_BASE + 0x01) +#define V4L2_CID_USER_MODET_PIXEL_THRESOLD (V4L2_CID_USER_GO7007_BASE + 0x02) +#define V4L2_CID_USER_MODET_MOTION_THRESOLD (V4L2_CID_USER_GO7007_BASE + 0x03) +#define V4L2_CID_USER_MODET_TRIGGER (V4L2_CID_USER_GO7007_BASE + 0x04) +#define V4L2_CID_USER_MODET_REGION_CONTROL (V4L2_CID_USER_GO7007_BASE + 0x05) +#define V4L2_CID_USER_MODET_CLIP_LEFT (V4L2_CID_USER_GO7007_BASE + 0x06) +#define V4L2_CID_USER_MODET_CLIP_TOP (V4L2_CID_USER_GO7007_BASE + 0x07) +#define V4L2_CID_USER_MODET_CLIP_WIDTH (V4L2_CID_USER_GO7007_BASE + 0x08) +#define V4L2_CID_USER_MODET_CLIP_HEIGHT (V4L2_CID_USER_GO7007_BASE + 0x09) +#define V4L2_CID_USER_MODET_ALARM (V4L2_CID_USER_GO7007_BASE + 0x09) + +enum RegionControl { + rcAdd = 0 + ,rcDelete = 1 + ,rcClear = 2 +};