diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-04-13 04:30:12 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2021-05-23 19:21:33 +0200 |
commit | 88fc81388df942e580b65afa197c97c490b5b855 (patch) | |
tree | cb11f9eb726e03ca427532e49b336978d218d841 /drivers/staging/media | |
parent | 7479454cfef039f208cfd1e5b6cead38dc0caa05 (diff) |
media: imx: imx7_mipi_csis: Reject invalid data-lanes settings
The CSIS doesn't support data lanes reordering. Reject invalid settings.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/staging/media')
-rw-r--r-- | drivers/staging/media/imx/imx7-mipi-csis.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/staging/media/imx/imx7-mipi-csis.c b/drivers/staging/media/imx/imx7-mipi-csis.c index a1eaccc922a2..14ff785ba5d5 100644 --- a/drivers/staging/media/imx/imx7-mipi-csis.c +++ b/drivers/staging/media/imx/imx7-mipi-csis.c @@ -1114,6 +1114,7 @@ static int mipi_csis_async_register(struct csi_state *state) }; struct v4l2_async_subdev *asd; struct fwnode_handle *ep; + unsigned int i; int ret; v4l2_async_notifier_init(&state->notifier); @@ -1127,6 +1128,14 @@ static int mipi_csis_async_register(struct csi_state *state) if (ret) goto err_parse; + for (i = 0; i < vep.bus.mipi_csi2.num_data_lanes; ++i) { + if (vep.bus.mipi_csi2.data_lanes[i] != i + 1) { + dev_err(state->dev, + "data lanes reordering is not supported"); + goto err_parse; + } + } + state->bus = vep.bus.mipi_csi2; dev_dbg(state->dev, "data lanes: %d\n", state->bus.num_data_lanes); |