Forráskód Böngészése

Merge "msm: camera: csiphy: Rearrange csiphy debugfs" into camera-kernel.lnx.5.0

Haritha Chintalapati 4 éve
szülő
commit
ed9a69cf4b

+ 2 - 2
drivers/cam_sensor_module/cam_csiphy/cam_csiphy_core.c

@@ -195,7 +195,7 @@ void cam_csiphy_reset(struct csiphy_device *csiphy_dev)
 			+ 5);
 	}
 
-	if (csiphy_dev->en_status_reg_dump) {
+	if (csiphy_dev->en_lane_status_reg_dump) {
 		CAM_INFO(CAM_CSIPHY, "Status Reg Dump after phy reset");
 		cam_csiphy_print_status_reg(csiphy_dev);
 	}
@@ -2087,7 +2087,7 @@ int32_t cam_csiphy_core_cfg(void *phy_dev,
 
 		csiphy_dev->start_dev_count++;
 
-		if (csiphy_dev->en_status_reg_dump) {
+		if (csiphy_dev->en_lane_status_reg_dump) {
 			usleep_range(50000, 50005);
 			CAM_INFO(CAM_CSIPHY, "Status Reg Dump after config");
 			cam_csiphy_print_status_reg(csiphy_dev);

+ 21 - 30
drivers/cam_sensor_module/cam_csiphy/cam_csiphy_dev.c

@@ -10,7 +10,7 @@
 #include <media/cam_sensor.h>
 #include "camera_main.h"
 
-#define CSIPHY_DEBUGFS_NAME_MAX_SIZE 30
+#define CSIPHY_DEBUGFS_NAME_MAX_SIZE 10
 static struct dentry *root_dentry;
 
 static void cam_csiphy_subdev_handle_message(
@@ -27,7 +27,7 @@ static void cam_csiphy_subdev_handle_message(
 		if (data == csiphy_dev->soc_info.index) {
 			cam_csiphy_status_dmp(csiphy_dev);
 
-			if (csiphy_dev->en_status_reg_dump) {
+			if (csiphy_dev->en_lane_status_reg_dump) {
 				CAM_INFO(CAM_CSIPHY,
 					"Status Reg Dump on failure");
 				cam_csiphy_print_status_reg(csiphy_dev);
@@ -41,7 +41,6 @@ static void cam_csiphy_subdev_handle_message(
 
 static int cam_csiphy_debug_register(struct csiphy_device *csiphy_dev)
 {
-	int rc = 0;
 	struct dentry *dbgfileptr = NULL;
 	char debugfs_name[CSIPHY_DEBUGFS_NAME_MAX_SIZE];
 
@@ -51,39 +50,31 @@ static int cam_csiphy_debug_register(struct csiphy_device *csiphy_dev)
 	}
 
 	if (!root_dentry) {
-		dbgfileptr = debugfs_create_dir("camera_csiphy", NULL);
-		if (!dbgfileptr) {
-			CAM_ERR(CAM_CSIPHY,
-				"Debugfs could not create directory!");
-			rc = -ENOENT;
-			goto end;
+		root_dentry = debugfs_create_dir("camera_csiphy", NULL);
+		if (IS_ERR(root_dentry)) {
+			CAM_ERR(CAM_CSIPHY, "Debugfs could not create root directory. rc: %ld",
+				root_dentry);
+			return -ENOENT;
 		}
-		/* Store parent inode for cleanup in caller */
-		root_dentry = dbgfileptr;
 	}
 
-	snprintf(debugfs_name, CSIPHY_DEBUGFS_NAME_MAX_SIZE, "%s%d%s", "csiphy",
-		csiphy_dev->soc_info.index,
-		"_en_irq_dump");
-	dbgfileptr = debugfs_create_bool(debugfs_name, 0644,
-		root_dentry, &csiphy_dev->enable_irq_dump);
+	/* Create the CSIPHY directory for this csiphy */
+	snprintf(debugfs_name, CSIPHY_DEBUGFS_NAME_MAX_SIZE, "CSIPHY%d",
+		csiphy_dev->soc_info.index);
+	dbgfileptr = debugfs_create_dir(debugfs_name, root_dentry);
+	if (IS_ERR(dbgfileptr)) {
+		CAM_ERR(CAM_CSIPHY, "Could not create a debugfs PHY indx subdirectory. rc: %ld",
+			dbgfileptr);
+		return -ENOENT;
+	}
 
-	memset(debugfs_name, 0, CSIPHY_DEBUGFS_NAME_MAX_SIZE);
+	debugfs_create_bool("en_irq_status_reg_dump", 0644,
+		dbgfileptr, &csiphy_dev->enable_irq_dump);
 
-	snprintf(debugfs_name, CSIPHY_DEBUGFS_NAME_MAX_SIZE, "%s%d%s", "csiphy",
-		csiphy_dev->soc_info.index,
-		"_en_status_reg_dump");
-	dbgfileptr = debugfs_create_bool(debugfs_name, 0644,
-		root_dentry, &csiphy_dev->en_status_reg_dump);
+	debugfs_create_bool("en_lane_status_reg_dump", 0644,
+		dbgfileptr, &csiphy_dev->en_lane_status_reg_dump);
 
-	if (IS_ERR(dbgfileptr)) {
-		if (PTR_ERR(dbgfileptr) == -ENODEV)
-			CAM_WARN(CAM_CSIPHY, "DebugFS not enabled in kernel!");
-		else
-			rc = PTR_ERR(dbgfileptr);
-	}
-end:
-	return rc;
+	return 0;
 }
 
 static void cam_csiphy_debug_unregister(void)

+ 2 - 2
drivers/cam_sensor_module/cam_csiphy/cam_csiphy_dev.h

@@ -306,7 +306,7 @@ struct csiphy_work_queue {
  * @ops                        : KMD operations
  * @crm_cb                     : Callback API pointers
  * @enable_irq_dump            : Debugfs flag to enable hw IRQ register dump
- * @en_status_reg_dump         : Debugfs flag to enable cphy/dphy specific
+ * @en_lane_status_reg_dump    : Debugfs flag to enable cphy/dphy lane status dump
  * @preamble_enable            : To enable preamble pattern
  * @work_queue                 : Work queue to offload the work
  */
@@ -339,7 +339,7 @@ struct csiphy_device {
 	struct cam_req_mgr_kmd_ops     ops;
 	struct cam_req_mgr_crm_cb     *crm_cb;
 	bool                           enable_irq_dump;
-	bool                           en_status_reg_dump;
+	bool                           en_lane_status_reg_dump;
 	uint16_t                       preamble_enable;
 	struct workqueue_struct       *work_queue;
 };