MLK-18098: camera: add MIPI and PARALLEL CSI support in one dtb
authorGuoniu.Zhou <guoniu.zhou@nxp.com>
Fri, 20 Apr 2018 08:23:09 +0000 (16:23 +0800)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
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 <sandor.yu@nxp.com>
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
drivers/media/platform/imx8/mxc-media-dev.c

index fc0b1f7..9f7b920 100644 (file)
@@ -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);