Parcourir la source

msm: camera: cpas: Fix parsing of static bw values for ICC

The static values for AHB bw do not exceed u32, and using u64
parsing function to read it requires unnecessary device tree
changes. Changing parsing function for bw values from 64-bit
to 32-bit version.

CRs-Fixed: 2584631
Change-Id: Ie7c685fd40a0ee390f997fbe6cf3610c2209e3f1
Signed-off-by: Mukund Madhusudan Atre <[email protected]>
Mukund Madhusudan Atre il y a 5 ans
Parent
commit
ebbfb4d5db
1 fichiers modifiés avec 14 ajouts et 7 suppressions
  1. 14 7
      drivers/cam_cpas/cam_cpas_soc.c

+ 14 - 7
drivers/cam_cpas/cam_cpas_soc.c

@@ -569,13 +569,14 @@ int cam_cpas_get_custom_dt_info(struct cam_hw_info *cpas_hw,
 			return -EINVAL;
 		}
 
-		num_bw_values = of_property_count_u64_elems(of_node,
+		num_bw_values = of_property_count_u32_elems(of_node,
 			"cam-ahb-bw-KBps");
 		if (num_bw_values <= 0) {
 			CAM_ERR(CAM_UTIL, "Error counting ahb bw values");
 			return -EINVAL;
 		}
 
+		CAM_DBG(CAM_CPAS, "AHB: num bw values %d", num_bw_values);
 		num_levels = (num_bw_values / 2);
 
 		if (num_levels !=
@@ -586,11 +587,11 @@ int cam_cpas_get_custom_dt_info(struct cam_hw_info *cpas_hw,
 		}
 
 		for (i = 0; i < num_levels; i++) {
-			rc = of_property_read_u64_index(of_node,
+			rc = of_property_read_u32_index(of_node,
 				"cam-ahb-bw-KBps",
 				(i * 2),
-				&cpas_core->ahb_bus_client.common_data
-				.bw_pair[i].ab);
+				(uint32_t *) &cpas_core->ahb_bus_client
+				.common_data.bw_pair[i].ab);
 			if (rc) {
 				CAM_ERR(CAM_UTIL,
 					"Error reading ab bw value, rc=%d",
@@ -598,17 +599,23 @@ int cam_cpas_get_custom_dt_info(struct cam_hw_info *cpas_hw,
 				return rc;
 			}
 
-			rc = of_property_read_u64_index(of_node,
+			rc = of_property_read_u32_index(of_node,
 				"cam-ahb-bw-KBps",
 				((i * 2) + 1),
-				&cpas_core->ahb_bus_client.common_data
-				.bw_pair[i].ib);
+				(uint32_t *) &cpas_core->ahb_bus_client
+				.common_data.bw_pair[i].ib);
 			if (rc) {
 				CAM_ERR(CAM_UTIL,
 					"Error reading ib bw value, rc=%d",
 					rc);
 				return rc;
 			}
+
+			CAM_DBG(CAM_CPAS,
+				"AHB: Level: %d, ab_value %llu, ib_value: %llu",
+				i, cpas_core->ahb_bus_client.common_data
+				.bw_pair[i].ab, cpas_core->ahb_bus_client
+				.common_data.bw_pair[i].ib);
 		}
 	}