From patchwork Wed Jan 23 22:22:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sylwester Nawrocki X-Patchwork-Id: 2027031 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 6B1A53FCD5 for ; Wed, 23 Jan 2013 22:22:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752346Ab3AWWWY (ORCPT ); Wed, 23 Jan 2013 17:22:24 -0500 Received: from mail-ea0-f180.google.com ([209.85.215.180]:60356 "EHLO mail-ea0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752217Ab3AWWWW (ORCPT ); Wed, 23 Jan 2013 17:22:22 -0500 Received: by mail-ea0-f180.google.com with SMTP id c1so3585333eaa.39 for ; Wed, 23 Jan 2013 14:22:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=lBgcXhW+bzUBA3yVUyz15X8m3DduM3dWL4ic1LQSQtw=; b=YgQHnbrONpv9zlBt2ru+/2pXcT6yRC1ky5LJ6M3beKszWuActrrdsBFMYI2iml/Z7t KoWbnaz4DqD2iytZ5rMMVaHivP65xRxJBuEtWzwiwPQtzJ7KnzwFGRWJQ04n4ZYOL91c O+qXzfs3MfAgT0Ra3pmfpdOQvQcb2766FQHhuqsUvCuWrpDtIA42YK81YoE+i0Hiz97B 2uWsthUc/12yBYvKGoISQ12HOgmych/7Kxcl94PC6UdY6HUAk+6OEQb6DgoffLJQguQq cZ9vCrWmaOY6vlMdDspRXCSHcGcH0yzr2l+5umVRg0FO6rtS7FXfLtEo812Cl45dZm70 t0YA== X-Received: by 10.14.214.67 with SMTP id b43mr514198eep.33.1358979740768; Wed, 23 Jan 2013 14:22:20 -0800 (PST) Received: from localhost.localdomain (031011138205.warszawa.vectranet.pl. [31.11.138.205]) by mx.google.com with ESMTPS id f49sm32606042eep.12.2013.01.23.14.22.19 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 23 Jan 2013 14:22:20 -0800 (PST) From: Sylwester Nawrocki To: linux-media@vger.kernel.org Cc: hverkuil@xs4all.nl, laurent.pinchart@ideasonboard.com, sylvester.nawrocki@gmail.com Subject: [PATCH RFC v3 5/6] V4L: Add v4l2_ctrl_subdev_log_status() helper function Date: Wed, 23 Jan 2013 23:22:00 +0100 Message-Id: <1358979721-17473-6-git-send-email-sylvester.nawrocki@gmail.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1358979721-17473-1-git-send-email-sylvester.nawrocki@gmail.com> References: <1358979721-17473-1-git-send-email-sylvester.nawrocki@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This patch adds a v4l2 core helper function that can be used as the log_status handler for subdevs that only need to log state of the v4l2 controls owned by the subdev's control handler. Signed-off-by: Sylwester Nawrocki --- drivers/media/v4l2-core/v4l2-ctrls.c | 7 +++++++ include/media/v4l2-ctrls.h | 3 +++ 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c index 9051ec5..6b28b58 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls.c +++ b/drivers/media/v4l2-core/v4l2-ctrls.c @@ -2004,6 +2004,13 @@ void v4l2_ctrl_handler_log_status(struct v4l2_ctrl_handler *hdl, } EXPORT_SYMBOL(v4l2_ctrl_handler_log_status); +int v4l2_ctrl_subdev_log_status(struct v4l2_subdev *sd) +{ + v4l2_ctrl_handler_log_status(sd->ctrl_handler, sd->name); + return 0; +} +EXPORT_SYMBOL(v4l2_ctrl_subdev_log_status); + /* Call s_ctrl for all controls owned by the handler */ int v4l2_ctrl_handler_setup(struct v4l2_ctrl_handler *hdl) { diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h index 1e84946..f00d42b 100644 --- a/include/media/v4l2-ctrls.h +++ b/include/media/v4l2-ctrls.h @@ -659,4 +659,7 @@ int v4l2_subdev_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl); int v4l2_ctrl_subdev_subscribe_event(struct v4l2_subdev *sd, struct v4l2_fh *fh, struct v4l2_event_subscription *sub); +/* Log all controls owned by subdev's control handler. */ +int v4l2_ctrl_subdev_log_status(struct v4l2_subdev *sd); + #endif