Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp3929628ybx; Mon, 4 Nov 2019 05:10:45 -0800 (PST) X-Google-Smtp-Source: APXvYqyBLg5Ne2iNFQ4Thow9YpPNsJZeQXdscRm7inJzeP5+VPvI0h2hhsH30IWWXFLWj8prna2U X-Received: by 2002:a17:906:cd10:: with SMTP id oz16mr13351748ejb.310.1572873045109; Mon, 04 Nov 2019 05:10:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572873045; cv=none; d=google.com; s=arc-20160816; b=Pus0O8jodWSVnF5LXnVUkTvOqE+/rDbL5lXtIdmIp4RtdB2R0W0E5NswfBLgkH0RaU xGx+8bCTtpHerlLBNcSyR9O3E+pc8ZG/BTnfmtM9HCggHEs9YHYu4TTbWmbunDJfxN06 Voc8ysYCmWLzG67rUt0ihX+pWV85YuF0V66GoRff2OCsN6ek2zKrYCVsp3WurFzPwXs6 wtC97adovCIgvZ3+zthRlJ+SsCMnfKX427YNLtXYVA27cAJKUrC/UbmtR5QCtLNDLlvf QWCoiZPAtdPBRuqrbubzM9ejQdcz9AHOYl395Kk60/nyTGhPUQIA9O2OPgl+MsXzisMm DS2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=D+ffK2Zkjlt7h/8BLS2fe/6Xm65ngdwZAR8g1pMusNs=; b=BF3xWv/dAa38t6ix1Haff2+0ZHBgp71Ola3nA7s7v7iwYGkR6xReC4w+8B2MhhrKUK mmn5YCeH32uOQSV4fMijvD5umOXF5eGQwrbFpaJWZIO5qc1JmwRZnl9AFvKyKUyNMN8h wQnLu+1biLfoije+9ViyFbs57T9SF5Oa4jv/2j3bO0zRKFDZxvqL0r/WeYLQrEFFPcBk Bk6WIXIPfyJWNNCEJhMMVmTgw1ljii7EFxxK+StYlYuYHH4xH/B7OtYSNq1SjYcxBBtV N1r8Z8ING/6hC4uxAhB4dMyv9L+XxGgln9OAjjfDsUosZ8W0MfAlRkPu2r+ZyoNofojf QBow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d15si7880619edn.49.2019.11.04.05.10.21; Mon, 04 Nov 2019 05:10:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729142AbfKDNJh (ORCPT + 99 others); Mon, 4 Nov 2019 08:09:37 -0500 Received: from mail-lf1-f67.google.com ([209.85.167.67]:36245 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729090AbfKDNJe (ORCPT ); Mon, 4 Nov 2019 08:09:34 -0500 Received: by mail-lf1-f67.google.com with SMTP id a6so8794970lfo.3; Mon, 04 Nov 2019 05:09:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=D+ffK2Zkjlt7h/8BLS2fe/6Xm65ngdwZAR8g1pMusNs=; b=S9ae7lFpIdpFW6KBKJ1OAK2M7JrCNDt7cIl+mQnZ0CmR2u1YoJCsk0WB1JA9CUvHnm CeSvR0c8h4+SjuuUYniuQfY55wb740n3vQj1Ho/oeVYfEZ6FR6MjhCJzNH2zZ+PMZHqQ YGJjZZzVqeC9thZ/LoK8Hd1Sz7JLBB9WYacaM6qwHGX7+jF+hzcZeHw+HNEVhlAu3pSv J3ad1aTG+BuqkXafP6ACMfMRQNdl50dZMRZTkQkNx/vrdMSMR7u7XdfviqLWhOqkXfbD lBQoZoSlSnv2qWX7UjvjsJ34UipCzZURo608SjkJmOPjYIbPcdaD9yp3wr/7HJ9rzJKh hnJg== X-Gm-Message-State: APjAAAUYww7oY19Mj+bfVLlxZTsSuLfFOqErEceGMBSmaQAZkjqPxCMv kfQ/h84++Sbw/0HbrOFXsuk= X-Received: by 2002:a19:d7:: with SMTP id 206mr16680328lfa.22.1572872972409; Mon, 04 Nov 2019 05:09:32 -0800 (PST) Received: from neopili.qtec.com (cpe.xe-3-0-1-778.vbrnqe10.dk.customer.tdc.net. [80.197.57.18]) by smtp.gmail.com with ESMTPSA id q124sm985414ljq.93.2019.11.04.05.09.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Nov 2019 05:09:31 -0800 (PST) From: Ricardo Ribalda Delgado To: Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Ricardo Ribalda Delgado Subject: [PATCH v4 3/6] media: vivid: Add an area control Date: Mon, 4 Nov 2019 14:09:20 +0100 Message-Id: <20191104130923.22184-3-ribalda@kernel.org> X-Mailer: git-send-email 2.24.0.rc1 In-Reply-To: <20191104130923.22184-1-ribalda@kernel.org> References: <20191104130923.22184-1-ribalda@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This control represents a generic read/write area. Suggested-by: Hans Verkuil Signed-off-by: Ricardo Ribalda Delgado --- drivers/media/platform/vivid/vivid-ctrls.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/media/platform/vivid/vivid-ctrls.c b/drivers/media/platform/vivid/vivid-ctrls.c index b250fc3764e2..68e8124c7973 100644 --- a/drivers/media/platform/vivid/vivid-ctrls.c +++ b/drivers/media/platform/vivid/vivid-ctrls.c @@ -32,6 +32,7 @@ #define VIVID_CID_U32_ARRAY (VIVID_CID_CUSTOM_BASE + 8) #define VIVID_CID_U16_MATRIX (VIVID_CID_CUSTOM_BASE + 9) #define VIVID_CID_U8_4D_ARRAY (VIVID_CID_CUSTOM_BASE + 10) +#define VIVID_CID_AREA (VIVID_CID_CUSTOM_BASE + 11) #define VIVID_CID_VIVID_BASE (0x00f00000 | 0xf000) #define VIVID_CID_VIVID_CLASS (0x00f00000 | 1) @@ -266,6 +267,18 @@ static const struct v4l2_ctrl_config vivid_ctrl_disconnect = { .type = V4L2_CTRL_TYPE_BUTTON, }; +static const struct v4l2_area area = { + .width = 1000, + .height = 2000, +}; + +static const struct v4l2_ctrl_config vivid_ctrl_area = { + .ops = &vivid_user_gen_ctrl_ops, + .id = VIVID_CID_AREA, + .name = "Area", + .type = V4L2_CTRL_TYPE_AREA, + .p_def.p_const = &area, +}; /* Framebuffer Controls */ @@ -1574,6 +1587,7 @@ int vivid_create_controls(struct vivid_dev *dev, bool show_ccs_cap, dev->string = v4l2_ctrl_new_custom(hdl_user_gen, &vivid_ctrl_string, NULL); dev->bitmask = v4l2_ctrl_new_custom(hdl_user_gen, &vivid_ctrl_bitmask, NULL); dev->int_menu = v4l2_ctrl_new_custom(hdl_user_gen, &vivid_ctrl_int_menu, NULL); + v4l2_ctrl_new_custom(hdl_user_gen, &vivid_ctrl_area, NULL); v4l2_ctrl_new_custom(hdl_user_gen, &vivid_ctrl_u32_array, NULL); v4l2_ctrl_new_custom(hdl_user_gen, &vivid_ctrl_u16_matrix, NULL); v4l2_ctrl_new_custom(hdl_user_gen, &vivid_ctrl_u8_4d_array, NULL); -- 2.24.0.rc1