From ebbfb4d5dbb8efe4360ee5e1ebadefed2c38432d Mon Sep 17 00:00:00 2001 From: Mukund Madhusudan Atre Date: Mon, 16 Dec 2019 11:34:53 -0800 Subject: [PATCH] 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 --- drivers/cam_cpas/cam_cpas_soc.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/drivers/cam_cpas/cam_cpas_soc.c b/drivers/cam_cpas/cam_cpas_soc.c index b8847626f0ff..a55f4a97813f 100644 --- a/drivers/cam_cpas/cam_cpas_soc.c +++ b/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); } }