From patchwork Fri Jun 12 16:46:25 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: 6599581 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 17DD89F1C1 for ; Fri, 12 Jun 2015 16:47:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B92602068C for ; Fri, 12 Jun 2015 16:47:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 952A520693 for ; Fri, 12 Jun 2015 16:46:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752111AbbFLQq4 (ORCPT ); Fri, 12 Jun 2015 12:46:56 -0400 Received: from mail-la0-f51.google.com ([209.85.215.51]:35656 "EHLO mail-la0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751199AbbFLQqs (ORCPT ); Fri, 12 Jun 2015 12:46:48 -0400 Received: by labko7 with SMTP id ko7so24670052lab.2 for ; Fri, 12 Jun 2015 09:46:47 -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=jfMQDGOMY7Og+rhvReyUpnM79oc0IfIGtY3Cgg/VrK0=; b=TqPBqEnKgXXy+SVJuM4cgT8Egi7ypS5GAwrR1FTXOmc9wkoiOP5LzvQGsBR3Qb8pFs jqiemou3z13KbSRAjfKzV01oPL6WVIoadKDbBs53hxbWm2tah6B28QSLKpsoDLDKhy4l WpZbSAHX6N8OoO7kb56/mRMUUTZTv3EouqipxT6aA/WERb/gOMaMqfY+yVmMDMtGHThp wG5HKR3zvJztq1FVOAUMzllHzfBOlfimgRPkYudVrcJPlicg3EDPJvngh5MnKOW+gbtV +YZ69d3so2qu49jitMF0c2hUoASn4/GeIyaI5W+2u0ozxbE9QPAKHhw0soQvROQCugJ5 NAWg== X-Received: by 10.112.130.68 with SMTP id oc4mr29540lbb.87.1434127607093; Fri, 12 Jun 2015 09:46:47 -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.46 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Jun 2015 09:46:46 -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 06/19] media/pci/saa7164-vbi: Implement vivioc_g_def_ext_ctrls Date: Fri, 12 Jun 2015 18:46:25 +0200 Message-Id: <1434127598-11719-7-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 Callback needed by ioctl VIDIOC_G_DEF_EXT_CTRLS as this driver does not use the controller framework. Signed-off-by: Ricardo Ribalda Delgado --- drivers/media/pci/saa7164/saa7164-vbi.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/drivers/media/pci/saa7164/saa7164-vbi.c b/drivers/media/pci/saa7164/saa7164-vbi.c index 859fd03d82f9..e3f6cf8e83ee 100644 --- a/drivers/media/pci/saa7164/saa7164-vbi.c +++ b/drivers/media/pci/saa7164/saa7164-vbi.c @@ -810,6 +810,33 @@ static int vidioc_queryctrl(struct file *file, void *priv, return -EINVAL; } +static int vidioc_g_def_ext_ctrls(struct file *file, void *priv, + struct v4l2_ext_controls *ctrls) +{ + struct saa7164_vbi_fh *fh = file->private_data; + struct saa7164_port *port = fh->port; + int i, err = 0; + struct v4l2_queryctrl q; + + if (ctrls->ctrl_class == V4L2_CTRL_CLASS_MPEG) { + for (i = 0; i < ctrls->count; i++) { + struct v4l2_ext_control *ctrl = ctrls->controls + i; + + q.id = ctrl->id; + err = fill_queryctrl(&port->vbi_params, &q); + if (err) { + ctrls->error_idx = i; + break; + } + ctrl->value = q.default_value; + } + return err; + + } + + return -EINVAL; +} + static int saa7164_vbi_stop_port(struct saa7164_port *port) { struct saa7164_dev *dev = port->dev; @@ -1263,6 +1290,7 @@ static const struct v4l2_ioctl_ops vbi_ioctl_ops = { .vidioc_try_fmt_vid_cap = vidioc_try_fmt_vid_cap, .vidioc_s_fmt_vid_cap = vidioc_s_fmt_vid_cap, .vidioc_g_ext_ctrls = vidioc_g_ext_ctrls, + .vidioc_g_def_ext_ctrls = vidioc_g_def_ext_ctrls, .vidioc_s_ext_ctrls = vidioc_s_ext_ctrls, .vidioc_try_ext_ctrls = vidioc_try_ext_ctrls, .vidioc_queryctrl = vidioc_queryctrl,