Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1438918pxu; Sat, 12 Dec 2020 12:54:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJwuXbF0TPGOMDdJYP+2ADnY8x7Zxmn+AE7Hke7U0SUt61b7H4eu48cnBwNLiddrXTZHGoRh X-Received: by 2002:a17:907:3e17:: with SMTP id hp23mr16307548ejc.545.1607806440588; Sat, 12 Dec 2020 12:54:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607806440; cv=none; d=google.com; s=arc-20160816; b=zPkgluqbUn9SJ+TA8+MJwaB48zVoToPWvu3zz8VZRIJ7GHD7qG9LOCcLU/dMqzvMvJ H5+1gkYJiTn3AmNxO21cyRTVs9M0EE2G8vizCke+If/6PM01f4MmVv7+MKqH0iZPL5Jh Eer9Wsp7wpDAEp3JEJVKI0BjNlw3XHReaw7dPDQrUmhUY4HJeotDmxu9KjAK9CQIpF+q wXNPG0ex31cb1o0Vw90OVu/BhyA3EhM7SH5956l9yQ8oUnU8TUKpy+iLQFyS8mIp4D2u bY1BUhNIkQSztT2ikTCyvY/sOvfTkiUnKAqlaXIt96Sq2TflVyqyQZw/TXhWgbHNfHxP R9Zw== 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=pNpN3f/SRR0mn9c/AvbESRBJwpfQPmb/g2WTapIp4ew=; b=J1kqGGrdlfnJlfmu3nGJNR3kF/JzDi+/jkEutiJIWrdmDq15SuI9gdmSX1ROe9IJi7 BA+qBMlqgoArrcaCPRfSaPT+hsoZGzYgc3Obdg1k9oH9SqUlAZAY/r5gMmUHGEbWs+7d bH0caY6FkXumXIhH08kJJiNOKAoUY6lDazc7FS+/H6QvMivQMiHlXQF0ijQmUlRhkWn0 Av1Orl3Slc/sTN1F6hhgi2Z3Ld5Kblbz99wUbvBBSa/tLhDBhyx7SrNytwgX4drdj4wN 3+y1IxBOGrrUFMtplBmn4VEn5jNcFStaTSQQq03159shKLQZcXIeehhGltaLwQKu4M2r IgYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b="C/25hCP0"; 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 cz27si6881423edb.371.2020.12.12.12.53.23; Sat, 12 Dec 2020 12:54:00 -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="C/25hCP0"; 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 S2405221AbgLKREQ (ORCPT + 99 others); Fri, 11 Dec 2020 12:04:16 -0500 Received: from hqnvemgate24.nvidia.com ([216.228.121.143]:2300 "EHLO hqnvemgate24.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389604AbgLKRDc (ORCPT ); Fri, 11 Dec 2020 12:03:32 -0500 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Fri, 11 Dec 2020 09:02:51 -0800 Received: from HQMAIL109.nvidia.com (172.20.187.15) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 11 Dec 2020 17:02:51 +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:51 +0000 From: Sowjanya Komatineni To: , , , , , CC: , , , , Subject: [PATCH v4 06/13] media: tegra-video: Add support for EDID ioctl ops Date: Fri, 11 Dec 2020 09:02:35 -0800 Message-ID: <1607706162-1548-7-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=1607706171; bh=pNpN3f/SRR0mn9c/AvbESRBJwpfQPmb/g2WTapIp4ew=; h=From:To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:X-NVConfidentiality:MIME-Version:Content-Type; b=C/25hCP0iakGGv2ak5U5xIIOSip/HEH0GGEIVrifMVEzZ0amik9wRdrXTpzVquzyZ ywtzrvOJBhhCyxvv8qRiTWLMq6dayThMYWga4E7AozN1VBEIVDYGqb865MTWDQ4Mwp vt1Czl/ZbDaPcuOhdudG908lEPtPYoB8zLuuCD6NpKIoIeNNv+VF3V1UKVfBKvrDol 1412fb2zNAm7G0qwLUQ8LOaEMNwmOXUCKLvwcDGYGu3J7ytdKXl39f9cGYTI1iBAKu hR7UTUEJsOsPfrUDTyR/hL3jrhblMbh5kxnm3V0H9t1nmcJv291RNt1xAkUVie0J4s yPj8kK0qxsHoQ== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch adds support for EDID get and set v4l2 ioctl ops to use with HDMI to CSI bridges. Signed-off-by: Sowjanya Komatineni --- drivers/staging/media/tegra-video/vi.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/drivers/staging/media/tegra-video/vi.c b/drivers/staging/media/tegra-video/vi.c index d01e88d..bc38136 100644 --- a/drivers/staging/media/tegra-video/vi.c +++ b/drivers/staging/media/tegra-video/vi.c @@ -721,6 +721,32 @@ static int tegra_channel_s_selection(struct file *file, void *fh, return ret; } +static int tegra_channel_g_edid(struct file *file, void *fh, + struct v4l2_edid *edid) +{ + struct tegra_vi_channel *chan = video_drvdata(file); + struct v4l2_subdev *subdev; + + subdev = tegra_channel_get_remote_source_subdev(chan); + if (!v4l2_subdev_has_op(subdev, pad, get_edid)) + return -ENOTTY; + + return v4l2_subdev_call(subdev, pad, get_edid, edid); +} + +static int tegra_channel_s_edid(struct file *file, void *fh, + struct v4l2_edid *edid) +{ + struct tegra_vi_channel *chan = video_drvdata(file); + struct v4l2_subdev *subdev; + + subdev = tegra_channel_get_remote_source_subdev(chan); + if (!v4l2_subdev_has_op(subdev, pad, set_edid)) + return -ENOTTY; + + return v4l2_subdev_call(subdev, pad, set_edid, edid); +} + static int tegra_channel_g_dv_timings(struct file *file, void *fh, struct v4l2_dv_timings *timings) { @@ -873,6 +899,8 @@ static const struct v4l2_ioctl_ops tegra_channel_ioctl_ops = { .vidioc_unsubscribe_event = v4l2_event_unsubscribe, .vidioc_g_selection = tegra_channel_g_selection, .vidioc_s_selection = tegra_channel_s_selection, + .vidioc_g_edid = tegra_channel_g_edid, + .vidioc_s_edid = tegra_channel_s_edid, .vidioc_g_dv_timings = tegra_channel_g_dv_timings, .vidioc_s_dv_timings = tegra_channel_s_dv_timings, .vidioc_query_dv_timings = tegra_channel_query_dv_timings, -- 2.7.4