From patchwork Fri Jun 12 16:46:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda Delgado X-Patchwork-Id: 6599711 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 603D89F52D for ; Fri, 12 Jun 2015 16:47:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8C67E2068D for ; Fri, 12 Jun 2015 16:47:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9F21020690 for ; Fri, 12 Jun 2015 16:47:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752335AbbFLQrZ (ORCPT ); Fri, 12 Jun 2015 12:47:25 -0400 Received: from mail-la0-f43.google.com ([209.85.215.43]:34560 "EHLO mail-la0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751205AbbFLQqu (ORCPT ); Fri, 12 Jun 2015 12:46:50 -0400 Received: by laew7 with SMTP id w7so24638204lae.1 for ; Fri, 12 Jun 2015 09:46:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DPs7tN5/tAoz5KHlonAO32mWjwxG+PZ/GG5aC9phO3w=; b=BWbMxuND/OPYKON5KPYWu9vu6qmR2edQUKjuw7l5UGMmhjvEtZ8+K63OS3maw752VJ vjkomcT8261N4VNQYpi+SjmbcHMtM2zETqp48YN4kYi3U5LcjO7NK7uMhcSQcDKdivtj AQJwvfBmDj8zfWAhdpQNroolD13NVlGdBsR5s/oJYw9i1L34xO6BkPWjzxijxwDLIgtH C/6tlhnmWfyxjTMGoEAdfj2ey8MYszOLh6NKfTvHF/1bqDTGdbR/THFFibenhNr4oX1k X19tRKRyu1UJmmpbMaiNeBBzZM+vinN6Gi4MmhL1EZuI7VuqdldPwiFXDs0XDEERvMXT cQAw== X-Received: by 10.112.9.104 with SMTP id y8mr15578716lba.49.1434127608821; Fri, 12 Jun 2015 09:46:48 -0700 (PDT) Received: from neopili.qtec.com (cpe.xe-3-0-1-778.vbrnqe10.dk.customer.tdc.net. [80.197.57.18]) by mx.google.com with ESMTPSA id s8sm927103las.29.2015.06.12.09.46.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Jun 2015 09:46:48 -0700 (PDT) From: Ricardo Ribalda Delgado To: Hans Verkuil , Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Guennadi Liakhovetski , linux-media@vger.kernel.org Cc: Ricardo Ribalda Delgado Subject: [RFC v3 08/19] v4l2-subdev: Add g_def_ext_ctrls to core_ops Date: Fri, 12 Jun 2015 18:46:27 +0200 Message-Id: <1434127598-11719-9-git-send-email-ricardo.ribalda@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1434127598-11719-1-git-send-email-ricardo.ribalda@gmail.com> References: <1434127598-11719-1-git-send-email-ricardo.ribalda@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This function returns the default value of an extended control. Provides sub-devices with the same functionality as ioctl VIDIOC_G_DEF_EXT_CTRLS. Signed-off-by: Ricardo Ribalda Delgado --- drivers/media/v4l2-core/v4l2-ctrls.c | 7 +++++++ include/media/v4l2-ctrls.h | 2 ++ include/media/v4l2-subdev.h | 2 ++ 3 files changed, 11 insertions(+) diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c index 02ff6f573fd2..2a42b826f857 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls.c +++ b/drivers/media/v4l2-core/v4l2-ctrls.c @@ -2888,6 +2888,13 @@ int v4l2_subdev_g_ext_ctrls(struct v4l2_subdev *sd, struct v4l2_ext_controls *cs } EXPORT_SYMBOL(v4l2_subdev_g_ext_ctrls); +int v4l2_subdev_g_def_ext_ctrls(struct v4l2_subdev *sd, + struct v4l2_ext_controls *cs) +{ + return v4l2_g_ext_ctrls(sd->ctrl_handler, cs, true); +} +EXPORT_SYMBOL(v4l2_subdev_g_def_ext_ctrls); + /* Helper function to get a single control */ static int get_ctrl(struct v4l2_ctrl *ctrl, struct v4l2_ext_control *c) { diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h index 16f16b67181b..61e6cd67fc10 100644 --- a/include/media/v4l2-ctrls.h +++ b/include/media/v4l2-ctrls.h @@ -823,6 +823,8 @@ int v4l2_s_ext_ctrls(struct v4l2_fh *fh, struct v4l2_ctrl_handler *hdl, int v4l2_subdev_queryctrl(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc); int v4l2_subdev_querymenu(struct v4l2_subdev *sd, struct v4l2_querymenu *qm); int v4l2_subdev_g_ext_ctrls(struct v4l2_subdev *sd, struct v4l2_ext_controls *cs); +int v4l2_subdev_g_def_ext_ctrls(struct v4l2_subdev *sd, + struct v4l2_ext_controls *cs); int v4l2_subdev_try_ext_ctrls(struct v4l2_subdev *sd, struct v4l2_ext_controls *cs); int v4l2_subdev_s_ext_ctrls(struct v4l2_subdev *sd, struct v4l2_ext_controls *cs); int v4l2_subdev_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl); diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index dc20102ff600..01b3354942cf 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h @@ -158,6 +158,8 @@ struct v4l2_subdev_core_ops { int (*g_ctrl)(struct v4l2_subdev *sd, struct v4l2_control *ctrl); int (*s_ctrl)(struct v4l2_subdev *sd, struct v4l2_control *ctrl); int (*g_ext_ctrls)(struct v4l2_subdev *sd, struct v4l2_ext_controls *ctrls); + int (*g_def_ext_ctrls)(struct v4l2_subdev *sd, + struct v4l2_ext_controls *ctrls); int (*s_ext_ctrls)(struct v4l2_subdev *sd, struct v4l2_ext_controls *ctrls); int (*try_ext_ctrls)(struct v4l2_subdev *sd, struct v4l2_ext_controls *ctrls); int (*querymenu)(struct v4l2_subdev *sd, struct v4l2_querymenu *qm);