Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp782271pxb; Wed, 6 Oct 2021 15:29:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5O9fqcVTgR1CdO9vRyHHgITRlv4KO++12tQ/3p8vD/oosmEb+pCcIeDzJYWEBuVwBB/+G X-Received: by 2002:a17:907:97d2:: with SMTP id js18mr1021469ejc.191.1633559367110; Wed, 06 Oct 2021 15:29:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633559367; cv=none; d=google.com; s=arc-20160816; b=YwgkjUMG03f/kqfrEJzALbQDS+5pEDrNbEtAdD9EcuWvt7gymiu/Ifdx/BNpcyPe6q jvug/i1rl7Sl7cDF2wQcXDzPDJSdItLNRCrSVxd2sbFH+DvV5LZs7bIzJ+F+dhoE5d+G AYLA3IQ+KENrbqAnTpe+MUptVrFH4Tqk0+VkKbhs6BP2T1MgG/QklOMcdEONiICbftOg NV2gcx3FcF8E00KnpRBScO6T7d4sQWoTz/UBQnCyh8ar6ERlB/pHr0DLsfyzBXNdpE/E DKPBmu8EenWPt0YiA+GqVu08Ey1DN4rQQ8sS68acF58JylLdreeFZ/E1ijXNr1OS/aIJ gPZQ== 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=y+waaZuGQbx9FXfWaK7Bagt4ZcjH2y3LRocwRra4Vv4=; b=aYQV0MMl9X0lmz4ji1JDLJ6F+i+pN/M/iY9nUeP1SgXsr8+C4JC94yLm5RdWFYYwSW ElwU5Q+tEj+YnFvzMaAdAnNB7bF4thj1E7g8GjIGs+AH6HdWhLcfJ5kY0ZCdIqyY+8at Idg8fKZulVrHl1NaJ49sXIMhTmf8e/iL9IDfzTCUZM9JJqwcTKdUTasa83fXdho2xkU3 B3vVoAroGXgocSidAxx78SStbUEcniV1oRh/FFx8hv7cLrg44Dlo9AqUyVKjH0Kqd8CV NzRL72va9l9qRIKHpUFibHFwhOycasillzkMZqJmg3NDtrkmJAfLDEAyOvijWq03tTHo e1rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=hg3j9pCO; 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 n6si4147604edx.182.2021.10.06.15.29.04; Wed, 06 Oct 2021 15:29:27 -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=hg3j9pCO; 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 S239892AbhJFW2i (ORCPT + 99 others); Wed, 6 Oct 2021 18:28:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239820AbhJFW20 (ORCPT ); Wed, 6 Oct 2021 18:28:26 -0400 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4135CC061760 for ; Wed, 6 Oct 2021 15:26:33 -0700 (PDT) Received: by mail-ed1-x52e.google.com with SMTP id g10so15014016edj.1 for ; Wed, 06 Oct 2021 15:26:33 -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=y+waaZuGQbx9FXfWaK7Bagt4ZcjH2y3LRocwRra4Vv4=; b=hg3j9pCO9yP3IjAJojTHtkeAEkY9LeJ/wXM5CwVpBSynXiA+dR+6st3AVoOe/n2tgQ wRHZZQAzG/FcIcG0MRN6ECWgl4EWgf1QnQy/Zc3M7LjhHE5rP0fjTl2RtPO9thfdAmW3 1BdsSNIzzPkik+2Qzvr7WWrRL9wZLiUQFw/QQ= 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=y+waaZuGQbx9FXfWaK7Bagt4ZcjH2y3LRocwRra4Vv4=; b=wdn2OSp5/tiHT8DtOPK9Z/jyqAD8rP39JyhQpSBgMXffPlwGPvfhhjkP+m17L4HVlt jmpDtn1HAyCip328Gt8pGKGqoI9xU6wQW1Qqgf2SHHp57wgWG2+gG1eSwkRngix/x4Xb VssVvXpBb0Kcv1VhbMSfwCx3Bc6dy8NK/f3hYdyYO6mvfA1WeoJUt5QLLy3Tpwoki8KX D124gMXlwgkYV1QhARGtwIHU4n/yR9jAb9Ix3sp9POIhZwg1v7MJcpmxJtXDtL4SVeJ+ YjSdNG4jGSR574rqHa/QsJAzunuSlGs6LEBsMX7rCXPD6XHVjPAdMGyyAPVBS/XZGciw yy1Q== X-Gm-Message-State: AOAM531se0GuAyop4QC5dflq1I2/ZwHpeJPyqpwDp9VP8Zqr391blgr1 wdZJ6TmHz3xaZGlH9iMijU9y4w== X-Received: by 2002:a50:da0a:: with SMTP id z10mr1159591edj.298.1633559191858; Wed, 06 Oct 2021 15:26:31 -0700 (PDT) Received: from alco.lan (80.71.134.83.ipv4.parknet.dk. [80.71.134.83]) by smtp.gmail.com with ESMTPSA id h7sm10557906edt.37.2021.10.06.15.26.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Oct 2021 15:26:31 -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 v4 8/8] media: ov5670: Add implementation for events Date: Thu, 7 Oct 2021 00:26:25 +0200 Message-Id: <20211006222625.401122-9-ribalda@chromium.org> X-Mailer: git-send-email 2.33.0.800.g4c38ced690-goog In-Reply-To: <20211006222625.401122-1-ribalda@chromium.org> References: <20211006222625.401122-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 49189926afd6..251f459ab484 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