Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1138480pxb; Fri, 1 Oct 2021 04:29:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVGiQHLaqcZ3gSvt2mWhlbf2mqCNM3vCnJ4BJDPfAhYX6KPWJqDAGs7slN2NIVnl5mlqeu X-Received: by 2002:a17:906:49d5:: with SMTP id w21mr5643978ejv.30.1633087756660; Fri, 01 Oct 2021 04:29:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633087756; cv=none; d=google.com; s=arc-20160816; b=DWYbU+AmWbiwmKmfquhZeJTZ1tizYGG/ut6fP15/TglPtjXMYHa6R61widE+Uk5Ri5 GRtsoMn5HK+EgDx0b+CCrIH4m8m0hXyWXZuJQhe9YBrwPZN7d2XCUE3Oc06bEBzvDT72 l6qj8d1b9Tqnjx+/xa3dniSqURumh3nIK8UgtCtxdmO6pmvQarncHi5spTWgqvKDtjGg X+wf/dZ2D7ew8uT40wgEIvWWwmVh3rTwSSQdLwxL18hKSvz1rDWTOgukzp/JixbBIKOh 7bS9x91m5Rc8Jytkn5nSMOgbocB2GkXgEqeYgNHUXpnmwlcd1IZxmi7G/vKN2T9mBMEv qapw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=VNaI9C5/qcGt+6XKfL8dD53jkaX+jHT8gS0DI0vOhMk=; b=sHKdLphLWYOL3iO834pdNO434DCzcpAYAWBzhdr+WPvvcfTO63lYP0x7qhlRWzAarS ba4ys9AUXwZegtChGsfvVfbaT6BkQMczwkNc3t/l+H/MAW4f08ebx8pTiwelzA5aJzRX Ay8cgcgZjcOU5K48RHv9Rdc60a9khgP5t+XGeTSxekovJ/mWW2p1K6DKJ2jTCu7XAKqM nCybxw3wGI5+1vZU17gcUtjEgmIWOBF1g3wdHpZT0rpL+Wz/GQRWI+XKDhBbVpr+p4Zn VVHKUQnDrMSbXy2dxQ+rA+hMaQ+Xb6txpbqBRmwuy/sGH4M+/QLP4GAjb8T049xhu2Cd GVVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=fZ3cK5y8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y12si6592026edv.43.2021.10.01.04.28.50; Fri, 01 Oct 2021 04:29:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=fZ3cK5y8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353904AbhJAL1j (ORCPT + 99 others); Fri, 1 Oct 2021 07:27:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353853AbhJAL1O (ORCPT ); Fri, 1 Oct 2021 07:27:14 -0400 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1F07C06177C for ; Fri, 1 Oct 2021 04:25:29 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id r11-20020a1c440b000000b0030cf0f01fbaso3404690wma.1 for ; Fri, 01 Oct 2021 04:25:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VNaI9C5/qcGt+6XKfL8dD53jkaX+jHT8gS0DI0vOhMk=; b=fZ3cK5y8CtUA2QTCkJD4v42HS0fhzRpRuUiw0yPW50W42q6IZ558y2xg/OaJfu8Sz1 5YXvROMkosDpzW4GE+Vrv6Sx7gb5Wr+0lpi005IfCHj0DRAJKyM6uB78ueSFgDJURdBb seSsEUjULHw4S+mQC66XvlKURIisXxBQQ6Gig= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VNaI9C5/qcGt+6XKfL8dD53jkaX+jHT8gS0DI0vOhMk=; b=eeQrfAkZGzs2JDnUhnxDvd/TzFcAHUqfxzGQxMAP6oN7/oF8w7454miWmKW6nzz7hu UgGD4Bg48WWGI8RC4xI3l2heNc6/sbxJt6hGoe+bjo5ZPYKtWd9zP1w7vFryKVWKY81l 6gY2aU/LgJiXMNj+/+0zVW/Q9LWEu7PqSjW4YrmDV65Tt+Y8a97ANFM8m5f9SAF1zbhs +0+LuEYOIxy9NruDMw4aEAiSAIkn1+kG2KkxJ61NXq+eJjeUcktU76soUdCR2u4dN9XM rW/cruYlcRg/hgXBvl+LskcgQZSweIkKWoyMZn6kl+Ts9pWMehyBO1OeJx1AR4MicbVB mTEg== X-Gm-Message-State: AOAM531bVxACqHtDlXptcMKAXXcC3lTCUAxYZe9oJu7cJnUJIzND9uy4 FhW/Iy8myTteEQ9CpT7/04972g== X-Received: by 2002:a05:600c:4ed3:: with SMTP id g19mr3815631wmq.195.1633087528626; Fri, 01 Oct 2021 04:25:28 -0700 (PDT) Received: from beni.c.googlers.com.com (216.131.76.34.bc.googleusercontent.com. [34.76.131.216]) by smtp.gmail.com with ESMTPSA id x17sm5530958wrc.51.2021.10.01.04.25.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Oct 2021 04:25:28 -0700 (PDT) From: Ricardo Ribalda To: Mauro Carvalho Chehab , Yong Zhi , Bingbu Cao , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Chiranjeevi Rapolu , Sakari Ailus Cc: Ricardo Ribalda Subject: [PATCH v3 8/8] media: ov5670: Add implementation for events Date: Fri, 1 Oct 2021 11:25:22 +0000 Message-Id: <20211001112522.2839602-9-ribalda@chromium.org> X-Mailer: git-send-email 2.33.0.800.g4c38ced690-goog In-Reply-To: <20211001112522.2839602-1-ribalda@chromium.org> References: <20211001112522.2839602-1-ribalda@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use v4l2 control API helpers to support the events. Fixes v4l2-compliance: test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: FAIL Signed-off-by: Ricardo Ribalda --- drivers/media/i2c/ov5670.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/ov5670.c b/drivers/media/i2c/ov5670.c index 49189926afd67..251f459ab484a 100644 --- a/drivers/media/i2c/ov5670.c +++ b/drivers/media/i2c/ov5670.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #define OV5670_REG_CHIP_ID 0x300a @@ -2420,6 +2421,12 @@ static int ov5670_identify_module(struct ov5670 *ov5670) return 0; } +static const struct v4l2_subdev_core_ops ov5670_core_ops = { + .log_status = v4l2_ctrl_subdev_log_status, + .subscribe_event = v4l2_ctrl_subdev_subscribe_event, + .unsubscribe_event = v4l2_event_subdev_unsubscribe, +}; + static const struct v4l2_subdev_video_ops ov5670_video_ops = { .s_stream = ov5670_set_stream, }; @@ -2436,6 +2443,7 @@ static const struct v4l2_subdev_sensor_ops ov5670_sensor_ops = { }; static const struct v4l2_subdev_ops ov5670_subdev_ops = { + .core = &ov5670_core_ops, .video = &ov5670_video_ops, .pad = &ov5670_pad_ops, .sensor = &ov5670_sensor_ops, @@ -2489,7 +2497,8 @@ static int ov5670_probe(struct i2c_client *client) } ov5670->sd.internal_ops = &ov5670_internal_ops; - ov5670->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; + ov5670->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | + V4L2_SUBDEV_FL_HAS_EVENTS; ov5670->sd.entity.ops = &ov5670_subdev_entity_ops; ov5670->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR; -- 2.33.0.800.g4c38ced690-goog