From patchwork Wed Feb 6 15:13:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Miguel Silva X-Patchwork-Id: 157631 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp6524928jaa; Wed, 6 Feb 2019 07:13:43 -0800 (PST) X-Google-Smtp-Source: AHgI3IZTxD/UoR7bPxkkSJzBW2t+Vy8NP3O3EXXsCEVHiVVgnx5SQXSaDPLbAr/aZupSyFXTzVfu X-Received: by 2002:a17:902:7882:: with SMTP id q2mr11443839pll.305.1549466023219; Wed, 06 Feb 2019 07:13:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549466023; cv=none; d=google.com; s=arc-20160816; b=w/WCvPg9yoEFPm6en90hesKI05fQxcXe+dUQpjgkWxmndGGklP9zKbaELrCM+AceoJ kKaIFK4Ia1tHnjIPIKareDys9CH2hNDr32wjVNXcXtsNOzJGrtIaD+FpjMU/u40rF95C Kup420CwogZMDrimN0leATBr9mDwGyRa0R+9XiifRjylxTmP2z3gUZ1B1pB0kYGobMhx Yt5lK6rxQI5cHJaVgHLg1zpfIV3YPQImYRSDCMEFivuySt60IviFrLaE1YVc04tgsx6R aFORVeDmPFVL37c7iwqGmTzL2TMV3JJU4RicaC95UZPN7TO1Q6S3aPdRy6xe8wV/IYJz J0Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XHjA8RoKmxIWX5O6ius0k1doobUvG1cjxQvHP9GhQYU=; b=XU6T4ZXf1r0pWTQu3J+tizWU/3MzG5qbnzWI3Jmv3arwLcCxoqTWQwabfG58+1cyfD 8IDJlnqMM+q4AVCxfT/sG0ydPO1lF0TjgwiCXDGZwfg4Vr00rKvJQWRmJrSFcggl7xVS QQCyRDzJBMPZa3h+3JqaVjQwDi4kn/+ymLcTQswA7OKAnzITV8fd2O1+4EFtLPGWHYMF NYj24PUb+o/uF3gkyDrz0xYdZe8xjoyH55aoDzlwRBj4wD0ETu7ydcdPdiq0lR4V3gU0 re9hGXbYPDoLdGm55THd1dBOtik8lh1DqdGBYz0WVDhHG6RLUbOP+kcLDOLGfzq2TvaF j4/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bHKk0Bi9; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e4si6111576pgk.127.2019.02.06.07.13.43; Wed, 06 Feb 2019 07:13:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bHKk0Bi9; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731136AbfBFPNm (ORCPT + 7 others); Wed, 6 Feb 2019 10:13:42 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:36503 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731143AbfBFPNm (ORCPT ); Wed, 6 Feb 2019 10:13:42 -0500 Received: by mail-wr1-f66.google.com with SMTP id z3so7979974wrv.3 for ; Wed, 06 Feb 2019 07:13:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XHjA8RoKmxIWX5O6ius0k1doobUvG1cjxQvHP9GhQYU=; b=bHKk0Bi9+QK2wCqCK84D8Hvd+WI6mVEtXhDeZbiu72dZIaN1gxn2shXuTsWMfIlfk/ eNXdjk4YsLL06lbXb2KqBwRmf7jFoZphUhB9UXy/9Pi9io6tCBOkw3zKS5vsqxXtHtAp Z6BFNx0xeILIi9StDX5WBRxUs05TrVuPlUjHXnvV4yYqvAzh4kX7ROH+Z56pdQeS2/YR 6hXRX95IzfZ1LnGXHM1J+Svoa5QLXMxhyv6RbItAmy8QkXcgall4Ohx8Ac/a+L7/ho7D okMr95HDiFT2m3e9ivi6rcErQcqFfvuzT26v+tnh1vOWWIxzo/mBDAY+oHNvdoRZoRVP qBkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XHjA8RoKmxIWX5O6ius0k1doobUvG1cjxQvHP9GhQYU=; b=isGrzq7zqJ+rv1faKySAsUFgjP+XC3xf7yYQzCAWLrZtKm02qt6nzPuE/nj6S+4qzi eNQOG8UnGk/B3YM2qHehs89cEULc7wiZrH/jSkaUKfjkvMFwe1lB2WXllzBFBnPULQuw QPVrR0tHHsfRHDA7p8Ou2KMfhoaMDNfIE9IJyGvO2DgR1wWRnAHyzrEZCFAEiIC/3TBu 9ZdbdPc+6tj70yh4yi+41evbl3EbPW0M21hX2n0JoExgpM1LGzhNtNHs0iPtET9PhMOf iUjaawIM0vkW3v6i7v5o5pDIPZNZtaUkNQLqLJrljr9CqoPkELmfQDoHF9d+6HKNqGrl x8Fw== X-Gm-Message-State: AHQUAubCk2J82tZ4nAW2onTUE3blyLovIrP545/+iim8/8MaQ9NLiGlv qpzRyImeNl9WGnXrjbcuPpRU7Q== X-Received: by 2002:adf:e846:: with SMTP id d6mr5607105wrn.72.1549466018930; Wed, 06 Feb 2019 07:13:38 -0800 (PST) Received: from arch-late.local (a109-49-46-234.cpe.netcabo.pt. [109.49.46.234]) by smtp.gmail.com with ESMTPSA id f22sm11207836wmj.26.2019.02.06.07.13.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Feb 2019 07:13:38 -0800 (PST) From: Rui Miguel Silva To: sakari.ailus@linux.intel.com, Steve Longerbeam , Hans Verkuil , Philipp Zabel Cc: linux-media@vger.kernel.org, devel@driverdev.osuosl.org, devicetree@vger.kernel.org, Greg Kroah-Hartman , Rui Miguel Silva Subject: [PATCH v14 02/13] media: staging/imx: rearrange group id to take in account IPU Date: Wed, 6 Feb 2019 15:13:17 +0000 Message-Id: <20190206151328.21629-3-rui.silva@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190206151328.21629-1-rui.silva@linaro.org> References: <20190206151328.21629-1-rui.silva@linaro.org> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Some imx system do not have IPU, so prepare the imx media drivers to support this kind of devices. Rename the group ids to include an _IPU_ prefix, add a new group id to support systems with only a CSI without IPU, and also rename the create internal links to make it clear that only systems with IPU have internal subdevices. Signed-off-by: Rui Miguel Silva Acked-by: Sakari Ailus --- drivers/staging/media/imx/imx-ic-common.c | 6 ++--- drivers/staging/media/imx/imx-ic-prp.c | 16 ++++++------- drivers/staging/media/imx/imx-media-csi.c | 6 ++--- drivers/staging/media/imx/imx-media-dev.c | 22 ++++++++++-------- .../staging/media/imx/imx-media-internal-sd.c | 20 ++++++++-------- drivers/staging/media/imx/imx-media-utils.c | 12 +++++----- drivers/staging/media/imx/imx-media.h | 23 ++++++++++--------- 7 files changed, 55 insertions(+), 50 deletions(-) -- 2.20.1 diff --git a/drivers/staging/media/imx/imx-ic-common.c b/drivers/staging/media/imx/imx-ic-common.c index cfdd4900a3be..765919487a73 100644 --- a/drivers/staging/media/imx/imx-ic-common.c +++ b/drivers/staging/media/imx/imx-ic-common.c @@ -41,13 +41,13 @@ static int imx_ic_probe(struct platform_device *pdev) pdata = priv->dev->platform_data; priv->ipu_id = pdata->ipu_id; switch (pdata->grp_id) { - case IMX_MEDIA_GRP_ID_IC_PRP: + case IMX_MEDIA_GRP_ID_IPU_IC_PRP: priv->task_id = IC_TASK_PRP; break; - case IMX_MEDIA_GRP_ID_IC_PRPENC: + case IMX_MEDIA_GRP_ID_IPU_IC_PRPENC: priv->task_id = IC_TASK_ENCODER; break; - case IMX_MEDIA_GRP_ID_IC_PRPVF: + case IMX_MEDIA_GRP_ID_IPU_IC_PRPVF: priv->task_id = IC_TASK_VIEWFINDER; break; default: diff --git a/drivers/staging/media/imx/imx-ic-prp.c b/drivers/staging/media/imx/imx-ic-prp.c index 98923fc844ce..2702548f83cf 100644 --- a/drivers/staging/media/imx/imx-ic-prp.c +++ b/drivers/staging/media/imx/imx-ic-prp.c @@ -77,7 +77,7 @@ static int prp_start(struct prp_priv *priv) priv->ipu = priv->md->ipu[ic_priv->ipu_id]; /* set IC to receive from CSI or VDI depending on source */ - src_is_vdic = !!(priv->src_sd->grp_id & IMX_MEDIA_GRP_ID_VDIC); + src_is_vdic = !!(priv->src_sd->grp_id & IMX_MEDIA_GRP_ID_IPU_VDIC); ipu_set_ic_src_mux(priv->ipu, priv->csi_id, src_is_vdic); @@ -237,8 +237,8 @@ static int prp_link_setup(struct media_entity *entity, ret = -EBUSY; goto out; } - if (priv->sink_sd_prpenc && (remote_sd->grp_id & - IMX_MEDIA_GRP_ID_VDIC)) { + if (priv->sink_sd_prpenc && + (remote_sd->grp_id & IMX_MEDIA_GRP_ID_IPU_VDIC)) { ret = -EINVAL; goto out; } @@ -259,7 +259,7 @@ static int prp_link_setup(struct media_entity *entity, goto out; } if (priv->src_sd && (priv->src_sd->grp_id & - IMX_MEDIA_GRP_ID_VDIC)) { + IMX_MEDIA_GRP_ID_IPU_VDIC)) { ret = -EINVAL; goto out; } @@ -309,13 +309,13 @@ static int prp_link_validate(struct v4l2_subdev *sd, return ret; csi = imx_media_find_upstream_subdev(priv->md, &ic_priv->sd.entity, - IMX_MEDIA_GRP_ID_CSI); + IMX_MEDIA_GRP_ID_IPU_CSI); if (IS_ERR(csi)) csi = NULL; mutex_lock(&priv->lock); - if (priv->src_sd->grp_id & IMX_MEDIA_GRP_ID_VDIC) { + if (priv->src_sd->grp_id & IMX_MEDIA_GRP_ID_IPU_VDIC) { /* * the ->PRPENC link cannot be enabled if the source * is the VDIC @@ -334,10 +334,10 @@ static int prp_link_validate(struct v4l2_subdev *sd, if (csi) { switch (csi->grp_id) { - case IMX_MEDIA_GRP_ID_CSI0: + case IMX_MEDIA_GRP_ID_IPU_CSI0: priv->csi_id = 0; break; - case IMX_MEDIA_GRP_ID_CSI1: + case IMX_MEDIA_GRP_ID_IPU_CSI1: priv->csi_id = 1; break; default: diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c index d851ca2497b4..d957b8aa3ec5 100644 --- a/drivers/staging/media/imx/imx-media-csi.c +++ b/drivers/staging/media/imx/imx-media-csi.c @@ -1071,10 +1071,10 @@ static int csi_link_setup(struct media_entity *entity, remote_sd = media_entity_to_v4l2_subdev(remote->entity); switch (remote_sd->grp_id) { - case IMX_MEDIA_GRP_ID_VDIC: + case IMX_MEDIA_GRP_ID_IPU_VDIC: priv->dest = IPU_CSI_DEST_VDIC; break; - case IMX_MEDIA_GRP_ID_IC_PRP: + case IMX_MEDIA_GRP_ID_IPU_IC_PRP: priv->dest = IPU_CSI_DEST_IC; break; default: @@ -1969,7 +1969,7 @@ static int imx_csi_probe(struct platform_device *pdev) priv->sd.owner = THIS_MODULE; priv->sd.flags = V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS; priv->sd.grp_id = priv->csi_id ? - IMX_MEDIA_GRP_ID_CSI1 : IMX_MEDIA_GRP_ID_CSI0; + IMX_MEDIA_GRP_ID_IPU_CSI1 : IMX_MEDIA_GRP_ID_IPU_CSI0; imx_media_grp_id_to_sd_name(priv->sd.name, sizeof(priv->sd.name), priv->sd.grp_id, ipu_get_num(priv->ipu)); diff --git a/drivers/staging/media/imx/imx-media-dev.c b/drivers/staging/media/imx/imx-media-dev.c index c42bddd78906..28a3d23aad5b 100644 --- a/drivers/staging/media/imx/imx-media-dev.c +++ b/drivers/staging/media/imx/imx-media-dev.c @@ -125,7 +125,7 @@ int imx_media_subdev_bound(struct v4l2_async_notifier *notifier, mutex_lock(&imxmd->mutex); - if (sd->grp_id & IMX_MEDIA_GRP_ID_CSI) { + if (sd->grp_id & IMX_MEDIA_GRP_ID_IPU_CSI) { ret = imx_media_get_ipu(imxmd, sd); if (ret) goto out; @@ -149,13 +149,13 @@ static int imx_media_create_links(struct v4l2_async_notifier *notifier) list_for_each_entry(sd, &imxmd->v4l2_dev.subdevs, list) { switch (sd->grp_id) { - case IMX_MEDIA_GRP_ID_VDIC: - case IMX_MEDIA_GRP_ID_IC_PRP: - case IMX_MEDIA_GRP_ID_IC_PRPENC: - case IMX_MEDIA_GRP_ID_IC_PRPVF: - case IMX_MEDIA_GRP_ID_CSI0: - case IMX_MEDIA_GRP_ID_CSI1: - ret = imx_media_create_internal_links(imxmd, sd); + case IMX_MEDIA_GRP_ID_IPU_VDIC: + case IMX_MEDIA_GRP_ID_IPU_IC_PRP: + case IMX_MEDIA_GRP_ID_IPU_IC_PRPENC: + case IMX_MEDIA_GRP_ID_IPU_IC_PRPVF: + case IMX_MEDIA_GRP_ID_IPU_CSI0: + case IMX_MEDIA_GRP_ID_IPU_CSI1: + ret = imx_media_create_ipu_internal_links(imxmd, sd); if (ret) return ret; /* @@ -163,9 +163,13 @@ static int imx_media_create_links(struct v4l2_async_notifier *notifier) * internal entities, so create the external links * to the CSI sink pads. */ - if (sd->grp_id & IMX_MEDIA_GRP_ID_CSI) + if (sd->grp_id & IMX_MEDIA_GRP_ID_IPU_CSI) imx_media_create_csi_of_links(imxmd, sd); break; + case IMX_MEDIA_GRP_ID_CSI: + imx_media_create_csi_of_links(imxmd, sd); + + break; default: /* * if this subdev has fwnode links, create media diff --git a/drivers/staging/media/imx/imx-media-internal-sd.c b/drivers/staging/media/imx/imx-media-internal-sd.c index 0fdc45dbfb76..5e10d95e5529 100644 --- a/drivers/staging/media/imx/imx-media-internal-sd.c +++ b/drivers/staging/media/imx/imx-media-internal-sd.c @@ -30,32 +30,32 @@ static const struct internal_subdev_id { } isd_id[num_isd] = { [isd_csi0] = { .index = isd_csi0, - .grp_id = IMX_MEDIA_GRP_ID_CSI0, + .grp_id = IMX_MEDIA_GRP_ID_IPU_CSI0, .name = "imx-ipuv3-csi", }, [isd_csi1] = { .index = isd_csi1, - .grp_id = IMX_MEDIA_GRP_ID_CSI1, + .grp_id = IMX_MEDIA_GRP_ID_IPU_CSI1, .name = "imx-ipuv3-csi", }, [isd_vdic] = { .index = isd_vdic, - .grp_id = IMX_MEDIA_GRP_ID_VDIC, + .grp_id = IMX_MEDIA_GRP_ID_IPU_VDIC, .name = "imx-ipuv3-vdic", }, [isd_ic_prp] = { .index = isd_ic_prp, - .grp_id = IMX_MEDIA_GRP_ID_IC_PRP, + .grp_id = IMX_MEDIA_GRP_ID_IPU_IC_PRP, .name = "imx-ipuv3-ic", }, [isd_ic_prpenc] = { .index = isd_ic_prpenc, - .grp_id = IMX_MEDIA_GRP_ID_IC_PRPENC, + .grp_id = IMX_MEDIA_GRP_ID_IPU_IC_PRPENC, .name = "imx-ipuv3-ic", }, [isd_ic_prpvf] = { .index = isd_ic_prpvf, - .grp_id = IMX_MEDIA_GRP_ID_IC_PRPVF, + .grp_id = IMX_MEDIA_GRP_ID_IPU_IC_PRPVF, .name = "imx-ipuv3-ic", }, }; @@ -229,8 +229,8 @@ static int create_ipu_internal_link(struct imx_media_dev *imxmd, return ret; } -int imx_media_create_internal_links(struct imx_media_dev *imxmd, - struct v4l2_subdev *sd) +int imx_media_create_ipu_internal_links(struct imx_media_dev *imxmd, + struct v4l2_subdev *sd) { const struct internal_subdev *intsd; const struct internal_pad *intpad; @@ -312,8 +312,8 @@ static int add_ipu_internal_subdevs(struct imx_media_dev *imxmd, int ipu_id) * of_parse_subdev(). */ switch (isd->id->grp_id) { - case IMX_MEDIA_GRP_ID_CSI0: - case IMX_MEDIA_GRP_ID_CSI1: + case IMX_MEDIA_GRP_ID_IPU_CSI0: + case IMX_MEDIA_GRP_ID_IPU_CSI1: ret = 0; break; default: diff --git a/drivers/staging/media/imx/imx-media-utils.c b/drivers/staging/media/imx/imx-media-utils.c index 5f110d90a4ef..c618dd05d3f8 100644 --- a/drivers/staging/media/imx/imx-media-utils.c +++ b/drivers/staging/media/imx/imx-media-utils.c @@ -705,20 +705,20 @@ void imx_media_grp_id_to_sd_name(char *sd_name, int sz, u32 grp_id, int ipu_id) int id; switch (grp_id) { - case IMX_MEDIA_GRP_ID_CSI0...IMX_MEDIA_GRP_ID_CSI1: - id = (grp_id >> IMX_MEDIA_GRP_ID_CSI_BIT) - 1; + case IMX_MEDIA_GRP_ID_IPU_CSI0...IMX_MEDIA_GRP_ID_IPU_CSI1: + id = (grp_id >> IMX_MEDIA_GRP_ID_IPU_CSI_BIT) - 1; snprintf(sd_name, sz, "ipu%d_csi%d", ipu_id + 1, id); break; - case IMX_MEDIA_GRP_ID_VDIC: + case IMX_MEDIA_GRP_ID_IPU_VDIC: snprintf(sd_name, sz, "ipu%d_vdic", ipu_id + 1); break; - case IMX_MEDIA_GRP_ID_IC_PRP: + case IMX_MEDIA_GRP_ID_IPU_IC_PRP: snprintf(sd_name, sz, "ipu%d_ic_prp", ipu_id + 1); break; - case IMX_MEDIA_GRP_ID_IC_PRPENC: + case IMX_MEDIA_GRP_ID_IPU_IC_PRPENC: snprintf(sd_name, sz, "ipu%d_ic_prpenc", ipu_id + 1); break; - case IMX_MEDIA_GRP_ID_IC_PRPVF: + case IMX_MEDIA_GRP_ID_IPU_IC_PRPVF: snprintf(sd_name, sz, "ipu%d_ic_prpvf", ipu_id + 1); break; default: diff --git a/drivers/staging/media/imx/imx-media.h b/drivers/staging/media/imx/imx-media.h index 0d1c6bbf1109..4d45f1c04f88 100644 --- a/drivers/staging/media/imx/imx-media.h +++ b/drivers/staging/media/imx/imx-media.h @@ -252,8 +252,8 @@ void imx_media_fim_free(struct imx_media_fim *fim); /* imx-media-internal-sd.c */ int imx_media_add_internal_subdevs(struct imx_media_dev *imxmd); -int imx_media_create_internal_links(struct imx_media_dev *imxmd, - struct v4l2_subdev *sd); +int imx_media_create_ipu_internal_links(struct imx_media_dev *imxmd, + struct v4l2_subdev *sd); void imx_media_remove_internal_subdevs(struct imx_media_dev *imxmd); /* imx-media-of.c */ @@ -279,14 +279,15 @@ void imx_media_capture_device_set_format(struct imx_media_video_dev *vdev, void imx_media_capture_device_error(struct imx_media_video_dev *vdev); /* subdev group ids */ -#define IMX_MEDIA_GRP_ID_CSI2 BIT(8) -#define IMX_MEDIA_GRP_ID_CSI_BIT 9 -#define IMX_MEDIA_GRP_ID_CSI (0x3 << IMX_MEDIA_GRP_ID_CSI_BIT) -#define IMX_MEDIA_GRP_ID_CSI0 BIT(IMX_MEDIA_GRP_ID_CSI_BIT) -#define IMX_MEDIA_GRP_ID_CSI1 (2 << IMX_MEDIA_GRP_ID_CSI_BIT) -#define IMX_MEDIA_GRP_ID_VDIC BIT(11) -#define IMX_MEDIA_GRP_ID_IC_PRP BIT(12) -#define IMX_MEDIA_GRP_ID_IC_PRPENC BIT(13) -#define IMX_MEDIA_GRP_ID_IC_PRPVF BIT(14) +#define IMX_MEDIA_GRP_ID_CSI2 BIT(8) +#define IMX_MEDIA_GRP_ID_CSI BIT(9) +#define IMX_MEDIA_GRP_ID_IPU_CSI_BIT 10 +#define IMX_MEDIA_GRP_ID_IPU_CSI (0x3 << IMX_MEDIA_GRP_ID_IPU_CSI_BIT) +#define IMX_MEDIA_GRP_ID_IPU_CSI0 BIT(IMX_MEDIA_GRP_ID_IPU_CSI_BIT) +#define IMX_MEDIA_GRP_ID_IPU_CSI1 (2 << IMX_MEDIA_GRP_ID_IPU_CSI_BIT) +#define IMX_MEDIA_GRP_ID_IPU_VDIC BIT(12) +#define IMX_MEDIA_GRP_ID_IPU_IC_PRP BIT(13) +#define IMX_MEDIA_GRP_ID_IPU_IC_PRPENC BIT(14) +#define IMX_MEDIA_GRP_ID_IPU_IC_PRPVF BIT(15) #endif From patchwork Wed Feb 6 15:13:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Miguel Silva X-Patchwork-Id: 157637 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp6525268jaa; Wed, 6 Feb 2019 07:13:59 -0800 (PST) X-Google-Smtp-Source: AHgI3IaXHp5FKK3PQNDLw9H7uuD2KNxlBeHa2/2C8Mhggsv+yK975ZaZ+6BrtzWIutiePS7Y2prB X-Received: by 2002:a17:902:e612:: with SMTP id cm18mr7494025plb.172.1549466039008; Wed, 06 Feb 2019 07:13:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549466039; cv=none; d=google.com; s=arc-20160816; b=MlyCUSm+Shh9QavyAUnvfIejOXpj8B3rNS6I0rrKbxBXARxI7YR/HkkBtNpkG7AN3v F/6D3rbPdrsa6RSHDjxMtT3TEVH5NOn0zugOaijMk4S24nkiOwph9GSzF6AHSV3xkzyN WdvOskS6X7tkg9GnJyW3DRdGQCPmh2uc10g6UBkSBz35phvo+F22wpxNHqHhu8+YsbN7 D4AonaWDppgBYsLP3BNxLz6/283PQ/QU0ABC3zFqkCkRc/IaQkDuJSZN5lvfaLV0ZkZ7 1kgbZ4UHbpINxWXrBH2nRIVzLNAGdPRLO5B6Kob0TH5TmI9HBrxUPnpSxqr6ln51nSjJ A1gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=l1CtKO6V+4HtmzEfS2pTeqx8xeoh5M0LOaS1U2hjAuU=; b=Nva8IJ9u3tTwQs0yoFqrCAEYBr9Z5jSaP7mHudPBxxkTQY3AnnshahUb0cMm5wUPUR 7ft8XYmhw/M2rv0BZOX3pCtQElE2NqSG0VLqn6zw5M/wUuDYtzUPABPzQmhBcRx0kq1b mgw7jmjAFgKVUVnZkxaGCLd/FGrhc/wxjo+xGpEn6wwzUFZTT8dHqMKToBRKUJwpKS7p 5KGmrJ7K27ZmX3THyk0RoxWVLr8R9lMkCgAomknVVCXxvEwVPOEaN+lujWgPOBLcEFAq m2ppJHu4I2T4ejlDvCBAUyTcU6ph7a5npIGQrppFvEn7DniDEZETttFzbQZkk7DP89cy qPag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QSmDddwU; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e4si6111576pgk.127.2019.02.06.07.13.58; Wed, 06 Feb 2019 07:13:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QSmDddwU; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730099AbfBFPN6 (ORCPT + 7 others); Wed, 6 Feb 2019 10:13:58 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:54098 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731154AbfBFPN6 (ORCPT ); Wed, 6 Feb 2019 10:13:58 -0500 Received: by mail-wm1-f67.google.com with SMTP id d15so2861542wmb.3 for ; Wed, 06 Feb 2019 07:13:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=l1CtKO6V+4HtmzEfS2pTeqx8xeoh5M0LOaS1U2hjAuU=; b=QSmDddwUoXwPmQm3I+lZXV66WqYgFYZ10ahloTQ7M9l0fFGRljGU9DvocPQ8MXP9ov 6uOVW+rQxmLghK7MYYGOvOhXmnUWAcjijUp00VSSPjxRVr+ndrJ53EhozuhB7dYpxVD4 xkTr1f1IEDx3+wsy8CtpPiOBmxsj0JfApBktrWFgu07kxV8UbUFz8fSNHZg9nnC+WR3Z u8MFu5amn3xxKahGyQpSM4d9N+WzEob9hmDwsSxHZR+bb/myHKq0Qlr0E6Vu9sPvJ5vA s7ahPE8MQ8DlYq6VLjSPpCV5AzzvFLOgf+uJ9MBOYyxLapxS6RSD61GfIo50i5M1AhJz RsOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=l1CtKO6V+4HtmzEfS2pTeqx8xeoh5M0LOaS1U2hjAuU=; b=qrtK0znEifshE4571RBDGyv2KWbtbBs0ZofGoMycoCP/wKeSmY8xy+cFuNZt95bXXA RtLJk+218uCHU9jta2ovIJhm8Bqk1scGsmw5c5N8GS47ntTtvf52KQ6bEQG1dcoswfHb DekFtRH7TbXhBApp/xSHlCmllWj3wDEjnBAQ/LhaikRydXokXFSBJHuugM+4ADmJDuRc W5iuYYxwKXUBtP6gojV5H90LzTBZFNJrFuKren4MxYS5MD+lEvNU+vyGslyIPL4Lh1y2 8YLT5OCUiyhmSda2C2f54rKLovwONdUCTJyyYulhxCgx42yaiwHkjcln6K1aSTy5XuWT IyDQ== X-Gm-Message-State: AHQUAuZTXoirQi3xJDIenIBqmte64Pjsj8SPn+DQxBwe8UvQJXBGojzJ yVQs9aetH5vxniTqChJ7NlSg8g== X-Received: by 2002:a1c:c44c:: with SMTP id u73mr3716740wmf.45.1549466036008; Wed, 06 Feb 2019 07:13:56 -0800 (PST) Received: from arch-late.local (a109-49-46-234.cpe.netcabo.pt. [109.49.46.234]) by smtp.gmail.com with ESMTPSA id f22sm11207836wmj.26.2019.02.06.07.13.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Feb 2019 07:13:55 -0800 (PST) From: Rui Miguel Silva To: sakari.ailus@linux.intel.com, Steve Longerbeam , Hans Verkuil , Philipp Zabel Cc: linux-media@vger.kernel.org, devel@driverdev.osuosl.org, devicetree@vger.kernel.org, Greg Kroah-Hartman , Rui Miguel Silva Subject: [PATCH v14 08/13] ARM: dts: imx7: Add video mux, csi and mipi_csi and connections Date: Wed, 6 Feb 2019 15:13:23 +0000 Message-Id: <20190206151328.21629-9-rui.silva@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190206151328.21629-1-rui.silva@linaro.org> References: <20190206151328.21629-1-rui.silva@linaro.org> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This patch adds the device tree nodes for csi, video multiplexer and mipi-csi besides the graph connecting the necessary endpoints to make the media capture entities to work in imx7 Warp board. Signed-off-by: Rui Miguel Silva --- arch/arm/boot/dts/imx7s-warp.dts | 51 ++++++++++++++++++++++++++++++++ arch/arm/boot/dts/imx7s.dtsi | 27 +++++++++++++++++ 2 files changed, 78 insertions(+) -- 2.20.1 diff --git a/arch/arm/boot/dts/imx7s-warp.dts b/arch/arm/boot/dts/imx7s-warp.dts index 23431faecaf4..358bcae7ebaf 100644 --- a/arch/arm/boot/dts/imx7s-warp.dts +++ b/arch/arm/boot/dts/imx7s-warp.dts @@ -277,6 +277,57 @@ status = "okay"; }; +&gpr { + csi_mux { + compatible = "video-mux"; + mux-controls = <&mux 0>; + #address-cells = <1>; + #size-cells = <0>; + + port@1 { + reg = <1>; + + csi_mux_from_mipi_vc0: endpoint { + remote-endpoint = <&mipi_vc0_to_csi_mux>; + }; + }; + + port@2 { + reg = <2>; + + csi_mux_to_csi: endpoint { + remote-endpoint = <&csi_from_csi_mux>; + }; + }; + }; +}; + +&csi { + status = "okay"; + + port { + csi_from_csi_mux: endpoint { + remote-endpoint = <&csi_mux_to_csi>; + }; + }; +}; + +&mipi_csi { + clock-frequency = <166000000>; + status = "okay"; + #address-cells = <1>; + #size-cells = <0>; + fsl,csis-hs-settle = <3>; + + port@1 { + reg = <1>; + + mipi_vc0_to_csi_mux: endpoint { + remote-endpoint = <&csi_mux_from_mipi_vc0>; + }; + }; +}; + &wdog1 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_wdog>; diff --git a/arch/arm/boot/dts/imx7s.dtsi b/arch/arm/boot/dts/imx7s.dtsi index 792efcd2caa1..01962f85cab6 100644 --- a/arch/arm/boot/dts/imx7s.dtsi +++ b/arch/arm/boot/dts/imx7s.dtsi @@ -8,6 +8,7 @@ #include #include #include +#include #include "imx7d-pinfunc.h" / { @@ -709,6 +710,17 @@ status = "disabled"; }; + csi: csi@30710000 { + compatible = "fsl,imx7-csi"; + reg = <0x30710000 0x10000>; + interrupts = ; + clocks = <&clks IMX7D_CLK_DUMMY>, + <&clks IMX7D_CSI_MCLK_ROOT_CLK>, + <&clks IMX7D_CLK_DUMMY>; + clock-names = "axi", "mclk", "dcic"; + status = "disabled"; + }; + lcdif: lcdif@30730000 { compatible = "fsl,imx7d-lcdif", "fsl,imx28-lcdif"; reg = <0x30730000 0x10000>; @@ -718,6 +730,21 @@ clock-names = "pix", "axi"; status = "disabled"; }; + + mipi_csi: mipi-csi@30750000 { + compatible = "fsl,imx7-mipi-csi2"; + reg = <0x30750000 0x10000>; + interrupts = ; + clocks = <&clks IMX7D_IPG_ROOT_CLK>, + <&clks IMX7D_MIPI_CSI_ROOT_CLK>, + <&clks IMX7D_MIPI_DPHY_ROOT_CLK>; + clock-names = "pclk", "wrap", "phy"; + power-domains = <&pgc_mipi_phy>; + phy-supply = <®_1p0d>; + resets = <&src IMX7_RESET_MIPI_PHY_MRST>; + reset-names = "mrst"; + status = "disabled"; + }; }; aips3: aips-bus@30800000 { From patchwork Wed Feb 6 15:13:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Miguel Silva X-Patchwork-Id: 157639 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp6525398jaa; Wed, 6 Feb 2019 07:14:04 -0800 (PST) X-Google-Smtp-Source: AHgI3IZNuDw/TwZnx00IKfYtPIgJi3RgTMgQuD67OqKyfdrF3eQr7Qg8NnAu2sEYwhxUyw8A+A6E X-Received: by 2002:a17:902:e612:: with SMTP id cm18mr7494389plb.172.1549466044010; Wed, 06 Feb 2019 07:14:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549466044; cv=none; d=google.com; s=arc-20160816; b=T4br5d/zEIlEX0khdHu9sckPQtPcoIf+2Wsm+NbzHV7+aOY8CAXtKuaZDscZzD/sIC J6/gdEyc5f14YwLMIQvPOe6RLohkWnC0Kr+JOOwxaJPEEecFoHcogdPZUhb3G0afVoLB yWcd95kwzGv+RViSKBLLqQd3dCjuQ+asjW+jlTP445PWKo+6OipAAu4yedgo1iLajhG5 8f/iOgbdsG/DUs30DvBlXRCQ2tK54QpASuHPMofmYniJaVyrv5v8ADQdd0fDQ7b16Ebm rNBRVk/mpxGMBP0y4QPNG4rZUGNjm1U1oFYBMLM3hZciW0sUFIguL3hhl2sfSabsn9TT rlbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=NsGgdO07PG/gbs4ACVbwVYSzhg8weZOmSFSCwVRo/x0=; b=StLCSRXyoPHQJmNosh1jZ6ohdtkHbShHyKwaTgLLQUIGEm7ID9+qV7A8giuuLdtd0M WolWhOdQ3IV9+qREKRz3SDn4hICRNCteRWep0670+F+mG5n207hux7PkhFQgdYnFCzvv v73Ygf3uZvYkSiik9pMRqCmJgoPv5HwB5Q9YdQb3f8zWoxLXruxjp9VD8V7raxB3qnSD 2AF6aKzkcqPZm5KI2twFtXat9n5BGuwIeRZ/Qg0nFpVXgbRHbKiLBuzI/TFS4U1J8XAR EcZ4sGOxcUgjHqgwk4Jtte/dBsHJcJd2oQFdNbd01SeO1y/8yaTb371PRoeHE+gNNPXn x9bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XzPdrB8d; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e4si6111576pgk.127.2019.02.06.07.14.03; Wed, 06 Feb 2019 07:14:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XzPdrB8d; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730280AbfBFPOD (ORCPT + 7 others); Wed, 6 Feb 2019 10:14:03 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:40640 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731182AbfBFPOD (ORCPT ); Wed, 6 Feb 2019 10:14:03 -0500 Received: by mail-wr1-f67.google.com with SMTP id p4so7958815wrt.7 for ; Wed, 06 Feb 2019 07:14:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NsGgdO07PG/gbs4ACVbwVYSzhg8weZOmSFSCwVRo/x0=; b=XzPdrB8dh5X2MYW3gBDGxfqcoV3OYsgACZJ0telChNLoou2mQXwNZ5QkwIXlRhOk/0 2moC7B7Q9AnnNkkzbsYMW9kTPiBGDF/2WBSS0lvvAqgZ9QOQlc3iKdrUHfHcns+c1+u0 rkgyK9IO2sD8kOOTtd/bF6kcf2p0jm/4sgcL9bZl5yd46CzeIPczSSsEWX7jAhifUGLR bx9wVwGlMV8+NkH+eccuL8Li/9dSrBHhjicWY0kquixa39gcIrxyRw9w9/tfglcjfwWP /hnWmGISJjZxhAlJOdUwhG2fY+8CJUN8wABaq36fpTR6ilX5v527o2G6+cv9usKVEDUC iIxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NsGgdO07PG/gbs4ACVbwVYSzhg8weZOmSFSCwVRo/x0=; b=d5Jr7mj0//70NU2aXJ3FocK1RROw6G54qQ4rYRKkOBbfngS4i1vFUCabkdU+aMmJct bfkPf9u+Sa9llFS/ASvBAjUzqFTU12bqpNr3fMgJYLTkNppzo6IweWvVOVX14+yNYWMI uI8UoxppsqUA7BhWeYqSGM+b9g2OzZVcFcPSih+aD/oBw2ZXTTmvjnLksZzYuPInIIHw 6RzxlgIrm+9CrRSA4pyHxyLWJ+WKptBJFqngBR41o99TFbpoENl2Iyzg7WQLU7jqxzHl rhtNv1eLJluU1Yayg0qadZMCD+0Z5xg6NiLpTrRuuBB+6QPJlPetjKrx7NxaBlZExWH9 QXsg== X-Gm-Message-State: AHQUAuaF1leWWYdffEj1Me8+L6+8g98J5/TvFmmvFpLFXgbT3vNdhbwv asmBKIcHD7pvxZOdcbGScZVISQ== X-Received: by 2002:adf:efcb:: with SMTP id i11mr2305486wrp.295.1549466040684; Wed, 06 Feb 2019 07:14:00 -0800 (PST) Received: from arch-late.local (a109-49-46-234.cpe.netcabo.pt. [109.49.46.234]) by smtp.gmail.com with ESMTPSA id f22sm11207836wmj.26.2019.02.06.07.13.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Feb 2019 07:14:00 -0800 (PST) From: Rui Miguel Silva To: sakari.ailus@linux.intel.com, Steve Longerbeam , Hans Verkuil , Philipp Zabel Cc: linux-media@vger.kernel.org, devel@driverdev.osuosl.org, devicetree@vger.kernel.org, Greg Kroah-Hartman , Rui Miguel Silva Subject: [PATCH v14 10/13] media: imx7.rst: add documentation for i.MX7 media driver Date: Wed, 6 Feb 2019 15:13:25 +0000 Message-Id: <20190206151328.21629-11-rui.silva@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190206151328.21629-1-rui.silva@linaro.org> References: <20190206151328.21629-1-rui.silva@linaro.org> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add rst document to describe the i.MX7 media driver and also a working example from the Warp7 board usage with a OV2680 sensor. Signed-off-by: Rui Miguel Silva Acked-by: Sakari Ailus --- Documentation/media/v4l-drivers/imx7.rst | 159 ++++++++++++++++++++++ Documentation/media/v4l-drivers/index.rst | 1 + 2 files changed, 160 insertions(+) create mode 100644 Documentation/media/v4l-drivers/imx7.rst -- 2.20.1 diff --git a/Documentation/media/v4l-drivers/imx7.rst b/Documentation/media/v4l-drivers/imx7.rst new file mode 100644 index 000000000000..804d900da535 --- /dev/null +++ b/Documentation/media/v4l-drivers/imx7.rst @@ -0,0 +1,159 @@ +.. SPDX-License-Identifier: GPL-2.0 + +i.MX7 Video Capture Driver +========================== + +Introduction +------------ + +The i.MX7 contrary to the i.MX5/6 family does not contain an Image Processing +Unit (IPU); because of that the capabilities to perform operations or +manipulation of the capture frames are less feature rich. + +For image capture the i.MX7 has three units: +- CMOS Sensor Interface (CSI) +- Video Multiplexer +- MIPI CSI-2 Receiver + +:: + |\ + MIPI Camera Input ---> MIPI CSI-2 --- > | \ + | \ + | M | + | U | ------> CSI ---> Capture + | X | + | / + Parallel Camera Input ----------------> | / + |/ + +For additional information, please refer to the latest versions of the i.MX7 +reference manual [#f1]_. + +Entities +-------- + +imx7-mipi-csi2 +-------------- + +This is the MIPI CSI-2 receiver entity. It has one sink pad to receive the pixel +data from MIPI CSI-2 camera sensor. It has one source pad, corresponding to the +virtual channel 0. This module is compliant to previous version of Samsung +D-phy, and supports two D-PHY Rx Data lanes. + +csi_mux +------- + +This is the video multiplexer. It has two sink pads to select from either camera +sensor with a parallel interface or from MIPI CSI-2 virtual channel 0. It has +a single source pad that routes to the CSI. + +csi +--- + +The CSI enables the chip to connect directly to external CMOS image sensor. CSI +can interface directly with Parallel and MIPI CSI-2 buses. It has 256 x 64 FIFO +to store received image pixel data and embedded DMA controllers to transfer data +from the FIFO through AHB bus. + +This entity has one sink pad that receives from the csi_mux entity and a single +source pad that routes video frames directly to memory buffers. This pad is +routed to a capture device node. + +Usage Notes +----------- + +To aid in configuration and for backward compatibility with V4L2 applications +that access controls only from video device nodes, the capture device interfaces +inherit controls from the active entities in the current pipeline, so controls +can be accessed either directly from the subdev or from the active capture +device interface. For example, the sensor controls are available either from the +sensor subdevs or from the active capture device. + +Warp7 with OV2680 +----------------- + +On this platform an OV2680 MIPI CSI-2 module is connected to the internal MIPI +CSI-2 receiver. The following example configures a video capture pipeline with +an output of 800x600, and BGGR 10 bit bayer format: + +.. code-block:: none + # Setup links + media-ctl -l "'ov2680 1-0036':0 -> 'imx7-mipi-csis.0':0[1]" + media-ctl -l "'imx7-mipi-csis.0':1 -> 'csi_mux':1[1]" + media-ctl -l "'csi_mux':2 -> 'csi':0[1]" + media-ctl -l "'csi':1 -> 'csi capture':0[1]" + + # Configure pads for pipeline + media-ctl -V "'ov2680 1-0036':0 [fmt:SBGGR10_1X10/800x600 field:none]" + media-ctl -V "'csi_mux':1 [fmt:SBGGR10_1X10/800x600 field:none]" + media-ctl -V "'csi_mux':2 [fmt:SBGGR10_1X10/800x600 field:none]" + media-ctl -V "'imx7-mipi-csis.0':0 [fmt:SBGGR10_1X10/800x600 field:none]" + media-ctl -V "'csi':0 [fmt:SBGGR10_1X10/800x600 field:none]" + +After this streaming can start. The v4l2-ctl tool can be used to select any of +the resolutions supported by the sensor. + +.. code-block:: none + root@imx7s-warp:~# media-ctl -p + Media controller API version 4.17.0 + + Media device information + ------------------------ + driver imx-media + model imx-media + serial + bus info + hw revision 0x0 + driver version 4.17.0 + + Device topology + - entity 1: csi (2 pads, 2 links) + type V4L2 subdev subtype Unknown flags 0 + device node name /dev/v4l-subdev0 + pad0: Sink + [fmt:SBGGR10_1X10/800x600 field:none] + <- "csi_mux":2 [ENABLED] + pad1: Source + [fmt:SBGGR10_1X10/800x600 field:none] + -> "csi capture":0 [ENABLED] + + - entity 4: csi capture (1 pad, 1 link) + type Node subtype V4L flags 0 + device node name /dev/video0 + pad0: Sink + <- "csi":1 [ENABLED] + + - entity 10: csi_mux (3 pads, 2 links) + type V4L2 subdev subtype Unknown flags 0 + device node name /dev/v4l-subdev1 + pad0: Sink + [fmt:unknown/0x0] + pad1: Sink + [fmt:unknown/800x600 field:none] + <- "imx7-mipi-csis.0":1 [ENABLED] + pad2: Source + [fmt:unknown/800x600 field:none] + -> "csi":0 [ENABLED] + + - entity 14: imx7-mipi-csis.0 (2 pads, 2 links) + type V4L2 subdev subtype Unknown flags 0 + device node name /dev/v4l-subdev2 + pad0: Sink + [fmt:SBGGR10_1X10/800x600 field:none] + <- "ov2680 1-0036":0 [ENABLED] + pad1: Source + [fmt:SBGGR10_1X10/800x600 field:none] + -> "csi_mux":1 [ENABLED] + + - entity 17: ov2680 1-0036 (1 pad, 1 link) + type V4L2 subdev subtype Sensor flags 0 + device node name /dev/v4l-subdev3 + pad0: Source + [fmt:SBGGR10_1X10/800x600 field:none] + -> "imx7-mipi-csis.0":0 [ENABLED] + + +References +---------- + +.. [#f1] https://www.nxp.com/docs/en/reference-manual/IMX7SRM.pdf diff --git a/Documentation/media/v4l-drivers/index.rst b/Documentation/media/v4l-drivers/index.rst index f28570ec9e42..dfd4b205937c 100644 --- a/Documentation/media/v4l-drivers/index.rst +++ b/Documentation/media/v4l-drivers/index.rst @@ -44,6 +44,7 @@ For more details see the file COPYING in the source distribution of Linux. davinci-vpbe fimc imx + imx7 ipu3 ivtv max2175 From patchwork Wed Feb 6 15:13:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Miguel Silva X-Patchwork-Id: 157640 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp6525424jaa; Wed, 6 Feb 2019 07:14:05 -0800 (PST) X-Google-Smtp-Source: AHgI3IYK0DRX7zZGpDklVOsQpwmRfTgmd3387QZxXgetmENfas91D3IPEmVVMgIsD9wIIY6tGT9s X-Received: by 2002:a62:b2c3:: with SMTP id z64mr10879878pfl.120.1549466045615; Wed, 06 Feb 2019 07:14:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549466045; cv=none; d=google.com; s=arc-20160816; b=sYN3IsJFBNe5Fz+ABcm3KufVj6/JicPiCpCwjkQ/rB1d6159dJLqYVtqTnYRqDx+Bo 637RNMTYdGlBj3UJXQLcG9U73ZQHurhF3qn5gF0k9dnQ3ZCm8U328+yew7HYiXsdPNSq s1U5Elhko0dzx9hqJ9o6npPk6QeyazEois32DZb+eseIQlkqImaSCN/Kdy5cEmjzF8js cn69t7OwrfMyP2MxZkfxHKpxeTCe0AcZtpxGJTRxg9CQFK62VGsNCpEv/Otx+MmOX041 mHc2FvDhtJ42Sm/NUWIgQqQJ5N86q1ukG654DoXLVvYrSvxM0yLuo1upvX0zKIvg/y16 IyiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=GWBv8TFqzFxnlkNvYBhlA0CSDp04MBjWsOjyfNPbaXc=; b=iFCEDb6Y9EfM7HpLTpmCxvWsnDMifGLvn62XmF9dSJFbQZ1ftTlxhZsFsBBssNGvVX tqJNQBYWEehqO5hH+SeYZDhh2DnKjcOAB41/oa+l9tLnqGighUPwwtFBymVR57Obl5/e +RDUrWlIYsY7k+/VEMPpNujielmn7IB8qxjGZT1sxS26EF4ua9GCVTcLeJeb703Whn4E X0VC28Xtatd1j1jzA1uzNI/WRkmOKyFzCGAQIIcbIBnhLYIkcZWE6ekKuhWM/KirD5Lu dCdxJ+5AjA5b6hU1O8Mbmkuei8SbYbJISA3jr1xf0XP24y9R590BOgXkTmLRvgdBDCY3 7rEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J4jd8CaJ; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ba9si5924534plb.109.2019.02.06.07.14.05; Wed, 06 Feb 2019 07:14:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J4jd8CaJ; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731188AbfBFPOE (ORCPT + 7 others); Wed, 6 Feb 2019 10:14:04 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:38573 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731182AbfBFPOE (ORCPT ); Wed, 6 Feb 2019 10:14:04 -0500 Received: by mail-wm1-f68.google.com with SMTP id m22so3149838wml.3 for ; Wed, 06 Feb 2019 07:14:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GWBv8TFqzFxnlkNvYBhlA0CSDp04MBjWsOjyfNPbaXc=; b=J4jd8CaJmvidCN+EqYP/RhBImDCO8XDEFQ3SkWa5wWs2LlBFEszBTAO7ggNlpEMkyE NRvzPjfdL6qbLwREBzRm8YSG6aI5YtiPhD/nSFCwmDd/PBtBQpGsEFceN/l4Nl9o7MaW zRfr3DsFaiYxIyS8IamnrqSIUTbZ37qO9igd7auoMjBt91K1nS1ZY3e3peruPVd4uNP1 Gqwd5arL7ciQQMg0t4zhIwb9k9ZKRVoXBSfeWUcqdbpxnJEirjEkXKdnCTW1sRc2OHrV UUDbaT0UVkPy+64N+CwZrQjJxSmfguyEysG77OaiuUxv7o3J6QYe1SxxweTBnUJch16F GoRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GWBv8TFqzFxnlkNvYBhlA0CSDp04MBjWsOjyfNPbaXc=; b=aulZF3VLs0MTfFF6kpfbqkPG++UwtgUxgH1eeE5Mfqd6QGjR8fSZp7mh97O5DbT7tx R++qrpBsx2jkPDqFjDAXJDG8cANw2DCcNtyX2HAg179N5rL7R+UTZ9WJ3Fvr8dtU5otU gZ6EvmOegyxeElyPrQIMGtziBJBEu6U+SHYLa0koNxRXuKdQvT6Y1fgr00xp5zbI8h3C t8fR7YQBkRqzIia6RjnO1Nifto1B/mpcCqegA/WGFE9hj9qUGQDBG+bVvWDsHozG/T2u ekRaxM6pePX534pwY09zDYTO2DXG3iNt/igA+ZPDg519z6EPSUDMYMeA1LYdzcJuSOcF R/hw== X-Gm-Message-State: AHQUAubMs5W+tcSFwHzPOdPEDB+/doH5gyL9hhznEQAFSNlw9BiR4Wu9 PWFvOYmm2b24HNwP81j5Npnfww== X-Received: by 2002:a1c:a401:: with SMTP id n1mr3760706wme.101.1549466043134; Wed, 06 Feb 2019 07:14:03 -0800 (PST) Received: from arch-late.local (a109-49-46-234.cpe.netcabo.pt. [109.49.46.234]) by smtp.gmail.com with ESMTPSA id f22sm11207836wmj.26.2019.02.06.07.14.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Feb 2019 07:14:02 -0800 (PST) From: Rui Miguel Silva To: sakari.ailus@linux.intel.com, Steve Longerbeam , Hans Verkuil , Philipp Zabel Cc: linux-media@vger.kernel.org, devel@driverdev.osuosl.org, devicetree@vger.kernel.org, Greg Kroah-Hartman , Rui Miguel Silva Subject: [PATCH v14 11/13] media: staging/imx: add i.MX7 entries to TODO file Date: Wed, 6 Feb 2019 15:13:26 +0000 Message-Id: <20190206151328.21629-12-rui.silva@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190206151328.21629-1-rui.silva@linaro.org> References: <20190206151328.21629-1-rui.silva@linaro.org> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add some i.MX7 related entries to TODO file. Signed-off-by: Rui Miguel Silva Acked-by: Sakari Ailus --- drivers/staging/media/imx/TODO | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.20.1 diff --git a/drivers/staging/media/imx/TODO b/drivers/staging/media/imx/TODO index aeeb15494a49..6f29b5ca5324 100644 --- a/drivers/staging/media/imx/TODO +++ b/drivers/staging/media/imx/TODO @@ -45,3 +45,12 @@ Which means a port must not contain mixed-use endpoints, they must all refer to media links between V4L2 subdevices. + +- i.MX7: all of the above, since it uses the imx media core + +- i.MX7: use Frame Interval Monitor + +- i.MX7: runtime testing with parallel sensor, links setup and streaming + +- i.MX7: runtime testing with different formats, for the time only 10-bit bayer + is tested From patchwork Wed Feb 6 15:13:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Miguel Silva X-Patchwork-Id: 157641 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp6525482jaa; Wed, 6 Feb 2019 07:14:09 -0800 (PST) X-Google-Smtp-Source: AHgI3IabPYuhDFu/ATjOyfPGXDAvd4A4TaMVuQdxa4cu0qULg5CWNtkf0KgAVWDxxdUjGFfq6XZc X-Received: by 2002:a63:40c6:: with SMTP id n189mr9811796pga.355.1549466048961; Wed, 06 Feb 2019 07:14:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549466048; cv=none; d=google.com; s=arc-20160816; b=y3ANweo8lHrHiWgjECrt5+/bQaVkfgJAtfwsybqVTGFfiT3kfdPjy7Xjg6Mos41Qyt oZTyd63wLWTizim7HJ5f1EIUvEl5AZef1bi9cDXiTEAFAIYI00jN+XBiz3luFY76QcGX SZelmFAWPTOSteC3sMvOyYU8TVGeW8qViuNty1xq/m1TCx/4kKjQ1N9AOWP9X1kQg7Ye aqwSLUWfFv9L63hs0Pgr73cYllEPH2nRGfQ5uh5q01BipJNXF+HO51UA8N7DvgccKP4/ h8PIcNCNuN/VIo/+rTSsCqAFZJITB6/JTVOEbEt4fxprUOsARWoVwp4SU0ut6mtTizk5 LYiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=tQ0yXI3h/vEMlDmKxGMU2fxncWjHgyDux1n9KSlzAIA=; b=lhxumioNfx6iD8TnFTMRiLp9NHg2Y71v4V4nLlzBfOWieFbzFGCNSh3UYr5cUciT2c oL2p3ILTJ2uCAiFzngo9YLbZzbcU2iyzaQwS/jjMFrweLgemIN8REtHwrLifhEhcVDPw 6JP3yWKtej5En41Zs7Y0l4T2vLXFYrndFKmsZ6ly513vVElfjLlV8lv939z4Wg3iCIJd klDAnsv+KprbjxjoNyHgFN6ZIYSJ9DVBln6G4BupDHH5y7P6oMJuTcPmiGS7/fDBIy/h eRvIVZ7GyyuEkly+U6YuiBOuHfiPdz7N0MjKXgUQWPfhjS7xdDN63Qmltp2y4Pf/su/W KpsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Nj61gi4J; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l8si5971706pgr.345.2019.02.06.07.14.08; Wed, 06 Feb 2019 07:14:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Nj61gi4J; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727403AbfBFPOH (ORCPT + 7 others); Wed, 6 Feb 2019 10:14:07 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:51837 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730050AbfBFPOH (ORCPT ); Wed, 6 Feb 2019 10:14:07 -0500 Received: by mail-wm1-f65.google.com with SMTP id b11so2870630wmj.1 for ; Wed, 06 Feb 2019 07:14:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tQ0yXI3h/vEMlDmKxGMU2fxncWjHgyDux1n9KSlzAIA=; b=Nj61gi4JqoZV0jJjt7qoStZV3bWnFJ9K/mBZxnPgrqze8zUK7p+uyfEVee71SO+70M F5VJ8OdOWslNj/v4A3cEOzZ1DPMIzJmBOy9XMtL/fSmcUeFE8OlG5HCwmnQXutfrFUrV q641ByZTMATwuueNZN8tpIMyWOG8FbhnXs0gPFF8tbOLkPNSZlPxGeaehgDEEGP63Y9t eOh0bK8wepkdl2cu9ocMBcA5mVVVGbjEP4zC93EAjA2MZdrVVmNiMD13vdaab/BBEpwg 1UceeCed4sekuMVlRPpdZuUE8SEvcpa3KWpih857Cjke/KtPPQx6W6c34XKfsKXrqn6p g8Pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tQ0yXI3h/vEMlDmKxGMU2fxncWjHgyDux1n9KSlzAIA=; b=BKfQp8MyNZ3I1CUyjF9ygZHboGxd1oLNR+mQAnr2PcrCy0fgmX8vckaCox82VN5Z/k 4+9Ob0eWl8X4Ma89S8t6z9e2dEYYQihhEnjO+W6gD2wH/bCeS3kbQrzq/goztA5hlUbJ 9xaOLOpCDfQl7yVZQ7PddPeOnFhwifWVjrNh/OujMR7m5kv3ky0ZM4P0ILgHS6uR8Lgi qZf12LvLtHlT5WdxMAZThuEHXtsjH1sRnYKkq3SzbC4zAr7fEb+o6rMVZkcYIVszd2sb shBBip9FH51EsrAaPJ1PKpN5o1UQlvlWIKVOmFAWWrPEB2wLOElhdO1HBpCc9qDqIwHn QHSg== X-Gm-Message-State: AHQUAuZUg3iXmoVOgEv+fmGNs27fTjib6yxNC+tgjJhKZgvZrHurtakx bdvNTWdUcHz3dGziRhLHDlHtDw== X-Received: by 2002:a1c:e10a:: with SMTP id y10mr3571972wmg.73.1549466045316; Wed, 06 Feb 2019 07:14:05 -0800 (PST) Received: from arch-late.local (a109-49-46-234.cpe.netcabo.pt. [109.49.46.234]) by smtp.gmail.com with ESMTPSA id f22sm11207836wmj.26.2019.02.06.07.14.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Feb 2019 07:14:04 -0800 (PST) From: Rui Miguel Silva To: sakari.ailus@linux.intel.com, Steve Longerbeam , Hans Verkuil , Philipp Zabel Cc: linux-media@vger.kernel.org, devel@driverdev.osuosl.org, devicetree@vger.kernel.org, Greg Kroah-Hartman , Rui Miguel Silva Subject: [PATCH v14 12/13] media: video-mux: add bayer formats Date: Wed, 6 Feb 2019 15:13:27 +0000 Message-Id: <20190206151328.21629-13-rui.silva@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190206151328.21629-1-rui.silva@linaro.org> References: <20190206151328.21629-1-rui.silva@linaro.org> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add non vendor bayer formats to the allowed format array. Signed-off-by: Rui Miguel Silva Reviewed-by: Philipp Zabel Acked-by: Sakari Ailus --- drivers/media/platform/video-mux.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) -- 2.20.1 diff --git a/drivers/media/platform/video-mux.c b/drivers/media/platform/video-mux.c index c33900e3c23e..0ba30756e1e4 100644 --- a/drivers/media/platform/video-mux.c +++ b/drivers/media/platform/video-mux.c @@ -263,6 +263,26 @@ static int video_mux_set_format(struct v4l2_subdev *sd, case MEDIA_BUS_FMT_UYYVYY16_0_5X48: case MEDIA_BUS_FMT_JPEG_1X8: case MEDIA_BUS_FMT_AHSV8888_1X32: + case MEDIA_BUS_FMT_SBGGR8_1X8: + case MEDIA_BUS_FMT_SGBRG8_1X8: + case MEDIA_BUS_FMT_SGRBG8_1X8: + case MEDIA_BUS_FMT_SRGGB8_1X8: + case MEDIA_BUS_FMT_SBGGR10_1X10: + case MEDIA_BUS_FMT_SGBRG10_1X10: + case MEDIA_BUS_FMT_SGRBG10_1X10: + case MEDIA_BUS_FMT_SRGGB10_1X10: + case MEDIA_BUS_FMT_SBGGR12_1X12: + case MEDIA_BUS_FMT_SGBRG12_1X12: + case MEDIA_BUS_FMT_SGRBG12_1X12: + case MEDIA_BUS_FMT_SRGGB12_1X12: + case MEDIA_BUS_FMT_SBGGR14_1X14: + case MEDIA_BUS_FMT_SGBRG14_1X14: + case MEDIA_BUS_FMT_SGRBG14_1X14: + case MEDIA_BUS_FMT_SRGGB14_1X14: + case MEDIA_BUS_FMT_SBGGR16_1X16: + case MEDIA_BUS_FMT_SGBRG16_1X16: + case MEDIA_BUS_FMT_SGRBG16_1X16: + case MEDIA_BUS_FMT_SRGGB16_1X16: break; default: sdformat->format.code = MEDIA_BUS_FMT_Y8_1X8;