summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2017-04-03 06:24:37 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2017-04-03 06:24:37 -0700
commiteeae91e332de9a84a4215f93095abeed06ee58eb (patch)
treedf2de5adba5a51ab96361aa60ea15cf69b8745df
parent58889c53f5ef7c1bf0e2378f3a212148ccae490e (diff)
parent911cdb13749d9294205186930f71b047ae753577 (diff)
Merge "msm: camera: isp: Set the clock rate for camss vfe clock"
-rw-r--r--drivers/media/platform/msm/camera_v2/isp/msm_isp.h2
-rw-r--r--drivers/media/platform/msm/camera_v2/isp/msm_isp47.c18
-rw-r--r--drivers/media/platform/msm/camera_v2/isp/msm_isp_axi_util.c7
-rw-r--r--drivers/media/platform/msm/camera_v2/isp/msm_isp_util.c6
4 files changed, 20 insertions, 13 deletions
diff --git a/drivers/media/platform/msm/camera_v2/isp/msm_isp.h b/drivers/media/platform/msm/camera_v2/isp/msm_isp.h
index 45c2dd588bc9..7f88abc40c02 100644
--- a/drivers/media/platform/msm/camera_v2/isp/msm_isp.h
+++ b/drivers/media/platform/msm/camera_v2/isp/msm_isp.h
@@ -802,7 +802,6 @@ struct vfe_device {
/* State variables */
uint32_t vfe_hw_version;
- int vfe_clk_idx;
uint32_t vfe_open_cnt;
uint8_t vt_enable;
uint32_t vfe_ub_policy;
@@ -819,7 +818,6 @@ struct vfe_device {
struct msm_isp_statistics *stats;
uint64_t msm_isp_last_overflow_ab;
uint64_t msm_isp_last_overflow_ib;
- uint32_t msm_isp_vfe_clk_rate;
struct msm_isp_ub_info *ub_info;
uint32_t isp_sof_debug;
uint32_t isp_raw0_debug;
diff --git a/drivers/media/platform/msm/camera_v2/isp/msm_isp47.c b/drivers/media/platform/msm/camera_v2/isp/msm_isp47.c
index f38c2f50df6a..4fd1dd767409 100644
--- a/drivers/media/platform/msm/camera_v2/isp/msm_isp47.c
+++ b/drivers/media/platform/msm/camera_v2/isp/msm_isp47.c
@@ -281,9 +281,11 @@ int msm_isp47_ahb_clk_cfg(struct vfe_device *vfe_dev,
vfe_dev->hw_info->vfe_ops.platform_ops.get_clk_rates(vfe_dev,
&clk_rates);
- if (vfe_dev->msm_isp_vfe_clk_rate <= clk_rates.svs_rate)
+ if (vfe_dev->vfe_clk_info[vfe_dev->hw_info->vfe_clk_idx].clk_rate <=
+ clk_rates.svs_rate)
src_clk_vote = CAM_AHB_SVS_VOTE;
- else if (vfe_dev->msm_isp_vfe_clk_rate <= clk_rates.nominal_rate)
+ else if (vfe_dev->vfe_clk_info[vfe_dev->hw_info->vfe_clk_idx].clk_rate
+ <= clk_rates.nominal_rate)
src_clk_vote = CAM_AHB_NOMINAL_VOTE;
else
src_clk_vote = CAM_AHB_TURBO_VOTE;
@@ -2595,17 +2597,19 @@ int msm_vfe47_set_clk_rate(struct vfe_device *vfe_dev, long *rate)
long clk_rate, prev_clk_rate;
clk_rate = clk_round_rate(vfe_dev->vfe_clk[clk_idx], *rate);
- if (vfe_dev->msm_isp_vfe_clk_rate == clk_rate)
+ if (vfe_dev->vfe_clk_info[clk_idx].clk_rate == clk_rate)
return rc;
- prev_clk_rate = vfe_dev->msm_isp_vfe_clk_rate;
- vfe_dev->msm_isp_vfe_clk_rate = clk_rate;
+ prev_clk_rate =
+ vfe_dev->vfe_clk_info[clk_idx].clk_rate;
+ vfe_dev->vfe_clk_info[clk_idx].clk_rate =
+ clk_rate;
/*
* if cx_ipeak is supported vote first so that dsp throttling is
* reduced before we go to turbo
*/
if ((vfe_dev->vfe_cx_ipeak) &&
- (vfe_dev->msm_isp_vfe_clk_rate >=
+ (vfe_dev->vfe_clk_info[clk_idx].clk_rate >=
vfe_dev->vfe_clk_rates[MSM_VFE_CLK_RATE_NOMINAL]
[vfe_dev->hw_info->vfe_clk_idx]) &&
prev_clk_rate <
@@ -2628,7 +2632,7 @@ int msm_vfe47_set_clk_rate(struct vfe_device *vfe_dev, long *rate)
* if voting done earlier
*/
if ((vfe_dev->vfe_cx_ipeak) &&
- (vfe_dev->msm_isp_vfe_clk_rate <
+ (vfe_dev->vfe_clk_info[clk_idx].clk_rate <
vfe_dev->vfe_clk_rates[MSM_VFE_CLK_RATE_NOMINAL]
[vfe_dev->hw_info->vfe_clk_idx]) &&
prev_clk_rate >=
diff --git a/drivers/media/platform/msm/camera_v2/isp/msm_isp_axi_util.c b/drivers/media/platform/msm/camera_v2/isp/msm_isp_axi_util.c
index b44b7573e0e6..ebd3a32281d7 100644
--- a/drivers/media/platform/msm/camera_v2/isp/msm_isp_axi_util.c
+++ b/drivers/media/platform/msm/camera_v2/isp/msm_isp_axi_util.c
@@ -1136,7 +1136,8 @@ static void msm_isp_calculate_bandwidth(
axi_data = &vfe_dev->axi_data;
if (stream_info->stream_src < RDI_INTF_0) {
stream_info->bandwidth[i] =
- (vfe_dev->msm_isp_vfe_clk_rate /
+ (vfe_dev->vfe_clk_info[
+ vfe_dev->hw_info->vfe_clk_idx].clk_rate /
axi_data->src_info[VFE_PIX_0].width) *
stream_info->max_width[i];
stream_info->bandwidth[i] =
@@ -1149,7 +1150,9 @@ static void msm_isp_calculate_bandwidth(
stream_info->output_format);
if (rdi < VFE_SRC_MAX) {
stream_info->bandwidth[i] =
- (vfe_dev->msm_isp_vfe_clk_rate / 8) * bpp;
+ (vfe_dev->vfe_clk_info[
+ vfe_dev->hw_info->vfe_clk_idx].clk_rate /
+ 8) * bpp;
} else {
pr_err("%s: Invalid rdi interface\n", __func__);
}
diff --git a/drivers/media/platform/msm/camera_v2/isp/msm_isp_util.c b/drivers/media/platform/msm/camera_v2/isp/msm_isp_util.c
index f4e81c02208c..4ba358f8dba1 100644
--- a/drivers/media/platform/msm/camera_v2/isp/msm_isp_util.c
+++ b/drivers/media/platform/msm/camera_v2/isp/msm_isp_util.c
@@ -166,7 +166,8 @@ void msm_isp_util_get_bandwidth_stats(struct vfe_device *vfe_dev,
stats->isp_cpp_ib = isp_bandwidth_mgr.client_info[ISP_CPP].ib;
stats->last_overflow_ab = vfe_dev->msm_isp_last_overflow_ab;
stats->last_overflow_ib = vfe_dev->msm_isp_last_overflow_ib;
- stats->vfe_clk_rate = vfe_dev->msm_isp_vfe_clk_rate;
+ stats->vfe_clk_rate = vfe_dev->vfe_clk_info[
+ vfe_dev->hw_info->vfe_clk_idx].clk_rate;
stats->cpp_clk_rate = msm_isp_cpp_clk_rate;
}
@@ -538,7 +539,8 @@ int msm_isp_cfg_input(struct vfe_device *vfe_dev, void *arg)
* Only set rate to higher, do not lower higher
* rate needed by another input
*/
- if (pixel_clock > vfe_dev->msm_isp_vfe_clk_rate) {
+ if (pixel_clock > vfe_dev->vfe_clk_info[
+ vfe_dev->hw_info->vfe_clk_idx].clk_rate) {
rc = vfe_dev->hw_info->vfe_ops.platform_ops.set_clk_rate(
vfe_dev,
&pixel_clock);