瀏覽代碼

msm: camera: sensor: Add support for CSIPHY fuse

Add support to disable the 5th CSIPHY based on
the CSIPHY SW fuse register bit.

Change-Id: Iae9dd7df0c0277eb48a258c91502390d042c9c43
CRs-Fixed: 3071805
Signed-off-by: Shravan Nevatia <[email protected]>
Shravan Nevatia 3 年之前
父節點
當前提交
d841951985
共有 2 個文件被更改,包括 13 次插入1 次删除
  1. 11 0
      drivers/cam_sensor_module/cam_csiphy/cam_csiphy_dev.c
  2. 2 1
      dt-bindings/msm-camera.h

+ 11 - 0
drivers/cam_sensor_module/cam_csiphy/cam_csiphy_dev.c

@@ -9,6 +9,7 @@
 #include "cam_csiphy_core.h"
 #include "cam_csiphy_core.h"
 #include <media/cam_sensor.h>
 #include <media/cam_sensor.h>
 #include "camera_main.h"
 #include "camera_main.h"
+#include <dt-bindings/msm-camera.h>
 
 
 #define CSIPHY_DEBUGFS_NAME_MAX_SIZE 10
 #define CSIPHY_DEBUGFS_NAME_MAX_SIZE 10
 static struct dentry *root_dentry;
 static struct dentry *root_dentry;
@@ -248,6 +249,16 @@ static int cam_csiphy_component_bind(struct device *dev,
 		goto csiphy_no_resource;
 		goto csiphy_no_resource;
 	}
 	}
 
 
+	/* validate PHY fuse only for CSIPHY4 */
+	if ((new_csiphy_dev->soc_info.index == 4) &&
+		!cam_cpas_is_feature_supported(
+			CAM_CPAS_CSIPHY_FUSE,
+			(1 << new_csiphy_dev->soc_info.index), NULL)) {
+		CAM_ERR(CAM_CSIPHY, "PHY%d is not supported",
+			new_csiphy_dev->soc_info.index);
+		goto csiphy_no_resource;
+	}
+
 	new_csiphy_dev->v4l2_dev_str.internal_ops =
 	new_csiphy_dev->v4l2_dev_str.internal_ops =
 		&csiphy_subdev_intern_ops;
 		&csiphy_subdev_intern_ops;
 	new_csiphy_dev->v4l2_dev_str.ops =
 	new_csiphy_dev->v4l2_dev_str.ops =

+ 2 - 1
dt-bindings/msm-camera.h

@@ -91,7 +91,8 @@
 #define CAM_CPAS_ISP_FUSE      4
 #define CAM_CPAS_ISP_FUSE      4
 #define CAM_CPAS_ISP_PIX_FUSE  5
 #define CAM_CPAS_ISP_PIX_FUSE  5
 #define CAM_CPAS_ISP_LITE_FUSE 6
 #define CAM_CPAS_ISP_LITE_FUSE 6
-#define CAM_CPAS_FUSE_FEATURE_MAX 7
+#define CAM_CPAS_CSIPHY_FUSE   7
+#define CAM_CPAS_FUSE_FEATURE_MAX 8
 
 
 #define CCI_MASTER_0         0
 #define CCI_MASTER_0         0
 #define CCI_MASTER_1         1
 #define CCI_MASTER_1         1