From patchwork Wed Mar 9 11:41:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 12774971 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41731C433EF for ; Wed, 9 Mar 2022 11:42:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232420AbiCILm7 (ORCPT ); Wed, 9 Mar 2022 06:42:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232401AbiCILmz (ORCPT ); Wed, 9 Mar 2022 06:42:55 -0500 Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F020116BCD8; Wed, 9 Mar 2022 03:41:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1646826116; x=1678362116; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=iQV1eFvLFnbtYXiohQguMMYHg/6BrzAOmBAwDo+NsSQ=; b=ArFHL16yBP4M1vnEUKkpQmON/61WQzLeuKAiReh0Xnhmz4HblI6l36TC BRwBeFvyGtxzhES2TiWzT972JXn6Elk0ZtMKxvV9OZgG4S9yznnruFrww 67D1VPCBM0xZWicBkL8AXqlXWY4q9QX5h4RiYD6Q75HWUKo0LWLdkfMP0 PugZUXV3z3ICSy1pko7a64bKWpVl17FdTrgX+pSYtcrpbd8PbVhPSUHWg rYwmRFkATrD6wc2/ZegFIKa2oR9G7Tx5X8wucFYbMblRqb74WkcHJdl0z gJ132UgeKzUWopiHrWmV7uc+0gih7hSVkIsE/8a8IBeD8FQe9cgUArv6w Q==; X-IronPort-AV: E=Sophos;i="5.90,167,1643670000"; d="scan'208";a="22553360" Received: from unknown (HELO tq-pgp-pr1.tq-net.de) ([192.168.6.15]) by mx1-pgp.tq-group.com with ESMTP; 09 Mar 2022 12:41:53 +0100 Received: from mx1.tq-group.com ([192.168.6.7]) by tq-pgp-pr1.tq-net.de (PGP Universal service); Wed, 09 Mar 2022 12:41:53 +0100 X-PGP-Universal: processed; by tq-pgp-pr1.tq-net.de on Wed, 09 Mar 2022 12:41:53 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1646826113; x=1678362113; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=iQV1eFvLFnbtYXiohQguMMYHg/6BrzAOmBAwDo+NsSQ=; b=A/7CwhzKtDJcGQApxKWf8citvm50Yn1t5luGVtK1LnGFEsHdnPbjSDRZ 8bln4Y+86QzKZloVo0n/rRwgmGICnIhMVzhDpVgnEwirilazQfQyhqWYL X8mg0WYZ+0uqpxa8EucfykF8UZH2oJ3Uo1EwmXeFsmlu8eagTx7qfHVyh h31pLHeZslcRuTdHuMLrNUSxyiylq+f5V6+geOsi/qtxRfnNep+BLEk9J UbtKfLpGJ7F4jGIwT/Ow68L7Trt3JKK9I0yggAEnpvxXdUdJ/BVtKMez/ J7uCwM6Gfuw9xTIYJJfz/fX3ylsZ9EaZ2I3g5y5KEQcpDRK4DOUQ09m5s w==; X-IronPort-AV: E=Sophos;i="5.90,167,1643670000"; d="scan'208";a="22553359" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 09 Mar 2022 12:41:53 +0100 Received: from steina-w.tq-net.de (unknown [10.123.49.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by vtuxmail01.tq-net.de (Postfix) with ESMTPSA id 35C16280075; Wed, 9 Mar 2022 12:41:53 +0100 (CET) From: Alexander Stein To: Steve Longerbeam , Philipp Zabel , Mauro Carvalho Chehab , Greg Kroah-Hartman , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Rui Miguel Silva , Laurent Pinchart , Dorota Czaplejewicz Cc: linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Alexander Stein Subject: [PATCH v3 1/8] media: imx: Store the type of hardware implementation Date: Wed, 9 Mar 2022 12:41:37 +0100 Message-Id: <20220309114144.120643-2-alexander.stein@ew.tq-group.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220309114144.120643-1-alexander.stein@ew.tq-group.com> References: <20220309114144.120643-1-alexander.stein@ew.tq-group.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Dorota Czaplejewicz The driver covers i.MX5/6, as well as i.MX7/8 hardware. Those implementations differ, e.g. in the sizes of buffers they accept. Some functionality should be abstracted, and storing type achieves that. Note: This is a temporary solution until the imx7-media-csi driver gets decoupled from the helpers shared with the i.MX6 implementation, and should be reverted once this happens. Signed-off-by: Dorota Czaplejewicz Signed-off-by: Alexander Stein Reviewed-by: Laurent Pinchart --- Changes in v3: * Added note this change shall be reverted later on * Add R-b Laurent Pinchart drivers/staging/media/imx/imx-ic-prpencvf.c | 3 ++- drivers/staging/media/imx/imx-media-capture.c | 5 ++++- drivers/staging/media/imx/imx-media-csi.c | 3 ++- drivers/staging/media/imx/imx-media.h | 8 +++++++- drivers/staging/media/imx/imx7-media-csi.c | 3 ++- 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/drivers/staging/media/imx/imx-ic-prpencvf.c b/drivers/staging/media/imx/imx-ic-prpencvf.c index 9b81cfbcd777..671bb9a681aa 100644 --- a/drivers/staging/media/imx/imx-ic-prpencvf.c +++ b/drivers/staging/media/imx/imx-ic-prpencvf.c @@ -1266,7 +1266,8 @@ static int prp_registered(struct v4l2_subdev *sd) priv->vdev = imx_media_capture_device_init(ic_priv->ipu_dev, &ic_priv->sd, - PRPENCVF_SRC_PAD, true); + PRPENCVF_SRC_PAD, true, + DEVICE_TYPE_IMX56); if (IS_ERR(priv->vdev)) return PTR_ERR(priv->vdev); diff --git a/drivers/staging/media/imx/imx-media-capture.c b/drivers/staging/media/imx/imx-media-capture.c index 93ba09236010..65dc95a48ecc 100644 --- a/drivers/staging/media/imx/imx-media-capture.c +++ b/drivers/staging/media/imx/imx-media-capture.c @@ -34,6 +34,7 @@ struct capture_priv { struct imx_media_video_dev vdev; /* Video device */ struct media_pad vdev_pad; /* Video device pad */ + enum imx_media_device_type type; /* Type of hardware implementation */ struct v4l2_subdev *src_sd; /* Source subdev */ int src_sd_pad; /* Source subdev pad */ @@ -957,7 +958,8 @@ EXPORT_SYMBOL_GPL(imx_media_capture_device_unregister); struct imx_media_video_dev * imx_media_capture_device_init(struct device *dev, struct v4l2_subdev *src_sd, - int pad, bool legacy_api) + int pad, bool legacy_api, + enum imx_media_device_type type) { struct capture_priv *priv; struct video_device *vfd; @@ -972,6 +974,7 @@ imx_media_capture_device_init(struct device *dev, struct v4l2_subdev *src_sd, priv->src_sd_pad = pad; priv->dev = dev; priv->legacy_api = legacy_api; + priv->type = type; mutex_init(&priv->mutex); INIT_LIST_HEAD(&priv->ready_q); diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c index b2b1f4dd41d7..0f8943475fa8 100644 --- a/drivers/staging/media/imx/imx-media-csi.c +++ b/drivers/staging/media/imx/imx-media-csi.c @@ -1804,7 +1804,8 @@ static int csi_registered(struct v4l2_subdev *sd) } priv->vdev = imx_media_capture_device_init(priv->sd.dev, &priv->sd, - CSI_SRC_PAD_IDMAC, true); + CSI_SRC_PAD_IDMAC, true, + DEVICE_TYPE_IMX56); if (IS_ERR(priv->vdev)) { ret = PTR_ERR(priv->vdev); goto free_fim; diff --git a/drivers/staging/media/imx/imx-media.h b/drivers/staging/media/imx/imx-media.h index f263fc3adbb9..e4c22b3ccd57 100644 --- a/drivers/staging/media/imx/imx-media.h +++ b/drivers/staging/media/imx/imx-media.h @@ -96,6 +96,11 @@ enum imx_pixfmt_sel { PIXFMT_SEL_ANY = PIXFMT_SEL_YUV | PIXFMT_SEL_RGB | PIXFMT_SEL_BAYER, }; +enum imx_media_device_type { + DEVICE_TYPE_IMX56, + DEVICE_TYPE_IMX78, +}; + struct imx_media_buffer { struct vb2_v4l2_buffer vbuf; /* v4l buffer must be first */ struct list_head list; @@ -282,7 +287,8 @@ int imx_media_ic_unregister(struct v4l2_subdev *sd); /* imx-media-capture.c */ struct imx_media_video_dev * imx_media_capture_device_init(struct device *dev, struct v4l2_subdev *src_sd, - int pad, bool legacy_api); + int pad, bool legacy_api, + enum imx_media_device_type type); void imx_media_capture_device_remove(struct imx_media_video_dev *vdev); int imx_media_capture_device_register(struct imx_media_video_dev *vdev, u32 link_flags); diff --git a/drivers/staging/media/imx/imx7-media-csi.c b/drivers/staging/media/imx/imx7-media-csi.c index 8467a1491048..cf74960dee84 100644 --- a/drivers/staging/media/imx/imx7-media-csi.c +++ b/drivers/staging/media/imx/imx7-media-csi.c @@ -1063,7 +1063,8 @@ static int imx7_csi_registered(struct v4l2_subdev *sd) } csi->vdev = imx_media_capture_device_init(csi->sd.dev, &csi->sd, - IMX7_CSI_PAD_SRC, false); + IMX7_CSI_PAD_SRC, false, + DEVICE_TYPE_IMX78); if (IS_ERR(csi->vdev)) return PTR_ERR(csi->vdev); From patchwork Wed Mar 9 11:41:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 12774970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD468C433FE for ; Wed, 9 Mar 2022 11:42:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232360AbiCILm6 (ORCPT ); Wed, 9 Mar 2022 06:42:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232418AbiCILm4 (ORCPT ); Wed, 9 Mar 2022 06:42:56 -0500 Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D394F16BCE0; Wed, 9 Mar 2022 03:41:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1646826117; x=1678362117; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3KJ+O3nYPIihhIJRWVWC0Ti5XvYqw22h8GOfUjQMO6g=; b=RqYeDzGPLAkgSxyfgbrupWLPhlyUmPj2DJtsNaHbyNwSACxHKPlpZpur 82pnpEtCadvk7HaccQS8lRwyG4Qq/b95ILSIJX1NpOxet+E3Z77QK0lYy LxKZgpwegyvfVnV8oDcttm+PkOg0Jp6AwOKMqjgwnNK74d56hvpD9FmB/ BiofGWmhBWU1WN2A/46BTdI8kifYY79/lbnq+kDM0pnAjXIpQ+S0R9Okg jztP58q26MqdVTo1O243U6KE4Uep2vjOUtgdGEzajrkwLCHW911mpsPke Jhk/mDvAyxFS51DGuStwg5gAUbkpJ/In6oJwO66udrHMFrLJXM37AZL2D Q==; X-IronPort-AV: E=Sophos;i="5.90,167,1643670000"; d="scan'208";a="22553362" Received: from unknown (HELO tq-pgp-pr1.tq-net.de) ([192.168.6.15]) by mx1-pgp.tq-group.com with ESMTP; 09 Mar 2022 12:41:53 +0100 Received: from mx1.tq-group.com ([192.168.6.7]) by tq-pgp-pr1.tq-net.de (PGP Universal service); Wed, 09 Mar 2022 12:41:54 +0100 X-PGP-Universal: processed; by tq-pgp-pr1.tq-net.de on Wed, 09 Mar 2022 12:41:54 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1646826114; x=1678362114; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3KJ+O3nYPIihhIJRWVWC0Ti5XvYqw22h8GOfUjQMO6g=; b=MoV0fOnBB/Pbka/c+R3xkAE3pMxhNflkz11Zhv8Vpkxl9MJR96oGmH9f aBI+m2SKAE/Fdsnw16bDxgpVU6pdFtHUUZzPGpuwjb3rBDv4GhwBzyqFF JE0rllsbm88mhnCj1Webz6gISDUtGnnsKtvifpl/ZUDqzQsR1FKtoAtyW 4fc+dtfchXurYZXCKYdVFIgWGv8gGeYy/o0aBvOKXdGudOSYd+K/CU5fl 8GLpttv5K0ILhPbPpaurbusSrSUQwWAnTwNt//Gm+StZpv8uWhMcyWryN +Ff4hLWwXqRILwlpK/DDXbOY4X11ARpsCDONx5dD0LcSJ2KYlsT5c2yIe Q==; X-IronPort-AV: E=Sophos;i="5.90,167,1643670000"; d="scan'208";a="22553361" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 09 Mar 2022 12:41:53 +0100 Received: from steina-w.tq-net.de (unknown [10.123.49.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by vtuxmail01.tq-net.de (Postfix) with ESMTPSA id 88D4E280065; Wed, 9 Mar 2022 12:41:53 +0100 (CET) From: Alexander Stein To: Steve Longerbeam , Philipp Zabel , Mauro Carvalho Chehab , Greg Kroah-Hartman , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Rui Miguel Silva , Laurent Pinchart , Dorota Czaplejewicz Cc: linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Alexander Stein Subject: [PATCH v3 2/8] media: imx: Forward type of hardware implementation Date: Wed, 9 Mar 2022 12:41:38 +0100 Message-Id: <20220309114144.120643-3-alexander.stein@ew.tq-group.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220309114144.120643-1-alexander.stein@ew.tq-group.com> References: <20220309114144.120643-1-alexander.stein@ew.tq-group.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Dorota Czaplejewicz Pass down the hardware type so imx_media_mbus_fmt_to_pix_fmt can do the actual switch. Signed-off-by: Dorota Czaplejewicz Reviewed-by: Laurent Pinchart Signed-off-by: Alexander Stein --- Changes in v3: * None drivers/staging/media/imx/imx-media-capture.c | 15 +++++++++------ drivers/staging/media/imx/imx-media-utils.c | 3 ++- drivers/staging/media/imx/imx-media.h | 3 ++- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/staging/media/imx/imx-media-capture.c b/drivers/staging/media/imx/imx-media-capture.c index 65dc95a48ecc..7a6384b3e5e6 100644 --- a/drivers/staging/media/imx/imx-media-capture.c +++ b/drivers/staging/media/imx/imx-media-capture.c @@ -139,7 +139,8 @@ static int capture_g_fmt_vid_cap(struct file *file, void *fh, } static const struct imx_media_pixfmt * -__capture_try_fmt(struct v4l2_pix_format *pixfmt, struct v4l2_rect *compose) +__capture_try_fmt(struct v4l2_pix_format *pixfmt, struct v4l2_rect *compose, + enum imx_media_device_type type) { struct v4l2_mbus_framefmt fmt_src; const struct imx_media_pixfmt *cc; @@ -171,7 +172,7 @@ __capture_try_fmt(struct v4l2_pix_format *pixfmt, struct v4l2_rect *compose) } v4l2_fill_mbus_format(&fmt_src, pixfmt, 0); - imx_media_mbus_fmt_to_pix_fmt(pixfmt, &fmt_src, cc); + imx_media_mbus_fmt_to_pix_fmt(pixfmt, &fmt_src, cc, type); if (compose) { compose->width = fmt_src.width; @@ -184,7 +185,9 @@ __capture_try_fmt(struct v4l2_pix_format *pixfmt, struct v4l2_rect *compose) static int capture_try_fmt_vid_cap(struct file *file, void *fh, struct v4l2_format *f) { - __capture_try_fmt(&f->fmt.pix, NULL); + struct capture_priv *priv = video_drvdata(file); + + __capture_try_fmt(&f->fmt.pix, NULL, priv->type); return 0; } @@ -199,7 +202,7 @@ static int capture_s_fmt_vid_cap(struct file *file, void *fh, return -EBUSY; } - cc = __capture_try_fmt(&f->fmt.pix, &priv->vdev.compose); + cc = __capture_try_fmt(&f->fmt.pix, &priv->vdev.compose, priv->type); priv->vdev.cc = cc; priv->vdev.fmt = f->fmt.pix; @@ -418,7 +421,7 @@ __capture_legacy_try_fmt(struct capture_priv *priv, } } - imx_media_mbus_fmt_to_pix_fmt(pixfmt, &fmt_src->format, cc); + imx_media_mbus_fmt_to_pix_fmt(pixfmt, &fmt_src->format, cc, priv->type); return cc; } @@ -889,7 +892,7 @@ static int capture_init_format(struct capture_priv *priv) fmt_src.format.height = IMX_MEDIA_DEF_PIX_HEIGHT; } - imx_media_mbus_fmt_to_pix_fmt(&vdev->fmt, &fmt_src.format, NULL); + imx_media_mbus_fmt_to_pix_fmt(&vdev->fmt, &fmt_src.format, NULL, priv->type); vdev->compose.width = fmt_src.format.width; vdev->compose.height = fmt_src.format.height; diff --git a/drivers/staging/media/imx/imx-media-utils.c b/drivers/staging/media/imx/imx-media-utils.c index 94bc866ca28c..c42f3da8e3a8 100644 --- a/drivers/staging/media/imx/imx-media-utils.c +++ b/drivers/staging/media/imx/imx-media-utils.c @@ -518,7 +518,8 @@ EXPORT_SYMBOL_GPL(imx_media_try_colorimetry); int imx_media_mbus_fmt_to_pix_fmt(struct v4l2_pix_format *pix, const struct v4l2_mbus_framefmt *mbus, - const struct imx_media_pixfmt *cc) + const struct imx_media_pixfmt *cc, + enum imx_media_device_type type) { u32 width; u32 stride; diff --git a/drivers/staging/media/imx/imx-media.h b/drivers/staging/media/imx/imx-media.h index e4c22b3ccd57..f59feccb26bf 100644 --- a/drivers/staging/media/imx/imx-media.h +++ b/drivers/staging/media/imx/imx-media.h @@ -203,7 +203,8 @@ void imx_media_try_colorimetry(struct v4l2_mbus_framefmt *tryfmt, bool ic_route); int imx_media_mbus_fmt_to_pix_fmt(struct v4l2_pix_format *pix, const struct v4l2_mbus_framefmt *mbus, - const struct imx_media_pixfmt *cc); + const struct imx_media_pixfmt *cc, + enum imx_media_device_type type); void imx_media_grp_id_to_sd_name(char *sd_name, int sz, u32 grp_id, int ipu_id); struct v4l2_subdev * From patchwork Wed Mar 9 11:41:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 12774973 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC4D9C433EF for ; Wed, 9 Mar 2022 11:42:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232438AbiCILnD (ORCPT ); Wed, 9 Mar 2022 06:43:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232419AbiCILm4 (ORCPT ); Wed, 9 Mar 2022 06:42:56 -0500 Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42A1816BCDD; Wed, 9 Mar 2022 03:41:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1646826117; x=1678362117; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ph86NPcPjwy0dX+EuR++GKI6JItrpTnVEStlCLpR8Qc=; b=FP0TFKrnrc85UOSZ9DcKu6ZoEE5nyQrT4xXlVkXz+TEWDAf4MitkXHim bF68pQlFpcyC1EjcV8duEPcLjBHg28URP5ipPM6jBfY+TiSv6bg8BJI77 7x3poM7YCFEzKaiQjYXu5UPZCdBLCR5O9N9DO/OXWqeOCbU5JJSPIowjs HrGh3FlQuzePNdrmVzGSs3NFnPhEIQTDwyY7lEnFErALUO2H18W2DJ8V2 +2tAqKWIt8T1WRHdR3sX7et3KSiFieN+czJsdvxtT0uNvvtKnyBPJ04/9 7G3QHaBuzRtrwSsETTOWfXBQEB6M71DYvtB1YTP9HNbuEbu5wzVVJZb06 Q==; X-IronPort-AV: E=Sophos;i="5.90,167,1643670000"; d="scan'208";a="22553364" Received: from unknown (HELO tq-pgp-pr1.tq-net.de) ([192.168.6.15]) by mx1-pgp.tq-group.com with ESMTP; 09 Mar 2022 12:41:54 +0100 Received: from mx1.tq-group.com ([192.168.6.7]) by tq-pgp-pr1.tq-net.de (PGP Universal service); Wed, 09 Mar 2022 12:41:54 +0100 X-PGP-Universal: processed; by tq-pgp-pr1.tq-net.de on Wed, 09 Mar 2022 12:41:54 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1646826114; x=1678362114; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ph86NPcPjwy0dX+EuR++GKI6JItrpTnVEStlCLpR8Qc=; b=Y+TveUuPEwAHyiHEqma0068gJcoyzzm3LeFBPQ+atB4Tl1msJBzEm7Lz VNXIfUj4RyNf8g9Zp8WZLBAWMlKEgqBYeTtDix5KpZeaLEHgKLqDVkA1X dFmgBx+oRMvzSrCBLEkIrSGvzRpY+vX+TJeK1mYPAULkcdra5DfxBJXyb L2aciMI6iHLWdZrSDQj72yxE2egz3Ib8TAZS+EQIeMR1XrxPrbvj9VYy+ BK2Nj/+1GFYyecoLHv52SHY+3r1u+XWoYRVyjFlTtUTL72oh+Rfy6bmwq hBfZYAmwnRd3vedZKxT7N7i3nFLru6nqGCCjbdWZO4z33eEqF8KynkeTg Q==; X-IronPort-AV: E=Sophos;i="5.90,167,1643670000"; d="scan'208";a="22553363" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 09 Mar 2022 12:41:54 +0100 Received: from steina-w.tq-net.de (unknown [10.123.49.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by vtuxmail01.tq-net.de (Postfix) with ESMTPSA id D13A7280075; Wed, 9 Mar 2022 12:41:53 +0100 (CET) From: Alexander Stein To: Steve Longerbeam , Philipp Zabel , Mauro Carvalho Chehab , Greg Kroah-Hartman , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Rui Miguel Silva , Laurent Pinchart , Dorota Czaplejewicz Cc: linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Alexander Stein Subject: [PATCH v3 3/8] media: imx: Use dedicated format handler for i.MX7/8 Date: Wed, 9 Mar 2022 12:41:39 +0100 Message-Id: <20220309114144.120643-4-alexander.stein@ew.tq-group.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220309114144.120643-1-alexander.stein@ew.tq-group.com> References: <20220309114144.120643-1-alexander.stein@ew.tq-group.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Dorota Czaplejewicz This splits out a format handler which takes into account the capabilities of the i.MX7/8 video device, as opposed to the default handler compatible with both i.MX5/6 and i.MX7/8. Signed-off-by: Dorota Czaplejewicz Signed-off-by: Alexander Stein --- Changes in v3: * Fixed bbp check (This driver uses bits per pixel, not bytes per pixel) drivers/staging/media/imx/imx-media-utils.c | 60 +++++++++++++++++++-- 1 file changed, 56 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/imx/imx-media-utils.c b/drivers/staging/media/imx/imx-media-utils.c index c42f3da8e3a8..0534f7746cb3 100644 --- a/drivers/staging/media/imx/imx-media-utils.c +++ b/drivers/staging/media/imx/imx-media-utils.c @@ -516,10 +516,9 @@ void imx_media_try_colorimetry(struct v4l2_mbus_framefmt *tryfmt, } EXPORT_SYMBOL_GPL(imx_media_try_colorimetry); -int imx_media_mbus_fmt_to_pix_fmt(struct v4l2_pix_format *pix, - const struct v4l2_mbus_framefmt *mbus, - const struct imx_media_pixfmt *cc, - enum imx_media_device_type type) +static int imx56_media_mbus_fmt_to_pix_fmt(struct v4l2_pix_format *pix, + const struct v4l2_mbus_framefmt *mbus, + const struct imx_media_pixfmt *cc) { u32 width; u32 stride; @@ -568,6 +567,59 @@ int imx_media_mbus_fmt_to_pix_fmt(struct v4l2_pix_format *pix, return 0; } + +static int imx78_media_mbus_fmt_to_pix_fmt(struct v4l2_pix_format *pix, + const struct v4l2_mbus_framefmt *mbus, + const struct imx_media_pixfmt *cc) +{ + u32 aligned_width; + int ret; + + if (!cc) + cc = imx_media_find_mbus_format(mbus->code, PIXFMT_SEL_ANY); + + if (!cc) + return -EINVAL; + /* + * The hardware can handle line lengths divisible by 4 pixels + * as long as the whole buffer size ends up divisible by 8 bytes. + * If not, use the value of 8 pixels recommended in the datasheet. + * Only 8bits-per-pixel formats may need to get aligned to 8 pixels, + * because both 10-bit and 16-bit pixels occupy 2 bytes. + * In those, 4-pixel aligmnent is equal to 8-byte alignment. + */ + if (cc->bpp == 8) + aligned_width = round_up(mbus->width, 8); + else + aligned_width = round_up(mbus->width, 4); + + ret = v4l2_fill_pixfmt(pix, cc->fourcc, + aligned_width, mbus->height); + if (ret) + return ret; + + pix->colorspace = mbus->colorspace; + pix->xfer_func = mbus->xfer_func; + pix->ycbcr_enc = mbus->ycbcr_enc; + pix->quantization = mbus->quantization; + pix->field = mbus->field; + + return ret; +} + +int imx_media_mbus_fmt_to_pix_fmt(struct v4l2_pix_format *pix, + const struct v4l2_mbus_framefmt *mbus, + const struct imx_media_pixfmt *cc, + enum imx_media_device_type type) +{ + switch (type) { + case DEVICE_TYPE_IMX56: + return imx56_media_mbus_fmt_to_pix_fmt(pix, mbus, cc); + case DEVICE_TYPE_IMX78: + return imx78_media_mbus_fmt_to_pix_fmt(pix, mbus, cc); + } + return -EINVAL; +} EXPORT_SYMBOL_GPL(imx_media_mbus_fmt_to_pix_fmt); void imx_media_free_dma_buf(struct device *dev, From patchwork Wed Mar 9 11:41:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 12774969 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55241C433EF for ; Wed, 9 Mar 2022 11:42:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232402AbiCILm5 (ORCPT ); Wed, 9 Mar 2022 06:42:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232429AbiCILm4 (ORCPT ); Wed, 9 Mar 2022 06:42:56 -0500 Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE7B016BCE3; Wed, 9 Mar 2022 03:41:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1646826118; x=1678362118; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=W7ZlPSFo+FHjKYpXGX7Y0kh08F+NDUeJwlxNFhiBxYg=; b=nYjXJZOpjkAehrCl44VZ+E4T7rAq3WFsjVzx45fVGXhSK4Mf5EJsrm20 dJPYin4+HFnYvezOpxYIh3b3nT3UZ6SxNSnQKS53eU/skeqD7juMhyw/T mufPgQ+AXjRSi9wf96faYq/ruJXPnvevjlFgZzQ8zULgTfRHXCsl74wxf lmQHK/GiURnqFj7Pd2J52YGpgGBg6dIN1TppXte842JU9fjaCQSANB7Nn 1ek32qIa1h1Or4cgAdjtgPy+dlAitu79bcO+ip/soirY0ew9lxPrX7bkU YTxkxLRqbZKInA/VwF1wF543CqnASUU0PutUi4MF8RYLDB/3TKwXdaLzO w==; X-IronPort-AV: E=Sophos;i="5.90,167,1643670000"; d="scan'208";a="22553366" Received: from unknown (HELO tq-pgp-pr1.tq-net.de) ([192.168.6.15]) by mx1-pgp.tq-group.com with ESMTP; 09 Mar 2022 12:41:54 +0100 Received: from mx1.tq-group.com ([192.168.6.7]) by tq-pgp-pr1.tq-net.de (PGP Universal service); Wed, 09 Mar 2022 12:41:54 +0100 X-PGP-Universal: processed; by tq-pgp-pr1.tq-net.de on Wed, 09 Mar 2022 12:41:54 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1646826114; x=1678362114; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=W7ZlPSFo+FHjKYpXGX7Y0kh08F+NDUeJwlxNFhiBxYg=; b=TXMtn1w+93cbVArP26iR/6Rr1XuyI0vb4B3lQZ685fIL5jeyx1lsjyW6 FS8z6TF7NVWVMb7zyJdxdvo9DlhQ8YjRaazu/Vs3rzZuld2hn4tDwLMEf bwAqNBNwhQxqzg2TCKX+T1yhhIEXUycJHHw8VqCAooXiE877mfh9mazsb 8dZRgDj4Rh94iSG7dK+KwwIotdg8c/UvuHdyWg7ZeHtsrOPhNBj/2cRGS L5cKGEsvE6hl+rZ8RphatYNdtmEY3rsZb4mrLlurD1fcWGppToo2z0MND TUci5Xg/3Z34wTLNRbN9xQqZr0PTp0r7dgWoAN3A7Te5ILzS+spsPyM9P w==; X-IronPort-AV: E=Sophos;i="5.90,167,1643670000"; d="scan'208";a="22553365" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 09 Mar 2022 12:41:54 +0100 Received: from steina-w.tq-net.de (unknown [10.123.49.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by vtuxmail01.tq-net.de (Postfix) with ESMTPSA id 3F29C280078; Wed, 9 Mar 2022 12:41:54 +0100 (CET) From: Alexander Stein To: Steve Longerbeam , Philipp Zabel , Mauro Carvalho Chehab , Greg Kroah-Hartman , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Rui Miguel Silva , Laurent Pinchart , Dorota Czaplejewicz Cc: linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Alexander Stein Subject: [PATCH v3 4/8] media: imx: Fail conversion if pixel format not supported Date: Wed, 9 Mar 2022 12:41:40 +0100 Message-Id: <20220309114144.120643-5-alexander.stein@ew.tq-group.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220309114144.120643-1-alexander.stein@ew.tq-group.com> References: <20220309114144.120643-1-alexander.stein@ew.tq-group.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Dorota Czaplejewicz imx_media_find_mbus_format has NULL as a valid return value, therefore the caller should take it into account. Signed-off-by: Dorota Czaplejewicz Signed-off-by: Alexander Stein Reviewed-by: Laurent Pinchart --- Changes in v3: * Added R-b Laurent Pinchart drivers/staging/media/imx/imx-media-utils.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/staging/media/imx/imx-media-utils.c b/drivers/staging/media/imx/imx-media-utils.c index 0534f7746cb3..0152bbcc5150 100644 --- a/drivers/staging/media/imx/imx-media-utils.c +++ b/drivers/staging/media/imx/imx-media-utils.c @@ -544,6 +544,9 @@ static int imx56_media_mbus_fmt_to_pix_fmt(struct v4l2_pix_format *pix, cc = imx_media_find_mbus_format(code, PIXFMT_SEL_YUV); } + if (!cc) + return -EINVAL; + /* Round up width for minimum burst size */ width = round_up(mbus->width, 8); From patchwork Wed Mar 9 11:41:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 12774974 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14B02C433FE for ; Wed, 9 Mar 2022 11:42:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232446AbiCILnF (ORCPT ); Wed, 9 Mar 2022 06:43:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232440AbiCILm5 (ORCPT ); Wed, 9 Mar 2022 06:42:57 -0500 Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1A6F16BCD8; Wed, 9 Mar 2022 03:41:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1646826119; x=1678362119; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=I6uwATuL3tKTw+K0ri808hGGwFUskusS0kkKf0Pf/D4=; b=F0xwruin8SNgAe8HidCUc6gpcUDQES82/XspBBkv9jBKetgxIGtjPvtF piXUdxKUeOdUtrOCsTk45O5hHcqhPzSv4Eu9oSmbpMi3lwL3d/jZdQbFM eyZTGRFKAB4yT+xBexu1/KEPpsbUdGVLI1RI9t5iLUcks8aJYFTkxVlJj IV1dzAeiT6LHejzmXb3vnWgN7OpIGUQMoDaNCOUCc/0GUBXDf6j26oIJ0 2j8pMcqzod5t0IdMyl+Bi8RFATR0D9JM9iuG1XaH9UYEaav2T3FoiAiu5 k60IR4j2gRbKdZoXAw7rihIJEPAtFo6L6WQkvQgVdBhgFtwkWtUzuiGev Q==; X-IronPort-AV: E=Sophos;i="5.90,167,1643670000"; d="scan'208";a="22553368" Received: from unknown (HELO tq-pgp-pr1.tq-net.de) ([192.168.6.15]) by mx1-pgp.tq-group.com with ESMTP; 09 Mar 2022 12:41:55 +0100 Received: from mx1.tq-group.com ([192.168.6.7]) by tq-pgp-pr1.tq-net.de (PGP Universal service); Wed, 09 Mar 2022 12:41:55 +0100 X-PGP-Universal: processed; by tq-pgp-pr1.tq-net.de on Wed, 09 Mar 2022 12:41:55 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1646826115; x=1678362115; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=I6uwATuL3tKTw+K0ri808hGGwFUskusS0kkKf0Pf/D4=; b=OSNQsC6dTSk/e0zpm47Utavx3zPN5JAqwnRQCudbItqmXUrtCdnLXIc3 aPjutrvsWGRSBLvthKke3HSP82/CoszxqFemCz9oNrfgnQqZsTILKFXYl LYaxCJyogOCxDGByC7gvpwh/oSg3G0olyIYLDoha7rY5I4/qundmzmk9+ yePakVEnFzbzQuEXNwvcWh1yha3N+HMPT0BxJN/GMNIIL4onAXo9zqJN5 bDD4BeatEocGe7hQVwlOKxR2lsMpX/uU9GcBwOw3gKHSfXjGwMKUaQAMl dLA+LxlUlATwqYh769YQjAxtsRTBrorpfK5Hsg6JKhIo98B4kUwiiRE4p A==; X-IronPort-AV: E=Sophos;i="5.90,167,1643670000"; d="scan'208";a="22553367" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 09 Mar 2022 12:41:54 +0100 Received: from steina-w.tq-net.de (unknown [10.123.49.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by vtuxmail01.tq-net.de (Postfix) with ESMTPSA id A8A5C280065; Wed, 9 Mar 2022 12:41:54 +0100 (CET) From: Alexander Stein To: Steve Longerbeam , Philipp Zabel , Mauro Carvalho Chehab , Greg Kroah-Hartman , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Rui Miguel Silva , Laurent Pinchart , Dorota Czaplejewicz Cc: Alexander Stein , linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 5/8] media: imx: imx7_media-csi: Add support for additional Bayer patterns Date: Wed, 9 Mar 2022 12:41:41 +0100 Message-Id: <20220309114144.120643-6-alexander.stein@ew.tq-group.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220309114144.120643-1-alexander.stein@ew.tq-group.com> References: <20220309114144.120643-1-alexander.stein@ew.tq-group.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org imx7_csi_configure() allows configuring these Bayer patterns when starting a stream. So allow these in link_validate() as well. Reviewed-by: Laurent Pinchart Signed-off-by: Alexander Stein --- Changes in v3: * None drivers/staging/media/imx/imx7-media-csi.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/staging/media/imx/imx7-media-csi.c b/drivers/staging/media/imx/imx7-media-csi.c index cf74960dee84..82627bd0c9ed 100644 --- a/drivers/staging/media/imx/imx7-media-csi.c +++ b/drivers/staging/media/imx/imx7-media-csi.c @@ -1028,6 +1028,18 @@ static int imx7_csi_pad_link_validate(struct v4l2_subdev *sd, case V4L2_PIX_FMT_SGBRG8: case V4L2_PIX_FMT_SGRBG8: case V4L2_PIX_FMT_SRGGB8: + case V4L2_PIX_FMT_SBGGR10: + case V4L2_PIX_FMT_SGBRG10: + case V4L2_PIX_FMT_SGRBG10: + case V4L2_PIX_FMT_SRGGB10: + case V4L2_PIX_FMT_SBGGR12: + case V4L2_PIX_FMT_SGBRG12: + case V4L2_PIX_FMT_SGRBG12: + case V4L2_PIX_FMT_SRGGB12: + case V4L2_PIX_FMT_SBGGR14: + case V4L2_PIX_FMT_SGBRG14: + case V4L2_PIX_FMT_SGRBG14: + case V4L2_PIX_FMT_SRGGB14: case V4L2_PIX_FMT_SBGGR16: case V4L2_PIX_FMT_SGBRG16: case V4L2_PIX_FMT_SGRBG16: From patchwork Wed Mar 9 11:41:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 12774975 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C810C4332F for ; Wed, 9 Mar 2022 11:42:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232453AbiCILnF (ORCPT ); Wed, 9 Mar 2022 06:43:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232385AbiCILm6 (ORCPT ); Wed, 9 Mar 2022 06:42:58 -0500 Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D75FD16BCDD; Wed, 9 Mar 2022 03:41:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1646826119; x=1678362119; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=T4YRDfFcrypsN9W2qi4iowIurInzo1YRPeKZxqXyGsk=; b=RDABghHatqFCBzz6NMhEDB7kD/26gbmX2bINrJxhZ/b61uH0L14f10+9 /3VKVDhtuuY1iINhShZz+pUDld2rfb1JzKfhcewwYxt808EsB8RH2NmpX WKWbWEd8l96SqmoKIyVB4Xpy6AxNv4a2WwASVS886aSLJBjwtjR/lMexY VShuY1UEDNmRasFXuPDervwwK7q+5Gddq2tE2DUbV2bD2/gqZuNxypO7W 35jCKHzfhSjOS0XcHdLUmMN6qsrl2421XQHCFc6277uyW3Ko/FPbs3QLd DB/dgEKAzseTBs6TgY4mqFi3OYqZK8FnKkMRPWX/cmEM07fIbVdM2Cqhi Q==; X-IronPort-AV: E=Sophos;i="5.90,167,1643670000"; d="scan'208";a="22553370" Received: from unknown (HELO tq-pgp-pr1.tq-net.de) ([192.168.6.15]) by mx1-pgp.tq-group.com with ESMTP; 09 Mar 2022 12:41:55 +0100 Received: from mx1.tq-group.com ([192.168.6.7]) by tq-pgp-pr1.tq-net.de (PGP Universal service); Wed, 09 Mar 2022 12:41:55 +0100 X-PGP-Universal: processed; by tq-pgp-pr1.tq-net.de on Wed, 09 Mar 2022 12:41:55 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1646826115; x=1678362115; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=T4YRDfFcrypsN9W2qi4iowIurInzo1YRPeKZxqXyGsk=; b=MqDLgsmXxGLsVNwFRYxqjIqhXLzhQXFhNu8iTRbdIO7Q0CWTAWTyFjtd 6UkgWXAB04m/ii+1j2tcaWuHp0gqarh5m4UR7s/nXi3AbLIQq+8kIAVBM nZPOpQAkdRCA6DAE1IRGP4rvtA3MyRT73cWt9Nz1SyKmO9UXDGjJFRLWB UY0g/y0bt4GzrAyx+ZTFX8HO0J/QqXQ9LD7OFsS1AReT9BX35yuPzMuAF plkt43XJvJHlYhO+O4ftNdK1DbYTNDsTrjvqnfep8yGcNc/iLm2cHUj6Q 9PRf+q3o+J5rFocoXDGpYvrMTOOu32Ms50Dd3BD/N6nsutlV2QXE28gBE w==; X-IronPort-AV: E=Sophos;i="5.90,167,1643670000"; d="scan'208";a="22553369" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 09 Mar 2022 12:41:55 +0100 Received: from steina-w.tq-net.de (unknown [10.123.49.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by vtuxmail01.tq-net.de (Postfix) with ESMTPSA id EF933280075; Wed, 9 Mar 2022 12:41:54 +0100 (CET) From: Alexander Stein To: Steve Longerbeam , Philipp Zabel , Mauro Carvalho Chehab , Greg Kroah-Hartman , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Rui Miguel Silva , Laurent Pinchart , Dorota Czaplejewicz Cc: Alexander Stein , linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 6/8] media: imx: utils: Add more Bayer formats Date: Wed, 9 Mar 2022 12:41:42 +0100 Message-Id: <20220309114144.120643-7-alexander.stein@ew.tq-group.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220309114144.120643-1-alexander.stein@ew.tq-group.com> References: <20220309114144.120643-1-alexander.stein@ew.tq-group.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Without this the ioctl VIDIOC_ENUM_FMT will not list the 10/12/14-Bit Bayer formats. This in return results in "v4l2-ctl --set-fmt-video pixelformat='RG10'" failing to set the pixelformat. Reviewed-by: Laurent Pinchart Signed-off-by: Alexander Stein --- Changes in v3: * None drivers/staging/media/imx/imx-media-utils.c | 72 +++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/drivers/staging/media/imx/imx-media-utils.c b/drivers/staging/media/imx/imx-media-utils.c index 0152bbcc5150..e69bbe0d6c83 100644 --- a/drivers/staging/media/imx/imx-media-utils.c +++ b/drivers/staging/media/imx/imx-media-utils.c @@ -130,6 +130,78 @@ static const struct imx_media_pixfmt pixel_formats[] = { .cs = IPUV3_COLORSPACE_RGB, .bpp = 8, .bayer = true, + }, { + .fourcc = V4L2_PIX_FMT_SBGGR10, + .codes = IMX_BUS_FMTS(MEDIA_BUS_FMT_SBGGR10_1X10), + .cs = IPUV3_COLORSPACE_RGB, + .bpp = 10, + .bayer = true, + }, { + .fourcc = V4L2_PIX_FMT_SGBRG10, + .codes = IMX_BUS_FMTS(MEDIA_BUS_FMT_SGBRG10_1X10), + .cs = IPUV3_COLORSPACE_RGB, + .bpp = 10, + .bayer = true, + }, { + .fourcc = V4L2_PIX_FMT_SGRBG10, + .codes = IMX_BUS_FMTS(MEDIA_BUS_FMT_SGRBG10_1X10), + .cs = IPUV3_COLORSPACE_RGB, + .bpp = 10, + .bayer = true, + }, { + .fourcc = V4L2_PIX_FMT_SRGGB10, + .codes = IMX_BUS_FMTS(MEDIA_BUS_FMT_SRGGB10_1X10), + .cs = IPUV3_COLORSPACE_RGB, + .bpp = 10, + .bayer = true, + }, { + .fourcc = V4L2_PIX_FMT_SBGGR12, + .codes = IMX_BUS_FMTS(MEDIA_BUS_FMT_SBGGR12_1X12), + .cs = IPUV3_COLORSPACE_RGB, + .bpp = 12, + .bayer = true, + }, { + .fourcc = V4L2_PIX_FMT_SGBRG12, + .codes = IMX_BUS_FMTS(MEDIA_BUS_FMT_SGBRG12_1X12), + .cs = IPUV3_COLORSPACE_RGB, + .bpp = 12, + .bayer = true, + }, { + .fourcc = V4L2_PIX_FMT_SGRBG12, + .codes = IMX_BUS_FMTS(MEDIA_BUS_FMT_SGRBG12_1X12), + .cs = IPUV3_COLORSPACE_RGB, + .bpp = 12, + .bayer = true, + }, { + .fourcc = V4L2_PIX_FMT_SRGGB12, + .codes = IMX_BUS_FMTS(MEDIA_BUS_FMT_SRGGB12_1X12), + .cs = IPUV3_COLORSPACE_RGB, + .bpp = 12, + .bayer = true, + }, { + .fourcc = V4L2_PIX_FMT_SBGGR14, + .codes = IMX_BUS_FMTS(MEDIA_BUS_FMT_SBGGR14_1X14), + .cs = IPUV3_COLORSPACE_RGB, + .bpp = 14, + .bayer = true, + }, { + .fourcc = V4L2_PIX_FMT_SGBRG14, + .codes = IMX_BUS_FMTS(MEDIA_BUS_FMT_SGBRG14_1X14), + .cs = IPUV3_COLORSPACE_RGB, + .bpp = 14, + .bayer = true, + }, { + .fourcc = V4L2_PIX_FMT_SGRBG14, + .codes = IMX_BUS_FMTS(MEDIA_BUS_FMT_SGRBG14_1X14), + .cs = IPUV3_COLORSPACE_RGB, + .bpp = 14, + .bayer = true, + }, { + .fourcc = V4L2_PIX_FMT_SRGGB14, + .codes = IMX_BUS_FMTS(MEDIA_BUS_FMT_SRGGB14_1X14), + .cs = IPUV3_COLORSPACE_RGB, + .bpp = 14, + .bayer = true, }, { .fourcc = V4L2_PIX_FMT_SBGGR16, .codes = IMX_BUS_FMTS( From patchwork Wed Mar 9 11:41:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 12774976 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82331C433FE for ; Wed, 9 Mar 2022 11:42:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232429AbiCILnG (ORCPT ); Wed, 9 Mar 2022 06:43:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232397AbiCILm6 (ORCPT ); Wed, 9 Mar 2022 06:42:58 -0500 Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24DC516BCE0; Wed, 9 Mar 2022 03:41:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1646826119; x=1678362119; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=FnQQsmu2PoAxzjaqNV9WFO09njNrUxb7Lfkd5IwbIUg=; b=ehr43xI6BpcYmgXBr4QBRwDVgkF9W3qzVk5uFZWoUggB9jvEHGZDsh4+ +WulPrXPXX5j2i5PE3M9mxU6FGKfci1+c84chlo5OPgiZ+pb1FOIQU33J OhkSVACjU7WWlW8PfXZbjObPhhOwwOk5T1/A7G7PnbwlXFlHKYqWccCuq KQkKQUWMFCZ5kNF5M+419xlUwH2ltB+IoUEvUAo0EKvgAJYRGwDkwZRDF QYljgmwUQbOUE2ML2t2EAWiwU6LuNavNnLQYH/bb7+gh4p5CSvyaMSPBw umPF7EncHbYngY77BIT3A0Exqj97PIciE55jf8qhbQEoy+f/PdhJ+02Fj w==; X-IronPort-AV: E=Sophos;i="5.90,167,1643670000"; d="scan'208";a="22553373" Received: from unknown (HELO tq-pgp-pr1.tq-net.de) ([192.168.6.15]) by mx1-pgp.tq-group.com with ESMTP; 09 Mar 2022 12:41:55 +0100 Received: from mx1.tq-group.com ([192.168.6.7]) by tq-pgp-pr1.tq-net.de (PGP Universal service); Wed, 09 Mar 2022 12:41:55 +0100 X-PGP-Universal: processed; by tq-pgp-pr1.tq-net.de on Wed, 09 Mar 2022 12:41:55 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1646826115; x=1678362115; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=FnQQsmu2PoAxzjaqNV9WFO09njNrUxb7Lfkd5IwbIUg=; b=UyG8XPM3anOjIfRU3RwGxQVBFxW2FoEiOO/K1+Hmr5pbbQEghJdK9fR2 a5U6y7R7enKc/2ZNYQArt+2Zp40xNpKMBgTK40N/OeNwDFF4ctetWcWiE MwHzPv1qMaQ446UKUzFvKXLUHEcb3HuiaYtluUE2FQv+PrA5mX6dGmhT2 z3H+eyhuUNxKHU9AF1nKmv86FGU8gPr6poaGswhYsQ8q1npnrCj98pIAN tqaGgegs5F/60xrqd/eJUMw9uJkRsPq3iLicMxzm09FiWPcOogjJmSGbC pbZ/YG2JU6dAYOf75xYaLs4ar7LsjJq1yib9ziqLNNHajH1+nNVy6acnF w==; X-IronPort-AV: E=Sophos;i="5.90,167,1643670000"; d="scan'208";a="22553372" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 09 Mar 2022 12:41:55 +0100 Received: from steina-w.tq-net.de (unknown [10.123.49.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by vtuxmail01.tq-net.de (Postfix) with ESMTPSA id 429B7280065; Wed, 9 Mar 2022 12:41:55 +0100 (CET) From: Alexander Stein To: Steve Longerbeam , Philipp Zabel , Mauro Carvalho Chehab , Greg Kroah-Hartman , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Rui Miguel Silva , Laurent Pinchart , Dorota Czaplejewicz Cc: Alexander Stein , linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 7/8] media: imx: utils: initialize local variable Date: Wed, 9 Mar 2022 12:41:43 +0100 Message-Id: <20220309114144.120643-8-alexander.stein@ew.tq-group.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220309114144.120643-1-alexander.stein@ew.tq-group.com> References: <20220309114144.120643-1-alexander.stein@ew.tq-group.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org imx_media_enum_mbus_formats might not set code at all, this would result in imx_media_find_mbus_format using an uninitialized variable. Set code to 0 to avoid returning a wrong pixel format. Signed-off-by: Alexander Stein --- Changes in v3: * None drivers/staging/media/imx/imx-media-utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/imx/imx-media-utils.c b/drivers/staging/media/imx/imx-media-utils.c index e69bbe0d6c83..1665cbd6b3a5 100644 --- a/drivers/staging/media/imx/imx-media-utils.c +++ b/drivers/staging/media/imx/imx-media-utils.c @@ -610,7 +610,7 @@ static int imx56_media_mbus_fmt_to_pix_fmt(struct v4l2_pix_format *pix, * so until it does convert to a supported YUV format. */ if (cc->ipufmt && cc->cs == IPUV3_COLORSPACE_YUV) { - u32 code; + u32 code = 0; imx_media_enum_mbus_formats(&code, 0, PIXFMT_SEL_YUV); cc = imx_media_find_mbus_format(code, PIXFMT_SEL_YUV); From patchwork Wed Mar 9 11:41:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 12774977 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 130B0C433F5 for ; Wed, 9 Mar 2022 11:42:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232460AbiCILnI (ORCPT ); Wed, 9 Mar 2022 06:43:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232424AbiCILm7 (ORCPT ); Wed, 9 Mar 2022 06:42:59 -0500 Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5608616BCD8; Wed, 9 Mar 2022 03:42:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1646826120; x=1678362120; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yev62PtTcyJMc3JdaFGquolvb6gHeScWk6sAEYEIg2I=; b=Zr8YUmpppWtqFq4oDWk/Z/mWS1rbeuGKJhey9Paww8mkCYLQSqcYeQvz x9B3DA5/uOYhZEPbBDdJD56PUOW3DDm0ovvO8Zt0rORqvHSQowPMV7JEy J8s3ucQpvU19ZH+kqHPJN0TKP4z2aPpRx2bFAECeAhfM7ZX8iKvrJcZxc tw45Zr9NRiR+Ge7Y0oFMjA8oKZOh4c7PfNZc8rHlzp6CYP1uRM0WtSi2x hnjZSR6lIqu92N+2od9dFyCKFKdSfv4yIJFn9XUW0zIWTd0OKNz1+VleF dpRUZs97IpWLRkwqq/2B/Vqx+/vnBSxp/0ssx+zyqBfHYAVxosZ6xGlZW Q==; X-IronPort-AV: E=Sophos;i="5.90,167,1643670000"; d="scan'208";a="22553375" Received: from unknown (HELO tq-pgp-pr1.tq-net.de) ([192.168.6.15]) by mx1-pgp.tq-group.com with ESMTP; 09 Mar 2022 12:41:55 +0100 Received: from mx1.tq-group.com ([192.168.6.7]) by tq-pgp-pr1.tq-net.de (PGP Universal service); Wed, 09 Mar 2022 12:41:55 +0100 X-PGP-Universal: processed; by tq-pgp-pr1.tq-net.de on Wed, 09 Mar 2022 12:41:55 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1646826115; x=1678362115; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yev62PtTcyJMc3JdaFGquolvb6gHeScWk6sAEYEIg2I=; b=NlXklOp/5EsGkMVjcVC+ji5EyEw9hhSIfOuz/hp0iuLRRuMS+07UdWG+ p7ajRUkIDFz0fDkEqltBNJuLI6ie21FENEHOXzbWwEMUkyKwjP2So+0IM 4Vzc0TSXv9FXKC++7vVZfMmCWufXCGc5/1ODajtHQLj/W1yDezG8NzhrY ILMCA7r668IjvuyR/5buXqYZve51u5yZHRykfnkiLV/1s+pcrmswBsOlr 4pb6IZMc6whyAse9cjyfyD9VbUvDu7+nnSWd3Y6irMj3jRRR4er3mNYJ/ UPzZBsV2pt3F+ZSPo9oPYphiTtFU3c8f1zMo6ogWaW0qW9FV03T+v9xPP w==; X-IronPort-AV: E=Sophos;i="5.90,167,1643670000"; d="scan'208";a="22553374" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 09 Mar 2022 12:41:55 +0100 Received: from steina-w.tq-net.de (unknown [10.123.49.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by vtuxmail01.tq-net.de (Postfix) with ESMTPSA id 8963F280078; Wed, 9 Mar 2022 12:41:55 +0100 (CET) From: Alexander Stein To: Steve Longerbeam , Philipp Zabel , Mauro Carvalho Chehab , Greg Kroah-Hartman , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Rui Miguel Silva , Laurent Pinchart , Dorota Czaplejewicz Cc: Alexander Stein , linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 8/8] [DNI] arm64: dts: tqma8mqml: add IMX327 MIPI-CSI overlay Date: Wed, 9 Mar 2022 12:41:44 +0100 Message-Id: <20220309114144.120643-9-alexander.stein@ew.tq-group.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220309114144.120643-1-alexander.stein@ew.tq-group.com> References: <20220309114144.120643-1-alexander.stein@ew.tq-group.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org --- Changes in v3: * None arch/arm64/boot/dts/freescale/Makefile | 4 + .../imx8mm-tqma8mqml-mba8mx-imx327.dts | 95 +++++++++++++++++++ 2 files changed, 99 insertions(+) create mode 100644 arch/arm64/boot/dts/freescale/imx8mm-tqma8mqml-mba8mx-imx327.dts diff --git a/arch/arm64/boot/dts/freescale/Makefile b/arch/arm64/boot/dts/freescale/Makefile index faa01802276d..b27842200d5f 100644 --- a/arch/arm64/boot/dts/freescale/Makefile +++ b/arch/arm64/boot/dts/freescale/Makefile @@ -57,6 +57,10 @@ dtb-$(CONFIG_ARCH_MXC) += imx8mm-icore-mx8mm-edimm2.2.dtb dtb-$(CONFIG_ARCH_MXC) += imx8mm-kontron-n801x-s.dtb dtb-$(CONFIG_ARCH_MXC) += imx8mm-nitrogen-r2.dtb dtb-$(CONFIG_ARCH_MXC) += imx8mm-tqma8mqml-mba8mx.dtb + +tqma8mqml-mba8mx-imx327-dtbs += imx8mm-tqma8mqml-mba8mx.dtb imx8mm-tqma8mqml-mba8mx-imx327.dtbo +dtb-$(CONFIG_ARCH_MXC) += tqma8mqml-mba8mx-imx327.dtb + dtb-$(CONFIG_ARCH_MXC) += imx8mm-var-som-symphony.dtb dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw71xx-0x.dtb dtb-$(CONFIG_ARCH_MXC) += imx8mm-venice-gw72xx-0x.dtb diff --git a/arch/arm64/boot/dts/freescale/imx8mm-tqma8mqml-mba8mx-imx327.dts b/arch/arm64/boot/dts/freescale/imx8mm-tqma8mqml-mba8mx-imx327.dts new file mode 100644 index 000000000000..3f1223d4d73b --- /dev/null +++ b/arch/arm64/boot/dts/freescale/imx8mm-tqma8mqml-mba8mx-imx327.dts @@ -0,0 +1,95 @@ +// SPDX-License-Identifier: (GPL-2.0-or-later OR MIT) +/* + * Copyright 2021 TQ-Systems GmbH + */ + +#include + +/dts-v1/; +/plugin/; + +&{/} { + compatible = "tq,imx8mm-tqma8mqml-mba8mx", "tq,imx8mm-tqma8mqml", "fsl,imx8mm"; + + sensor_clk: sensor-clk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <37125000>; + }; +}; + +&csi { + status = "okay"; +}; + +&i2c3 { + #address-cells = <1>; + #size-cells = <0>; + + vc_fpga: fpga@10 { + reg = <0x10>; + compatible = "vc,fpga"; + + vc_fpga_reg: regulator { + regulator-name = "CAM_VCC"; + }; + + vc_fpga_reset: reset { + #reset-cells = <0>; + }; + + vc_fpga_gpio: gpio-chip { + gpio-controller; + #gpio-cells = <2>; + }; + }; + + sony_imx327: camera@1a { + #address-cells = <0x1>; + #size-cells = <0x0>; + reg = <0x1a>; + + compatible = "sony,imx327", "sony,imx290"; + + clock-names = "xclk"; + clocks = <&sensor_clk>; + clock-frequency = <37125000>; + + vdd-supply = <&vc_fpga_reg>; + + vdda-supply = <&vc_fpga_reg>; + vddd-supply = <&vc_fpga_reg>; + vdddo-supply = <&vc_fpga_reg>; + + reset-gpios = <&vc_fpga_gpio 0 GPIO_ACTIVE_HIGH>; + + port@0 { + reg = <0>; + + sony_imx327_ep0: endpoint { + remote-endpoint = <&imx8mm_mipi_csi_in>; + data-lanes = <1 2>; + clock-lanes = <0>; + clock-noncontinuous = <1>; + link-frequencies = /bits/ 64 <445500000 297000000>; + }; + }; + }; +}; + +&mipi_csi { + status = "okay"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + imx8mm_mipi_csi_in: endpoint { + remote-endpoint = <&sony_imx327_ep0>; + data-lanes = <1 2>; + }; + }; + }; +}; \ No newline at end of file