Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp347866ybx; Fri, 1 Nov 2019 04:34:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqwwNqIGUEYVJWaPiu0K6zm53neS9UPP8sWnBW5alA4cwhOiZvD4IM3j8Hka0SSp4ojOjI59 X-Received: by 2002:a17:906:1604:: with SMTP id m4mr9290751ejd.124.1572608045658; Fri, 01 Nov 2019 04:34:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572608045; cv=none; d=google.com; s=arc-20160816; b=R1dhHQ2FonSNvN/gYnn0JcPRSk08FEl1aRyw28jZ8XxsRDdNGKFZbZvhmOL0KVrCQZ UtP3ACOM/gttPWWrtGzvGneqqee6KTbHENv3iYDoORouTn3IO48g8o5i8Ps3vp5zhAps BCzLvhyMEInUijyhytN4sCEdgl3ipCg8EKIRxc0hbnWte3GSkvC5vL7zCOcdIsFNbnLn 1S3RR8szgEGs1+QVhb7Y2t299QoTWAY5nW85MuYsOzBaSzFcdI8T1npOuOELkSbXWXB2 N3FFY9wuQbgtX0gqstQxxgxetuKayqr7Tw045DQXUJfpCRtUfs3579eaNbFzanuqjUfT DhUw== 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=GW+RiqAUvdeyf1VPnXKgJgDQjIa6mTVNLoSeIKSIaY4=; b=Qg0/1CybYJmLawDLsToJ8fYURwjz+j62kCkln3b58we+fAcEazg5clvKBbfIsJVwlq 2qBv06QPUAKya5GWUJk6GCy4o94zN2Nezp7LIwTjcf0O5WjambDzxOjcH8gvdi/UcEpi pdbkF7rOlmqqTxwnX8xW0UrtH2AuGa/RfW30GJZi5VNndNGiMgP64zv0X4/hJCXuuV4s MkzPD955fwBbZYG+XqaDD733uSWopenLCUqFSQ/cG5p1vuX39dpNkSFdTPqHihdUlmuY dnMobqRo1jftGhyZwoSdoPdwIC/VKZnqiVPLmKn3JKbsAjYhKk0YrmO0RCUMtRfHZC4Z mrHw== 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 j27si5816929ejb.225.2019.11.01.04.33.42; Fri, 01 Nov 2019 04:34:05 -0700 (PDT) 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 S1730416AbfKALYK (ORCPT + 99 others); Fri, 1 Nov 2019 07:24:10 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:45912 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730400AbfKALYI (ORCPT ); Fri, 1 Nov 2019 07:24:08 -0400 Received: by mail-lf1-f67.google.com with SMTP id v8so6943483lfa.12; Fri, 01 Nov 2019 04:24:05 -0700 (PDT) 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=GW+RiqAUvdeyf1VPnXKgJgDQjIa6mTVNLoSeIKSIaY4=; b=RUt/Xjxi5gOUV0fyzwyPbDBXjrZ+0SQ5l3wO9qE67sD+6ajkni0rRl1QIeZi3RWtkq H0TO2CJJSDwN0TfQL6ftgwQ9rpJh8Oxdba6DHgsmm5oSZ9rQwHku4YX3GCh2eL8g3Rgs W5ArZT2Lkc9Bh6b2OARf/XaAMmM7B3+eRwm+/xYJS1gAF9vkFUGVsDKMbtpM0rUOUvtw WOIACUbwjYrENY14eXri10NSNa9zls/Neh+IUcxQhhR5wF2FZABbbaq95RZQ740jpwAB 9u/PgdgCwZOG3/Nc8War1Q9q4H0nvJQU/mspL9i+3wFVOvWR92SC9z9r4cDY8jNRSPrO buyQ== X-Gm-Message-State: APjAAAVzHo13LUGiMYVK9XiRCTduZBsWM7zWhk47/yMZE44i0/wnO3m2 heIcyneokDe3amhXxIUenTM= X-Received: by 2002:ac2:5144:: with SMTP id q4mr7215134lfd.36.1572607444411; Fri, 01 Nov 2019 04:24:04 -0700 (PDT) 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 v1sm2313691lji.89.2019.11.01.04.24.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2019 04:24:03 -0700 (PDT) From: Ricardo Ribalda Delgado To: Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Ricardo Ribalda Delgado Subject: [PATCH v3 3/5] media: vivid: Add an area control Date: Fri, 1 Nov 2019 12:23:56 +0100 Message-Id: <20191101112358.29538-3-ribalda@kernel.org> X-Mailer: git-send-email 2.24.0.rc1 In-Reply-To: <20191101112358.29538-1-ribalda@kernel.org> References: <20191101112358.29538-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..fd35863798a7 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 = 0xcafe, + .height = 0xb1b1d, +}; + +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