Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1137679pxb; Fri, 1 Oct 2021 04:28:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzvYBs2/2dAocrgjS4n+ZsXbGJQFRlr31xyeEBQNbsGBPjlSEsl/tFkYqZd3/SQ0Sy63UEy X-Received: by 2002:aa7:9a51:0:b0:43d:f0b0:532a with SMTP id x17-20020aa79a51000000b0043df0b0532amr9576589pfj.76.1633087689145; Fri, 01 Oct 2021 04:28:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633087689; cv=none; d=google.com; s=arc-20160816; b=oEjOO9rNPl/OHCDj5jVjZYgo8ioKIwOK5bl4nSobZ4DfrSwa2r37QlzjXgeDvTl6Bp aGTXoigeBaUpHAvlbIPltUksinu0UI4FQ9M/+/xKqEWKXdt8fVyKQH6V0h0MuVlCpbBW wWMWlj+5Q6ZJ5avUf2FSvBsTc2bZ2Gh1gRgPwHR4I3teJwoJLQrorYXgTCP7/DfGBME6 nabAuGKmNe/VR5aHEcmEsnXPO5sTMQeyhLyVEcRoxwVklZI8WeLwjTZbYP4yK9RM50Ss A8g8qto34Pr85OchQRKA4d+rLsqpbUJZX6QjX2+xL8KbGExsMrhFMYZ7jdadqpN2J2dp 7dIQ== 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=tmEJ9vFpZDT8h8HObohmRstQUsecSrrPbxIcYXjIt14=; b=mCyE6mYd49VWMdCHWN5ZSZa2jbbik8977Gp3+1oqxkle1+8/9nmNVYVczbPGkpyz8X x9WRmnDdabMDgLhGYK3kAj3O1Uum6x/4QcZdxS5l8RPENI8/UpKJ1M8+hgd6euP5RJxB W5hYUINAn+pay/ZtVDQfk9OxlMmFjIwgrxT/Mk4g297dSWXciYeZKk8SqgWQWSqF3sGn ZJMFZs3BSKlgr/R/MFqqiOpC+C+Ysdo644Xnj/+45taobpXJn1crhZqY01yGTGTfX9jd uJPfXWi91k0AnyTLa+33ZwYZvEsrs5f6MvjVu4supJmenXXGMWt4+IcPESeIKRQpavTM foJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=mlg6xJ+z; 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 y21si4941678pjp.172.2021.10.01.04.27.54; Fri, 01 Oct 2021 04:28:09 -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=mlg6xJ+z; 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 S1353909AbhJAL1f (ORCPT + 99 others); Fri, 1 Oct 2021 07:27:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353831AbhJAL1N (ORCPT ); Fri, 1 Oct 2021 07:27:13 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 333FCC06177E for ; Fri, 1 Oct 2021 04:25:29 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id k7so14825121wrd.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=tmEJ9vFpZDT8h8HObohmRstQUsecSrrPbxIcYXjIt14=; b=mlg6xJ+z/3D7g/FEIfOjSYDGmoYGEGbs98RXwl4s5paFKGPmigUvG/2nYEGgD9thTj I2tDZ1k2GTp9CLR1RqsUqrxzo/cqp8PeYQpAffEBC3gRdS6Lczgb4epuL/xwZ074SiEN OT3eTRdSrHMpGtSvUhsgQtm8TJwCPtipKqBgc= 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=tmEJ9vFpZDT8h8HObohmRstQUsecSrrPbxIcYXjIt14=; b=5CPKWTljRuK7y5pVR3UH2qI9o4iaBDnLxxV1zAAk7k+eVPnD3JJRLtVS/0CDrRi8Sw 5lYdqYG7kAPdkCrB3OajpitvcSUrOpp1N2GcEA4BQoGXDYwPU31TwLRwjRdzP9tC8bbN 0Uv/A5xcyFzMGgAwZJtiNj1158dl4TfEdrCKBhVaTvAqmAkuZuxMR582laeZLIvMjR/i 6gcbb/hnL/tYodQ9hb7JZ6udzwiIni9mKXcdYHTqudQp2SzrwzCu4sFbJorTTYwWgZ4+ bP6XJVfwm4LYbFKrxF4Hh7qdRH7H6nVw4/VoHT1j+2Wxv4q/lRbaJ76xaDihDpiOZwU+ HjDg== X-Gm-Message-State: AOAM5306VKDyJM3DH7Muk7GwyM1QrFCvbJTeyVeMlOGkuWOvVPAUnX3y xd43FHNKnI5VzphdzSZ5qi+G7Q== X-Received: by 2002:a5d:6b03:: with SMTP id v3mr11779105wrw.226.1633087527757; Fri, 01 Oct 2021 04:25:27 -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 6/8] media: dw9714: Add implementation for events Date: Fri, 1 Oct 2021 11:25:20 +0000 Message-Id: <20211001112522.2839602-7-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/dw9714.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/dw9714.c b/drivers/media/i2c/dw9714.c index c8b4292512dca..3863dfeb82934 100644 --- a/drivers/media/i2c/dw9714.c +++ b/drivers/media/i2c/dw9714.c @@ -7,6 +7,7 @@ #include #include #include +#include #define DW9714_NAME "dw9714" #define DW9714_MAX_FOCUS_POS 1023 @@ -100,7 +101,15 @@ static const struct v4l2_subdev_internal_ops dw9714_int_ops = { .close = dw9714_close, }; -static const struct v4l2_subdev_ops dw9714_ops = { }; +static const struct v4l2_subdev_core_ops dw9714_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_ops dw9714_ops = { + .core = &dw9714_core_ops, +}; static void dw9714_subdev_cleanup(struct dw9714_device *dw9714_dev) { @@ -137,7 +146,8 @@ static int dw9714_probe(struct i2c_client *client) return -ENOMEM; v4l2_i2c_subdev_init(&dw9714_dev->sd, client, &dw9714_ops); - dw9714_dev->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; + dw9714_dev->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | + V4L2_SUBDEV_FL_HAS_EVENTS; dw9714_dev->sd.internal_ops = &dw9714_int_ops; rval = dw9714_init_controls(dw9714_dev); -- 2.33.0.800.g4c38ced690-goog