From patchwork Mon Nov 12 16:00:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 10678913 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A5B8F139B for ; Mon, 12 Nov 2018 16:01:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 94D9D2A1FF for ; Mon, 12 Nov 2018 16:01:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 88A392A172; Mon, 12 Nov 2018 16:01:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 089D82A172 for ; Mon, 12 Nov 2018 16:01:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729713AbeKMBzW (ORCPT ); Mon, 12 Nov 2018 20:55:22 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:35808 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729601AbeKMBzV (ORCPT ); Mon, 12 Nov 2018 20:55:21 -0500 Received: by mail-pf1-f194.google.com with SMTP id v9-v6so4533008pff.2 for ; Mon, 12 Nov 2018 08:01:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rxDW/XXTbCDqN0DWr9EV/j7/K88xHbdaLdWaL3Nwlrg=; b=lLNHXcVTioFHumvefOFYOpN2QYNzW/rYcU/PoZOzHFQpm8ya09FosY7cowH+U3w4JJ TeWB4wBYAQ7wJ5mhdqrxS4sXIR5Ch69wTos1fXk0ML0qEp8jaVcV/9o3QcXxz/H2T+25 NXUiOx2Ks0DRZNKDrGknn0KGiqRztSyshY2zJFgECK3C18HXapWv5cG96xUdOa2Sz4JH C0d1FesqdBb/IkSZ5Ad3jGruQsYXVfcQcp+aLTr8O89vGh3miAsB83RcVnQfw/IVQN/+ ZlfQM8kf/9TjoacYuQ2yFhspunu6plNg9XNi+B8NtOTl10qIC99YSr3Bv4xYl9xZFEqI kAZQ== 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; bh=rxDW/XXTbCDqN0DWr9EV/j7/K88xHbdaLdWaL3Nwlrg=; b=RK6+zG2qZEzbFuSt2wk5Mo/UbRWPVBKu8kj3rflnCeNCM+W1dJtM48sIASOvyxVOV9 0xZiJfaUoh/1XnuKesNeBvSCNShlvxZ4yBRrLOidjjAZfd2pLcc1sQKM1W4lcqeUoDWp 7wsxlN1oBCKoy8X0U3rH4ZFZyG9E0+U+Lk7sm8zSy5W5WXFD3CCfxa2ac8Ic0EbEpwlE DUQQ4Z0oEn9e1yAELCNbkgvYfmv8yTUkI04Z1VGPbFWQQrgFJVp7WTHP2BkMVCCfDars /u7qn5+TvdagxuZuARA9klYnqV7wzkIVZw37nCh8eq7DYvOT+g5MtlEPftqI7XrF/RWf p5vA== X-Gm-Message-State: AGRZ1gIrTM3ytlT6ntdJDmVAnLLOBFXHJgQtatK1Qfq7pgRj0TDPVIIy EidQbjVmzMzt9yMKi7KZIh/kkpKn X-Google-Smtp-Source: AJdET5dvCmGFLyc31RVE4hMMo30rC0LOeY0ANwu2fxUjzoAKSmCQHFUP7d7UtPBVIubnrHaVodrMRg== X-Received: by 2002:a63:a41:: with SMTP id z1mr1288808pgk.117.1542038489831; Mon, 12 Nov 2018 08:01:29 -0800 (PST) Received: from mita-MS-7A45.lan ([240f:34:212d:1:4c9:76a6:795e:e9ef]) by smtp.gmail.com with ESMTPSA id v74-v6sm26777610pfk.12.2018.11.12.08.01.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Nov 2018 08:01:29 -0800 (PST) From: Akinobu Mita To: linux-media@vger.kernel.org Cc: Akinobu Mita , Jacopo Mondi , Sakari Ailus , Mauro Carvalho Chehab Subject: [PATCH 7/7] media: ov772x: support log_status ioctl and event interface Date: Tue, 13 Nov 2018 01:00:54 +0900 Message-Id: <1542038454-20066-8-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542038454-20066-1-git-send-email-akinobu.mita@gmail.com> References: <1542038454-20066-1-git-send-email-akinobu.mita@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This adds log_status ioctl and event interface for ov772x's v4l2 controls. Cc: Jacopo Mondi Cc: Sakari Ailus Cc: Mauro Carvalho Chehab Signed-off-by: Akinobu Mita --- drivers/media/i2c/ov772x.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/ov772x.c b/drivers/media/i2c/ov772x.c index fefff7f..2e9a758 100644 --- a/drivers/media/i2c/ov772x.c +++ b/drivers/media/i2c/ov772x.c @@ -30,6 +30,7 @@ #include #include +#include #include #include @@ -1287,6 +1288,9 @@ static const struct v4l2_ctrl_ops ov772x_ctrl_ops = { }; static const struct v4l2_subdev_core_ops ov772x_subdev_core_ops = { + .log_status = v4l2_ctrl_subdev_log_status, + .subscribe_event = v4l2_ctrl_subdev_subscribe_event, + .unsubscribe_event = v4l2_event_subdev_unsubscribe, #ifdef CONFIG_VIDEO_ADV_DEBUG .g_register = ov772x_g_register, .s_register = ov772x_s_register, @@ -1379,7 +1383,8 @@ static int ov772x_probe(struct i2c_client *client, mutex_init(&priv->lock); v4l2_i2c_subdev_init(&priv->subdev, client, &ov772x_subdev_ops); - priv->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; + priv->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | + V4L2_SUBDEV_FL_HAS_EVENTS; v4l2_ctrl_handler_init(&priv->hdl, 3); /* Use our mutex for the controls */ priv->hdl.lock = &priv->lock;