2019-07-22 09:11:20

by Jan Kotas

[permalink] [raw]
Subject: [PATCH v2 0/4] media: Add support for Cadence CSI2TX version 2.1

This patchset adds support for Cadence CSI2TX controller version 2.1.
Existing compatibility with v1.3 is updated and maintained.

Jan Kotas (4):
media: dt-bindings: Update bindings for Cadence CSI2TX version 2.1
media: Add lane checks for Cadence CSI2TX
media: Fix Lane mapping in Cadence CSI2TX
media: Add support for Cadence CSI2TX 2.1

.../devicetree/bindings/media/cdns,csi2tx.txt | 3 +-
drivers/media/platform/cadence/cdns-csi2tx.c | 155 ++++++++++++++++-----
2 files changed, 125 insertions(+), 33 deletions(-)

--
2.15.0


2019-07-22 09:11:46

by Jan Kotas

[permalink] [raw]
Subject: [PATCH v2 2/4] media: Add lane checks for Cadence CSI2TX

This patch adds lane checks for CSI2TX, to prevent clock lane
being used as a data lane.

Signed-off-by: Jan Kotas <[email protected]>
---
drivers/media/platform/cadence/cdns-csi2tx.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/cadence/cdns-csi2tx.c b/drivers/media/platform/cadence/cdns-csi2tx.c
index 5042d053b..232259c71 100644
--- a/drivers/media/platform/cadence/cdns-csi2tx.c
+++ b/drivers/media/platform/cadence/cdns-csi2tx.c
@@ -2,7 +2,7 @@
/*
* Driver for Cadence MIPI-CSI2 TX Controller
*
- * Copyright (C) 2017-2018 Cadence Design Systems Inc.
+ * Copyright (C) 2017-2019 Cadence Design Systems Inc.
*/

#include <linux/clk.h>
@@ -434,7 +434,7 @@ static int csi2tx_check_lanes(struct csi2tx_priv *csi2tx)
{
struct v4l2_fwnode_endpoint v4l2_ep = { .bus_type = 0 };
struct device_node *ep;
- int ret;
+ int ret, i;

ep = of_graph_get_endpoint_by_regs(csi2tx->dev->of_node, 0, 0);
if (!ep)
@@ -461,6 +461,15 @@ static int csi2tx_check_lanes(struct csi2tx_priv *csi2tx)
goto out;
}

+ for (i = 0; i < csi2tx->num_lanes; i++) {
+ if (v4l2_ep.bus.mipi_csi2.data_lanes[i] < 1) {
+ dev_err(csi2tx->dev, "Invalid lane[%d] number: %u\n",
+ i, v4l2_ep.bus.mipi_csi2.data_lanes[i]);
+ ret = -EINVAL;
+ goto out;
+ }
+ }
+
memcpy(csi2tx->lanes, v4l2_ep.bus.mipi_csi2.data_lanes,
sizeof(csi2tx->lanes));

--
2.15.0

2019-07-22 10:04:13

by Maxime Ripard

[permalink] [raw]
Subject: Re: [PATCH v2 0/4] media: Add support for Cadence CSI2TX version 2.1

On Mon, Jul 22, 2019 at 09:22:19AM +0100, Jan Kotas wrote:
> This patchset adds support for Cadence CSI2TX controller version 2.1.
> Existing compatibility with v1.3 is updated and maintained.
>

For the whole series

Acked-by: Maxime Ripard <[email protected]>

Maxime

--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


Attachments:
(No filename) (378.00 B)
signature.asc (235.00 B)
Download all attachments