Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1138625pxb; Fri, 1 Oct 2021 04:29:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwX/dpuMuXuW5f6KotliB9lNjHDmdPNkIv5aW7QH2RbqUrUdyaZ1FIUXkZrRJG5poVTLDTE X-Received: by 2002:a63:7c4e:: with SMTP id l14mr9200762pgn.389.1633087768925; Fri, 01 Oct 2021 04:29:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633087768; cv=none; d=google.com; s=arc-20160816; b=MQtHcyjlJxCXFgCYNt459WungxOmDydC4oM3rJa6/z2n/gpprlsSrwaeM2Al7DIUBq R2ofYHfSXtBiPgutz1t63RWhrfEhL1kJBVCO9K6Y0Xw9+dcBgMhC1Jq/N3uIj8D/RVDk VruBghBtHcSOPMAgUzRy9o3xW0P38XFIaVZawvg2CVSh+1IgS9NuiXCgbsUIwlxUCP3G ZfXnmRyEn31U6p/oKs8tQOtikeEmNjRWLjS1OzWT9PncOBbtQn3dVm8xakX4ONK5OEZT r44V76GexT/n7oNRaEeqw7zGYfYXw5x58T9MqbPkRi2S1wjiGu/Jw5teFn6KwV8WC60F +5Vw== 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=i8Q4M1c6rtKlhDbTm4SP6AjT7wFHFdr0/UPMGdfiE9w=; b=BouuCNdGBY8FTGY0sYMR32xTRKCE/dRswkxmbLxL3jmBki+4L5xRvBQtyy0OEenvBb 5e/D2ZqTOmbIeZbn+5RmXjKpebX4iMVyDjZkUwMxSvQ9kMHq+6zWGQJX7ofXO8uc0k2x bv+7gJhN+j/lr0Y3Bbki60e45hjZGuxoLZraRWBKNKRsjcYCm2W18dfQ5REqV//YvdZr aqaIAuK0QN7QDWeTgORA7ErkROV0HR+qDHig01rwqUW/EdADNbcwA96ZW1WMwN9yztWb bYwy5tfdEf0gCbG/igbhORXac3PK0s6PHRXcDdLp81rTiW6zxlVtE4VMf+1RyApG3FQY Yvmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=D2YDnOLt; 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 v7si6510590pjk.36.2021.10.01.04.29.15; Fri, 01 Oct 2021 04:29:28 -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=D2YDnOLt; 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 S1353879AbhJAL1h (ORCPT + 99 others); Fri, 1 Oct 2021 07:27:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353841AbhJAL1N (ORCPT ); Fri, 1 Oct 2021 07:27:13 -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 8F4F7C061775 for ; Fri, 1 Oct 2021 04:25:29 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id k7so14825143wrd.13 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=i8Q4M1c6rtKlhDbTm4SP6AjT7wFHFdr0/UPMGdfiE9w=; b=D2YDnOLtNk2sn6VS7rFCjyaNCgy2tZd0WKvieR9SNTn228NJwgZVu5tJ/2r9meGAGw sprXQYIL62HmzK3SSHku5v7Pj/HA7AkrlbRCVn9KixbSeB4uyBMq+hJj2SUeBwaTVq67 igSEVtTps+63s9KN8gbW7M8B41v2zZZIApFiI= 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=i8Q4M1c6rtKlhDbTm4SP6AjT7wFHFdr0/UPMGdfiE9w=; b=6/q+uIPdmm8EI5XjZZj5vPW6e+XRcv8p7nN+vBFz+Y5f0WiuN+Qb5WzYF0HqvxmLV8 qPn1b36vJ7FIxzsx1x8QnIJszoNbhVfSknd73IdDbJ1soeq2ftQHKitwPOslH5eX2AHf KoCann5GB2xlyf23v1OFKl8ia9bEnsid7XSJwY/98xmvoB76KiQGzVcMcdHO2sgcAynN TR38azQiOPxQkr5Xun+q8dvOJCNNY+8mXGORngbQ6alEDbfu5V9ttZPI4RDL9S8iU7OM CLQnLw8/ioLsc+jhN7ZpBwaiWdQWdGrAy5bGHYMKHwTwrmO+40+FhBTuFtltThFPXZV4 8L/g== X-Gm-Message-State: AOAM5301X7UdMgbdKrVmS0wigyReHvSN5Xf8znqxy07x8GrZ3Uzka7MJ oWT4TZ7pNII8zPP/pfu3ewzP2w== X-Received: by 2002:a5d:54c5:: with SMTP id x5mr11563653wrv.47.1633087528200; 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.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Oct 2021 04:25:27 -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 7/8] media: ov13858: Add implementation for events Date: Fri, 1 Oct 2021 11:25:21 +0000 Message-Id: <20211001112522.2839602-8-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/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.800.g4c38ced690-goog