Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d6ba4387 authored by Wyes Karny's avatar Wyes Karny Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: common: Fix for wrong ab ib value send to ICC



While passing ab and ib value to interconnect
for conversion from BPS to ICC units wrong kernel macro is used.
Therefore use correct macro to get the proper ICC units.
In the same way, update the correct flash on active time (use div_u64
instead of do_div).

CRs-Fixed: 2971025
Change-Id: I4cd0de06bd081ea95cdc76eb74887c4d5815241a
Signed-off-by: default avatarWyes Karny <wkarny@codeaurora.org>
parent 3597b314
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@
#include "cam_res_mgr_api.h"
#include "cam_common_util.h"
#include "cam_packet_util.h"
#include <asm/div64.h>
#include <linux/math64.h>

static uint default_on_timer = 2;
module_param(default_on_timer, uint, 0644);
@@ -1559,7 +1559,7 @@ int cam_flash_pmic_pkt_parser(struct cam_flash_ctrl *fctrl, void *arg)
				add_req.trigger_eof = true;
				/* Active time for the preflash */
				flash_data->flash_active_time_ms =
				do_div(flash_operation_info->time_on_duration_ns, 1000000);
				div_u64(flash_operation_info->time_on_duration_ns, 1000000);
				CAM_DBG(CAM_FLASH,
					"PRECISE FLASH: active_time: %llu",
					flash_data->flash_active_time_ms);
+5 −5
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@

#include <linux/interconnect.h>
#include "cam_soc_bus.h"
#include <asm/div64.h>
#include <linux/math64.h>
/**
 * struct cam_soc_bus_client_data : Bus client data
 *
@@ -37,8 +37,8 @@ int cam_soc_bus_client_update_request(void *client, unsigned int idx)
	CAM_DBG(CAM_PERF, "Bus client=[%s] index[%d] ab[%llu] ib[%llu]",
		bus_client->common_data->name, idx, ab, ib);

	rc = icc_set_bw(bus_client_data->icc_data, do_div(ab, 1000),
		do_div(ib, 1000));
	rc = icc_set_bw(bus_client_data->icc_data, div_u64(ab, 1000),
		div_u64(ib, 1000));
	if (rc) {
		CAM_ERR(CAM_UTIL,
			"Update request failed, client[%s], idx: %d",
@@ -60,8 +60,8 @@ int cam_soc_bus_client_update_bw(void *client, uint64_t ab, uint64_t ib)

	CAM_DBG(CAM_PERF, "Bus client=[%s] :ab[%llu] ib[%llu]",
		bus_client->common_data->name, ab, ib);
	rc = icc_set_bw(bus_client_data->icc_data, do_div(ab, 1000),
		do_div(ib, 1000));
	rc = icc_set_bw(bus_client_data->icc_data, div_u64(ab, 1000),
		div_u64(ib, 1000));
	if (rc) {
		CAM_ERR(CAM_UTIL, "Update request failed, client[%s]",
			bus_client->common_data->name);