Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp654700pxu; Fri, 11 Dec 2020 10:57:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJyrl5X7/pvLM3gBOSi+Qx2e/BRaxyBBeA0yMEavu4Ioz86YVvioYPG5DZsF4PWh82lfHiB2 X-Received: by 2002:a50:e0c9:: with SMTP id j9mr13216669edl.380.1607713021668; Fri, 11 Dec 2020 10:57:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607713021; cv=none; d=google.com; s=arc-20160816; b=i20k6Shz0ulFvmCfadk4/TecVoYGDiXGN26W+4o6Iv87UBxq3IH6BXDHNs+4Elqz1x wsnHZnBgKJXaocwfnCaLT1+MsA1aOSx/08Ru2X85CpOJq4VQ2TKTzIsJb66zixIJEeOj Ve1JHr4dZ7cFmQBpnNrHQ5hq4eeBQgJp9ENgdtB8XOLl/2MzTlETgMf7uz9c9UCOY6wE 44JVWcttyTMBNmTfxhoeOcnijdntMNhdsdxJpnH2CnpSxAucGOadlFrQVaKakqNV8Gj3 veFYnGTPimTkz8lBlI/cYw9u3rT+/FV+vi8Edc0Z8OY2xQXQkJh5bJSq+3zGjGCNDdR2 wkxw== 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=Cl8o3ap6Y1iPs2C3LrAXV+VivzbqBqwqjO9iJtXQZxegqwspoHe6krxT6JSML2mt07 Ah+0aCaa7peANsO1A5davB43yx+0/PhCs5Rvw7dI7pRC4h54LbgIBYCSN6PVHv3ANCAC VB2h3l1mEPtpFh8wOOX04RC4VlIV08SPs5MtdwkfiO3O0FjBnJno0L/t9VzyJPNSjTFu aM/itbd750JVfZI9cWYuiPRXRwtJP+v8isJdQF0YIE56p7L8Ngc93jJfKlDDT1Csc4CZ 56jJhiVrnPiZeGvDhHpMaVN1i9kr+z4d+VFe1g9XhG44dUzMpsVnSoBxTKPyjKBClM73 jcow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=Mq44NvMg; 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 qk27si5065939ejb.615.2020.12.11.10.56.38; Fri, 11 Dec 2020 10:57:01 -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=Mq44NvMg; 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 S2394268AbgLKRFZ (ORCPT + 99 others); Fri, 11 Dec 2020 12:05:25 -0500 Received: from hqnvemgate26.nvidia.com ([216.228.121.65]:5363 "EHLO hqnvemgate26.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393715AbgLKREM (ORCPT ); Fri, 11 Dec 2020 12:04:12 -0500 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Fri, 11 Dec 2020 09:02:53 -0800 Received: from HQMAIL109.nvidia.com (172.20.187.15) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 11 Dec 2020 17:02:52 +0000 Received: from skomatineni-linux.nvidia.com (172.20.145.6) by mail.nvidia.com (172.20.187.15) with Microsoft SMTP Server id 15.0.1473.3 via Frontend Transport; Fri, 11 Dec 2020 17:02:52 +0000 From: Sowjanya Komatineni To: , , , , , CC: , , , , Subject: [PATCH v4 08/13] media: tegra-video: Add support for V4L2_EVENT_SOURCE_CHANGE Date: Fri, 11 Dec 2020 09:02:37 -0800 Message-ID: <1607706162-1548-9-git-send-email-skomatineni@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1607706162-1548-1-git-send-email-skomatineni@nvidia.com> References: <1607706162-1548-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=1607706173; 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=Mq44NvMg21Pb6RMSTqJsz9FqOizTVvJsJAVTCDmlZ7ZYjjwVDvoXd3/Pa0yrm/Vj5 l76AmgKNh5/oacQx7ZudrlYUNKSBqYpL/PrZ8OSylMA+NtEE+g+d+BsxP5h9XUPKkh Dv0Xo1d51aIUc6f/WSnWv7pDhPLq2bBvN9c89GRBBL4G6WGSz+ZkZuIggRFUwHuIWB Fj3LarbKObTa1B/F9D5Yjfr0BKqV76GxvJtOv8QJTI+a3DPNoYiphfUHxRpTMX4jj6 sj/HrtySQhkFWDa7HBFIPeeKBbQdj8UqyEmyUFOOXRuBwrEbTSsWYWMvSJ6T+yQ/50 ZbhHN5XEb2dxw== 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