Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp13999pxb; Tue, 28 Sep 2021 14:13:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJK8p4OLRWReRL7se+QE/eDZPJG5ZPWs/uv2vEfuKEZmdE2ZnOjrELc5wgCp+gK80z75q8 X-Received: by 2002:a50:f615:: with SMTP id c21mr5327982edn.134.1632863638126; Tue, 28 Sep 2021 14:13:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632863638; cv=none; d=google.com; s=arc-20160816; b=mvAIwXp12peVvdNzoojAemC30RcCR+99pVylQPYX/jwc/EJYWCVRRVraB6BzVBi9kd iF/HuuJmjT7H2D9dsX25n7T6pBw28FEwJzZ94GtknxsJzJMBKSoAz3CjYOhVPOYA9DCO oS84WsaF5wZRzyRAAQh5DhekQfZkqCeUp6vKF8cuqG4umGUQkwe/H81lM4erxi/vju9/ bA68CQ64lmG63Y1aGzxHzwke3RvbRqxG9LZYL40eQt0ZR9j9gaG0p8pXiZwcrH/HR6bH VvlklV1Lj0fVMGD4OvmoC8EnAL5DmO280rgOD3+cQZGTcC2+tzqaWOlor1wJngKpZKyQ 4Ueg== 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=Cpcqu0FkNTnMhJYqoU4g7szXMeK3djvSORY3n20CFi0=; b=Q2zMgDredc2NrnfiE+nYm0HbbTsJzai53AsP2y/geUGVgRJcuL3KmEG66Q1za05A+S 7cAtc5CLRebGmqQodbd4K0JGnChQVr/l8DjMFXYg3/ngzq8E6mBx07G62qGMLGbXuIJw QD/d1CCSldcNcYk7zWMuCmNWIaafKLktRlNhAr5LJr36BhPzTz71ayqpG1ON3q07dc2z fpEvN/4tyvMFbmuyOU8zICfvgV4FnqQGFmF3MpWGmB0e5YKermco7KAcLXS9o1qikP6G tGoe5KWgyxU2tJbb4oR286z5ZPZWNKwWXb5leyg9w7+MJZyDAbgElksI1JrnUtWHSLEo Sqlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=HePQXKj1; 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 ha9si91482ejb.329.2021.09.28.14.13.34; Tue, 28 Sep 2021 14:13:58 -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=HePQXKj1; 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 S242916AbhI1VM1 (ORCPT + 99 others); Tue, 28 Sep 2021 17:12:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242872AbhI1VMU (ORCPT ); Tue, 28 Sep 2021 17:12:20 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FA39C06161C for ; Tue, 28 Sep 2021 14:10:40 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id d26so627127wrb.6 for ; Tue, 28 Sep 2021 14:10:40 -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=Cpcqu0FkNTnMhJYqoU4g7szXMeK3djvSORY3n20CFi0=; b=HePQXKj1+2kXp82Ph9zNesBpPyBovgyVZJMe7rB1go/cq4Bp9NCDAYJPsNSYy0O8VQ P5lO+Zddns/7Qnqq4BnjAlQXbUW9MgFtrgiOef88uZPqqafLaCROIauPwnYC9ZosGRrH cWgYXoSJHhPF6u6EeLHj0DegyYhB863/Zx/F8= 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=Cpcqu0FkNTnMhJYqoU4g7szXMeK3djvSORY3n20CFi0=; b=3VsDa5vfaKzh0pfRxGbCrqPPU5GvR4V2ahtlQzKQrmHzYylJY7g+ccrB3vWE9meMdD lSHZ/bwldPvDjhpS29DxV+xFXLFqFIT/jdBJGJTvgaCjMYMxbvrgJf5/LCr9OOGdqbRg bHZZxB11hZW5CXMhWGkMRemPGW7Vs006p5s/mGwHUvRCamWKpZCqqUH6nyCppydrKQ8K 6zu4+LlJdCUX3C5G4l2a89vOhUiE3ci+8Qqj4nvmi20vHlzzRZLY3hShcwU/YR0GSP3U N+IMCBgrcWIWgRiHyUJbWF7Jiqho8ipMhUbHpSRvn4i1zuP3JsbHt4eEkUEb690jNwy7 kgBw== X-Gm-Message-State: AOAM532rFSvpqXy2IMekKNF4tK5sQ0eH+FsXEy+vlUZQQkcL3NHjO66j LSh/7gYRXqneyX3y4y/Qay2HaA== X-Received: by 2002:a05:6000:1569:: with SMTP id 9mr2624681wrz.337.1632863438884; Tue, 28 Sep 2021 14:10:38 -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 n68sm3885773wmn.13.2021.09.28.14.10.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Sep 2021 14:10:38 -0700 (PDT) From: Ricardo Ribalda To: Sakari Ailus , Mauro Carvalho Chehab , Yong Zhi , Bingbu Cao , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Chiranjeevi Rapolu Cc: Ricardo Ribalda Subject: [PATCH 6/7] media: ov13858: Add implementation for events Date: Tue, 28 Sep 2021 21:10:32 +0000 Message-Id: <20210928211033.2415162-7-ribalda@chromium.org> X-Mailer: git-send-email 2.33.0.685.g46640cef36-goog In-Reply-To: <20210928211033.2415162-1-ribalda@chromium.org> References: <20210928211033.2415162-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/ov13858.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/ov13858.c b/drivers/media/i2c/ov13858.c index 7fc70af53e45d..b4d22f5d99337 100644 --- a/drivers/media/i2c/ov13858.c +++ b/drivers/media/i2c/ov13858.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #define OV13858_REG_VALUE_08BIT 1 @@ -1553,6 +1554,12 @@ static int ov13858_identify_module(struct ov13858 *ov13858) return 0; } +static const struct v4l2_subdev_core_ops ov13858_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 ov13858_video_ops = { .s_stream = ov13858_set_stream, }; @@ -1569,6 +1576,7 @@ static const struct v4l2_subdev_sensor_ops ov13858_sensor_ops = { }; static const struct v4l2_subdev_ops ov13858_subdev_ops = { + .core = &ov13858_core_ops, .video = &ov13858_video_ops, .pad = &ov13858_pad_ops, .sensor = &ov13858_sensor_ops, @@ -1724,7 +1732,8 @@ static int ov13858_probe(struct i2c_client *client, /* Initialize subdev */ ov13858->sd.internal_ops = &ov13858_internal_ops; - ov13858->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; + ov13858->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | + V4L2_SUBDEV_FL_HAS_EVENTS; ov13858->sd.entity.ops = &ov13858_subdev_entity_ops; ov13858->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR; -- 2.33.0.685.g46640cef36-goog