Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp728430pxu; Thu, 3 Dec 2020 11:05:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJwVi4O6DTI2sBTfiB4HJhYUYAjH06qyP3Bbdv0TVRREHsSIXGahZXfS5O8vzRNE8QUEIiH0 X-Received: by 2002:a17:906:f905:: with SMTP id lc5mr3826561ejb.177.1607022305852; Thu, 03 Dec 2020 11:05:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607022305; cv=none; d=google.com; s=arc-20160816; b=hZni61o4RXxyxhFSEl8WlfRSA8m4+WYfnI8uqPKMc9zLarqHBiKI3f5N3FcsbbRBkM pXqZpt6eRVf+uQx5p33uIwKG05W5Pn4BRrotz/MXTljDuLlymaf9LepC1QJ4FomRq6an t/4b1ywuYGhc7ftn7EhKUiMb4yEgAHqZfldAWLGBPJZxGjOXzE6pgDFW26GdAJhKFxDf Cdzl2itDPnbWwCu+6jyjM1kj1arl/g3HQtOgtTumHJ9OuY5xoKuTM3uMuGWM/aNbaynr 68jAIO0cwO4oz2trgt5r/pwKAd2p2Cu+HKjox8oK6Ordl7sF6pMLdkq18ffEFbJjHszJ Ep1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:dkim-signature:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from; bh=N2+onGn+P/wtgXxXpkvV3u/wLb5I44E5LjNI+JkjEcA=; b=pgaH7JF9kMJF4kG4qnzdtoEBEHoaXqgXu4ci7KbTmK/VEUoZPGGsZAUwQq5GGS2LPC R/IIMCE8p6mhtGBHASHftkdkc88ooU/MWkiAN4IGCSRRAIvveYUhDXlfwZdKsVPFeoV3 zc9iFv0bcoa0YDiy+8bQ9NyZRQKMfcMdu64C+LfuHOvrrdWscMsFPDcfobLLzdOfMpkl sKoEgAd35o9iADaDGI5n5Pq/4tZ7KuEty+zLk9hWpbM+jJAZN002rbI0KgREUx5VXbpc LwgArzCVUcFgTdC99e0ZGeaV46Y40zfI+xEcKTUuiO462wLn1c5z5nRN5oJbuaU++m/S LMfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=P2srQbxk; 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=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q23si1842794edb.184.2020.12.03.11.04.41; Thu, 03 Dec 2020 11:05:05 -0800 (PST) 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=@nvidia.com header.s=n1 header.b=P2srQbxk; 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=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731801AbgLCTB3 (ORCPT + 99 others); Thu, 3 Dec 2020 14:01:29 -0500 Received: from hqnvemgate25.nvidia.com ([216.228.121.64]:18458 "EHLO hqnvemgate25.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731699AbgLCTB1 (ORCPT ); Thu, 3 Dec 2020 14:01:27 -0500 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Thu, 03 Dec 2020 11:00:16 -0800 Received: from HQMAIL109.nvidia.com (172.20.187.15) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 3 Dec 2020 19:00:11 +0000 Received: from skomatineni-linux.nvidia.com (172.20.13.39) by mail.nvidia.com (172.20.187.15) with Microsoft SMTP Server id 15.0.1473.3 via Frontend Transport; Thu, 3 Dec 2020 19:00:10 +0000 From: Sowjanya Komatineni To: , , , , , CC: , , , , , Subject: [PATCH v3 08/13] media: tegra-video: Add support for V4L2_EVENT_SOURCE_CHANGE Date: Thu, 3 Dec 2020 10:59:57 -0800 Message-ID: <1607022002-26575-9-git-send-email-skomatineni@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1607022002-26575-1-git-send-email-skomatineni@nvidia.com> References: <1607022002-26575-1-git-send-email-skomatineni@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1607022016; bh=N2+onGn+P/wtgXxXpkvV3u/wLb5I44E5LjNI+JkjEcA=; h=From:To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:X-NVConfidentiality:MIME-Version:Content-Type; b=P2srQbxkV+ko79JDl9AUr7NjObxkL3cn9YnU+qeq5bkpZhAtDZUNb1K+/C40OuZ5b uLmoV5peKXuMA3c02m7QlfUZZaNCxyxELeVw3rggAvasQJlZfUiQqlzSBmNsFLzqQm D3LeInr9mLvKXisZb/qxX0Nrd117bNS8xZw/k4NWHHFA9Eima5NHhjFVdIjvAZJ4so 5nNInJ84bVpBOAX+gVxrNblAAq3QATn/2soWX1LesEr4Vn9Cm5Mvuy1mQmsG+DuyY8 D3KGCYUFbiTcpSWqQkKsAn4uaPA7RYuJtKMBmjIyXr48RHfFGIYQ0JrjeFG3r3vIT2 8y94V4clYS1hg== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Current implementation uses v4l2_ctrl_subscribe_event() and this does not handle V4L2_EVENT_SOURCE_CHANGE. So, update driver to handle V4L2_EVENT_SOURCE_CHANGE. Signed-off-by: Sowjanya Komatineni --- drivers/staging/media/tegra-video/vi.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/staging/media/tegra-video/vi.c b/drivers/staging/media/tegra-video/vi.c index c280117..0a85e52 100644 --- a/drivers/staging/media/tegra-video/vi.c +++ b/drivers/staging/media/tegra-video/vi.c @@ -642,6 +642,18 @@ static int tegra_channel_set_subdev_active_fmt(struct tegra_vi_channel *chan) return 0; } +static int +tegra_channel_subscribe_event(struct v4l2_fh *fh, + const struct v4l2_event_subscription *sub) +{ + switch (sub->type) { + case V4L2_EVENT_SOURCE_CHANGE: + return v4l2_event_subscribe(fh, sub, 4, NULL); + } + + return v4l2_ctrl_subscribe_event(fh, sub); +} + static int tegra_channel_g_selection(struct file *file, void *priv, struct v4l2_selection *sel) { @@ -904,7 +916,7 @@ static const struct v4l2_ioctl_ops tegra_channel_ioctl_ops = { .vidioc_expbuf = vb2_ioctl_expbuf, .vidioc_streamon = vb2_ioctl_streamon, .vidioc_streamoff = vb2_ioctl_streamoff, - .vidioc_subscribe_event = v4l2_ctrl_subscribe_event, + .vidioc_subscribe_event = tegra_channel_subscribe_event, .vidioc_unsubscribe_event = v4l2_event_unsubscribe, .vidioc_g_selection = tegra_channel_g_selection, .vidioc_s_selection = tegra_channel_s_selection, -- 2.7.4