Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp398340ybx; Fri, 1 Nov 2019 05:20:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqyIQn3YzrRU5U/eVUWFWH8HaIMibkL6qHH4LLVR6RcBsexc5F1XhJh0jnzY09v848bKE8P4 X-Received: by 2002:a17:907:41ae:: with SMTP id of22mr9459804ejb.30.1572610853876; Fri, 01 Nov 2019 05:20:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572610853; cv=none; d=google.com; s=arc-20160816; b=ZHOqnV9df/+SaRIMjBqxifOSkVzHjiDgYHnikexhRUehCplZ7XA4I4hQLI/HqywSI9 lHXmTgyTAGC8MpLeRugvH3dEy54YvbidgdzXtC0YDLckvrQ5KhH9Ev74VZQzzf6r7aV1 +nRkkvOoeS0YVFvpHroM8OZ0Vcg4Vl2b7sQV76OsfPGS9ujb2vj2dUDbs1T7vxAeHuPJ Uk5JUNSbJd7hGtrHkciI6iF7f/IDJR3ugYcjcFwMPnEEkfqZ+BCTWtY6TpJHl2gldoZg kr6Hw4OGxh6+EpnYepactb4OFk5rW5T214ZuZHSGtmVP1HmOqml8ptZ91nd7z5xbaiej ptlA== 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 :message-id:date:subject:cc:to:from; bh=9P8rBv8FlOAdd5Kdu3vWsUKtcKK3jMnnUl9eTBCRCiQ=; b=W2wNTAnvfVO2TRueDd7xqO806MeEfykjXnbwPUHwkZNiwvG5kE0WTyRkz1LuqQu6ev KjC3WY7vIUERfE/MADFR6U6QVOF8gfJY7vREcsw9FpCHJjVG1dzWBLtFQb8t6+10h7Dm k6ReK//kkQvPzLqC5OcUZzrFARWpAD7H9yGDqjaRGsWg4xr8VlnuyM/Yrtxc/DYwdLp+ KRpD5QvgXyuoPakICrOlfGQJ53JUEaCchlIFx2jAACfeh4ieHigwnr7aWK2EiLmbVX1D Ic52YP+D3jHQXbcqFfGkAUnOMWIDojzbCaCc7arJYWTdwY2cXWdQt5GKE57fjfy4mPa6 ygjg== 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 e50si217833ede.59.2019.11.01.05.20.30; Fri, 01 Nov 2019 05:20:53 -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 S1730382AbfKALYD (ORCPT + 99 others); Fri, 1 Nov 2019 07:24:03 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:34978 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726229AbfKALYD (ORCPT ); Fri, 1 Nov 2019 07:24:03 -0400 Received: by mail-lf1-f65.google.com with SMTP id y6so6992562lfj.2; Fri, 01 Nov 2019 04:24:02 -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:mime-version :content-transfer-encoding; bh=9P8rBv8FlOAdd5Kdu3vWsUKtcKK3jMnnUl9eTBCRCiQ=; b=i1xbJEe/QyVRm0WYAQMlPgQMmF9kwPRNJTpODcl3IpdrJ4u/TaNVYfOOLChGoDYuof IXPpvJ7AXUCUm0mHMrEDoPFHVewOfbBR9oT1JtxVFAai3QqEnUwS1k6U1B6441O8XotW G5tEmfQUxWv9kLZ0ZyJUwdOSIsVvnSefZcT9DxQBtWH4SzDpooA3/1sRKOBJ0y9q5aEC zLuF17IOPnuae9vEeZ0Wql/qqvMsuz3HgYhjNVk5GY8Sx1fDk0El1CxwKgGvB/4BbE8X U1pIJclSqvn+mHiZLsmytWh6XksmrPy9AhYUfZVbVuHNdeDpHuutKyc/tP8Ahbm2W/Kn gXnw== X-Gm-Message-State: APjAAAW+NsazG5C4fpexXSecdnB2HX1IQddP5+NHFi1h66KaO7A54TLE 7h57y1fvkEKM5lKLwFm0gNA= X-Received: by 2002:a19:ac48:: with SMTP id r8mr7285986lfc.181.1572607441240; Fri, 01 Nov 2019 04:24:01 -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.23.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2019 04:23:59 -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 1/5] media: v4l2_ctrl: Add p_def to v4l2_ctrl_config Date: Fri, 1 Nov 2019 12:23:54 +0100 Message-Id: <20191101112358.29538-1-ribalda@kernel.org> X-Mailer: git-send-email 2.24.0.rc1 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 allows setting the default value on compound controls created via v4l2_ctrl_new_custom. Signed-off-by: Ricardo Ribalda Delgado --- drivers/media/v4l2-core/v4l2-ctrls.c | 2 +- include/media/v4l2-ctrls.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c index b4caf2d4d076..73d99c3561ce 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls.c +++ b/drivers/media/v4l2-core/v4l2-ctrls.c @@ -2690,7 +2690,7 @@ struct v4l2_ctrl *v4l2_ctrl_new_custom(struct v4l2_ctrl_handler *hdl, type, min, max, is_menu ? cfg->menu_skip_mask : step, def, cfg->dims, cfg->elem_size, - flags, qmenu, qmenu_int, ptr_null, priv); + flags, qmenu, qmenu_int, cfg->p_def, priv); if (ctrl) ctrl->is_private = cfg->is_private; return ctrl; diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h index e719d56fc024..78a97b10c89e 100644 --- a/include/media/v4l2-ctrls.h +++ b/include/media/v4l2-ctrls.h @@ -382,6 +382,7 @@ struct v4l2_ctrl_handler { * @max: The control's maximum value. * @step: The control's step value for non-menu controls. * @def: The control's default value. + * @p_def: The control's default value for compound controls. * @dims: The size of each dimension. * @elem_size: The size in bytes of the control. * @flags: The control's flags. @@ -410,6 +411,7 @@ struct v4l2_ctrl_config { s64 max; u64 step; s64 def; + union v4l2_ctrl_ptr p_def; u32 dims[V4L2_CTRL_MAX_DIMS]; u32 elem_size; u32 flags; -- 2.24.0.rc1