From 3bd37a9668fa0fc0faae7f01220ecb5bb0e57866 Mon Sep 17 00:00:00 2001 From: "Guoniu.Zhou" Date: Fri, 20 Apr 2018 16:23:09 +0800 Subject: [PATCH] MLK-18098: camera: add MIPI and PARALLEL CSI support in one dtb 1. Divide ov5640_v3.c into two parts, one for parallel csi driver and the other for mipi csi driver 2. Add parallel and mipi support in one dtb file. User can select one of them without changing the dtb file Reviewed-by: Sandor.yu Signed-off-by: Guoniu.Zhou --- drivers/media/platform/imx8/mxc-media-dev.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/imx8/mxc-media-dev.c b/drivers/media/platform/imx8/mxc-media-dev.c index fc0b1f717847..9f7b920b9222 100644 --- a/drivers/media/platform/imx8/mxc-media-dev.c +++ b/drivers/media/platform/imx8/mxc-media-dev.c @@ -1,5 +1,5 @@ /* - * Copyright 2017 NXP + * Copyright 2017-2018 NXP */ /* * The code contained herein is licensed under the GNU General Public @@ -199,7 +199,7 @@ static int mxc_md_create_links(struct mxc_md *mxc_md) if (sensor == NULL || sensor->sd == NULL) continue; - if (mxc_md->parallel_csi) { + if (mxc_md->parallel_csi && !sensor->mipi_mode) { pcsidev = mxc_md->pcsidev; if (pcsidev == NULL) continue; @@ -345,11 +345,12 @@ static int register_sensor_entities(struct mxc_md *mxc_md) struct device_node *port; if (of_node_cmp(node->name, "csi") && - of_node_cmp(node->name, "pcsi")) { + of_node_cmp(node->name, "pcsi")) continue; - } + if (!of_device_is_available(node)) continue; + /* csi2 node have only port */ port = of_get_next_child(node, NULL); if (!port) @@ -368,6 +369,9 @@ static int register_sensor_entities(struct mxc_md *mxc_md) mxc_md->sensor[index].id = endpoint.base.port; + if (!of_node_cmp(node->name, "csi")) + mxc_md->sensor[index].mipi_mode = true; + /* remote port---sensor node */ rem = of_graph_get_remote_port_parent(ep); of_node_put(ep); -- 2.17.1