From patchwork Mon Apr 13 20:23:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 210217 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 97A5DC2BBFD for ; Mon, 13 Apr 2020 20:26:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 83B1420732 for ; Mon, 13 Apr 2020 20:26:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388379AbgDMU0R (ORCPT ); Mon, 13 Apr 2020 16:26:17 -0400 Received: from vsp-unauthed02.binero.net ([195.74.38.227]:21119 "EHLO vsp-unauthed02.binero.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388362AbgDMU0L (ORCPT ); Mon, 13 Apr 2020 16:26:11 -0400 X-Halon-ID: fb810091-7dc4-11ea-aeed-005056917f90 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (p4fca2392.dip0.t-ipconnect.de [79.202.35.146]) by bin-vsp-out-02.atm.binero.net (Halon) with ESMTPA id fb810091-7dc4-11ea-aeed-005056917f90; Mon, 13 Apr 2020 22:25:58 +0200 (CEST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: Helen Koike , Hans Verkuil , Sakari Ailus , Laurent Pinchart , linux-media@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, =?utf-8?q?Niklas_S=C3=B6derlund?= Subject: [PATCH v7 6/6] vimc: Make use of V4L2_CAP_IO_MC Date: Mon, 13 Apr 2020 22:23:51 +0200 Message-Id: <20200413202351.1359754-7-niklas.soderlund+renesas@ragnatech.se> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200413202351.1359754-1-niklas.soderlund+renesas@ragnatech.se> References: <20200413202351.1359754-1-niklas.soderlund+renesas@ragnatech.se> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Set the V4L2_CAP_IO_MC capability flag to report this vimc inputs/outputs are controlled by the media graph. Signed-off-by: Niklas Söderlund Signed-off-by: Laurent Pinchart Acked-by: Sakari Ailus --- Changes since v5: - Wrap line longer than 80 characters - Implement mbus_code filtering for format enumeration --- drivers/media/platform/vimc/vimc-capture.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/vimc/vimc-capture.c b/drivers/media/platform/vimc/vimc-capture.c index 747ea9cc1bd7cb12..dbc827fd1b9baebb 100644 --- a/drivers/media/platform/vimc/vimc-capture.c +++ b/drivers/media/platform/vimc/vimc-capture.c @@ -149,7 +149,12 @@ static int vimc_cap_s_fmt_vid_cap(struct file *file, void *priv, static int vimc_cap_enum_fmt_vid_cap(struct file *file, void *priv, struct v4l2_fmtdesc *f) { - const struct vimc_pix_map *vpix = vimc_pix_map_by_index(f->index); + const struct vimc_pix_map *vpix; + + if (f->mbus_code) + vpix = vimc_pix_map_by_code(f->mbus_code); + else + vpix = vimc_pix_map_by_index(f->index); if (!vpix) return -EINVAL; @@ -450,7 +455,8 @@ struct vimc_ent_device *vimc_cap_add(struct vimc_device *vimc, /* Initialize the video_device struct */ vdev = &vcap->vdev; - vdev->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING; + vdev->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING + | V4L2_CAP_IO_MC; vdev->entity.ops = &vimc_cap_mops; vdev->release = video_device_release_empty; vdev->fops = &vimc_cap_fops;