msm: camera: Change data type of data rate
Change data rate to uint64, to ensure that the value sent to kernel is not corrupted. Change-Id: I692c1c3e591cbac24931078e0fb8938900fc991c Signed-off-by: Samyukta Mogily <smogily@codeaurora.org>
This commit is contained in:
parent
502257f3e6
commit
fd4aade756
3 changed files with 9 additions and 6 deletions
|
@ -135,8 +135,10 @@ static int msm_csiphy_3phase_lane_config(
|
||||||
uint8_t i = 0;
|
uint8_t i = 0;
|
||||||
uint16_t lane_mask = 0, lane_enable = 0, temp;
|
uint16_t lane_mask = 0, lane_enable = 0, temp;
|
||||||
void __iomem *csiphybase;
|
void __iomem *csiphybase;
|
||||||
|
uint64_t two_gbps = 0;
|
||||||
|
|
||||||
csiphybase = csiphy_dev->base;
|
csiphybase = csiphy_dev->base;
|
||||||
|
two_gbps = 2 * (uint64_t)csiphy_params->lane_cnt * GBPS;
|
||||||
lane_mask = csiphy_params->lane_mask & 0x7;
|
lane_mask = csiphy_params->lane_mask & 0x7;
|
||||||
while (lane_mask != 0) {
|
while (lane_mask != 0) {
|
||||||
temp = (i << 1)+1;
|
temp = (i << 1)+1;
|
||||||
|
@ -282,9 +284,9 @@ static int msm_csiphy_3phase_lane_config(
|
||||||
csiphy_3ph_reg.mipi_csiphy_3ph_lnn_ctrl51.addr +
|
csiphy_3ph_reg.mipi_csiphy_3ph_lnn_ctrl51.addr +
|
||||||
0x200*i);
|
0x200*i);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((csiphy_dev->hw_version == CSIPHY_VERSION_V35) &&
|
if ((csiphy_dev->hw_version == CSIPHY_VERSION_V35) &&
|
||||||
((csiphy_params->data_rate /
|
(csiphy_params->data_rate > two_gbps)) {
|
||||||
csiphy_params->lane_cnt) > 2 * GBPS)) {
|
|
||||||
msm_camera_io_w(0x40,
|
msm_camera_io_w(0x40,
|
||||||
csiphybase +
|
csiphybase +
|
||||||
csiphy_dev->ctrl_reg->csiphy_3ph_reg.
|
csiphy_dev->ctrl_reg->csiphy_3ph_reg.
|
||||||
|
@ -807,7 +809,7 @@ static int msm_csiphy_lane_config(struct csiphy_device *csiphy_dev,
|
||||||
ratio = csiphy_dev->csiphy_max_clk/clk_rate;
|
ratio = csiphy_dev->csiphy_max_clk/clk_rate;
|
||||||
csiphy_params->settle_cnt = csiphy_params->settle_cnt/ratio;
|
csiphy_params->settle_cnt = csiphy_params->settle_cnt/ratio;
|
||||||
}
|
}
|
||||||
CDBG("%s csiphy_params, mask = 0x%x cnt = %d, data rate = %lu\n",
|
CDBG("%s csiphy_params, mask = 0x%x cnt = %d, data rate = %llu\n",
|
||||||
__func__,
|
__func__,
|
||||||
csiphy_params->lane_mask,
|
csiphy_params->lane_mask,
|
||||||
csiphy_params->lane_cnt, csiphy_params->data_rate);
|
csiphy_params->lane_cnt, csiphy_params->data_rate);
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
/* Copyright (c) 2009-2012, 2014-2016 The Linux Foundation. All rights reserved.
|
/* Copyright (c) 2009-2012, 2014-2016, 2018 The Linux Foundation.
|
||||||
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License version 2 and
|
* it under the terms of the GNU General Public License version 2 and
|
||||||
|
@ -1386,7 +1387,7 @@ struct msm_camera_csiphy_params {
|
||||||
uint16_t lane_mask;
|
uint16_t lane_mask;
|
||||||
uint8_t combo_mode;
|
uint8_t combo_mode;
|
||||||
uint8_t csid_core;
|
uint8_t csid_core;
|
||||||
unsigned long data_rate;
|
uint64_t data_rate;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct msm_camera_csi2_params {
|
struct msm_camera_csi2_params {
|
||||||
|
|
|
@ -367,7 +367,7 @@ struct msm_camera_csiphy_params {
|
||||||
unsigned char csid_core;
|
unsigned char csid_core;
|
||||||
unsigned int csiphy_clk;
|
unsigned int csiphy_clk;
|
||||||
unsigned char csi_3phase;
|
unsigned char csi_3phase;
|
||||||
unsigned long data_rate;
|
uint64_t data_rate;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct msm_camera_i2c_seq_reg_array {
|
struct msm_camera_i2c_seq_reg_array {
|
||||||
|
|
Loading…
Add table
Reference in a new issue